The Division of Consumer Protection is the main consumer protection agency for NYC and is responsible for filing and mediating consumer affairs complaints against businesses. The DCWP licenses more than 51,000 businesses in more than 40 industries and enforces consumer protections through laws and regulations. Most importantly, the DCWP helps consumers who are having problems with a business through its complaint and mediation process.
Recognizing the pivotal role of consumer feedback as a key metric for departmental performance, this analysis aims to investigate the importance of various features in influencing consumer satisfaction within the Division of Consumer Protection (DCWP).
In pursuit of these objectives, the report encompasses comprehensive feature analyses, delving into the nuanced details of satisfaction assessments to discern patterns and uncover insights that illuminate the factors influencing consumer contentment. Additionally, an in-depth examination of relationships is conducted to ascertain whether certain variables, such as complaint-solving duration and restitution, exhibit discernible impacts on consumer satisfaction.
By comprehending the significance of these factors, the DCWP can not only refine its complaint mediation process but also contribute to providing valuable recommendations that fortify the DCWP’s commitment to consumer satisfaction and public service.
This report delves into a dataset (Source: NYC Open Data) of consumer complaints against businesses that were mediated by the DCWP during the last and current calendar years, and it excludes complaints that have ongoing legal investigations. A brief information about the features are given below.
| Column Name | Description |
| Business Name | Name of the business against which a complaint has been made. |
| Industry | The business category of the business against which a complaint has been made. |
| Complaint Type | Indicates the type of complaint made. |
| Mediation Start Date | Date mediation started. |
| Mediation Close Date | Date mediation ended. |
| Complaint Result | Outcome of mediation efforts. | |
| Satisfaction | This section indicates whether the complaint was mediated to the satisfaction of both the business and consumer. |
| Restitution | Total amount of consumer restitution secured through mediation. |
| Business Building | The building number of the business’s address. |
| Business Street | The street name of the business’s address. |
| Building Address Unit | The unit number of the business’s address (e.g., Apartment/Suite/Other). |
| Business City | The city where the business is located. |
| Business State | The state where the business is located. |
| Business Zip | The zip code where the business is located. |
| Complainant Zip | The zip code where the individual who filed the complaint is located. |
| Longitude | Longitude where the individual who filed the complaint is located. |
| Latitude | Latitude where the individual who filed the complaint is located. |
Note: All data sources are directly accessed from the NYC OpenData website. Therefore, potential delays and errors may arise due to temporary issues, such as website maintenance or dataset updates, affecting online availability.
All required packages are already installed!
suppressPackageStartupMessages({
library(tidyr)
library(dplyr)
library(lubridate)
library(tidyverse)
library(corrplot)
library(psych)
library(GPArotation)
library(skimr)
library(kableExtra)
library(leaflet)
library(plotly)
library(broom)
library(httr)
})
Libraries Loaded!
| Name | df |
| Number of rows | 24294 |
| Number of columns | 17 |
| _______________________ | |
| Column type frequency: | |
| character | 14 |
| numeric | 3 |
| ________________________ | |
| Group variables | None |
Variable type: character
| skim_variable | n_missing | complete_rate | min | max | empty | n_unique | whitespace |
|---|---|---|---|---|---|---|---|
| Business Name | 769 | 0.97 | 2 | 88 | 0 | 12731 | 0 |
| Industry | 0 | 1.00 | 5 | 48 | 0 | 83 | 0 |
| Complaint Type | 1940 | 0.92 | 4 | 39 | 0 | 72 | 0 |
| Mediation Start Date | 1 | 1.00 | 10 | 10 | 0 | 1745 | 0 |
| Mediation Close Date | 0 | 1.00 | 10 | 10 | 0 | 2382 | 0 |
| Complaint Result | 0 | 1.00 | 10 | 50 | 0 | 26 | 0 |
| Satisfaction | 4022 | 0.83 | 2 | 50 | 0 | 3 | 0 |
| Business Building | 1731 | 0.93 | 1 | 15 | 0 | 4924 | 0 |
| Business Street | 2140 | 0.91 | 1 | 29 | 0 | 3374 | 0 |
| Building Address Unit | 19983 | 0.18 | 1 | 10 | 0 | 944 | 0 |
| Business City | 1668 | 0.93 | 4 | 20 | 0 | 849 | 0 |
| Business State | 1667 | 0.93 | 2 | 17 | 0 | 47 | 0 |
| Business Zip | 1667 | 0.93 | 2 | 5 | 0 | 1299 | 0 |
| Complainant Zip | 2005 | 0.92 | 2 | 5 | 0 | 1853 | 0 |
Variable type: numeric
| skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
|---|---|---|---|---|---|---|---|---|---|---|
| Restitution | 1 | 1.00 | 418.07 | 2797.66 | 0.00 | 0.00 | 0.00 | 49.00 | 132616.00 | ▇▁▁▁▁ |
| Longitude | 10403 | 0.57 | -73.92 | 0.09 | -77.52 | -73.98 | -73.93 | -73.87 | -73.70 | ▁▁▁▁▇ |
| Latitude | 10403 | 0.57 | 40.73 | 0.08 | 40.11 | 40.67 | 40.73 | 40.77 | 40.91 | ▁▁▁▇▆ |
We identified only 1 missing value in the
Mediation Start Date column out of over twenty thousand
records in that column. Given the extremely low proportion of missing
values (less than 0.01% of the total dataset), we decided to remove the
row containing the missing value to ensure the integrity of the
dataset.
# Remove rows with missing values in "Mediation Start Date" column
df <- df[!is.na(df$`Mediation Start Date`), ]
Next, we’ll perform an in-depth analysis of missing value proportions for other variables.
| Variable | Proportion |
|---|---|
| Business Name | 3.17% |
| Industry | 0.00% |
| Complaint Type | 7.99% |
| Mediation Start Date | 0.00% |
| Mediation Close Date | 0.00% |
| Complaint Result | 0.00% |
| Satisfaction | 16.56% |
| Restitution | 0.00% |
| Business Building | 7.13% |
| Business Street | 8.81% |
| Building Address Unit | 82.26% |
| Business City | 6.86% |
| Business State | 6.86% |
| Business Zip | 6.86% |
| Complainant Zip | 8.25% |
| Longitude | 42.82% |
| Latitude | 42.82% |
For furthering analysis,we will exclude missing values from the
Complaint Type which plays a pivotal role, and the
proportion of missing values is below 10%.
df <- df[!is.na(df$`Complaint Type`), ]
Based on the data dictionary, the Satisfaction column
comprises three distinct categories. Let’s examine this in practice.
unique(df$Satisfaction)
[1] “Yes” NA “No”
The value ‘NA’ in the Satisfaction column can be
interpreted as ‘Not Evaluated’.To analyze the satisfaction of mediation
and gather reviews, we will narrow down our dataframe to include only
rows with either “Yes” or “No” as values in the Satisfaction column.
df <- df[!is.na(df$Satisfaction), ]
# Check for duplicate rows
has_duplicates <- any(duplicated(df))
if (has_duplicates) {
print("There are duplicate rows in the dataframe.")
} else {
print("There are no duplicate rows in the dataframe.")
}
[1] “There are no duplicate rows in the dataframe.”
date_columns <- c('Mediation Start Date', 'Mediation Close Date')
df <- df %>%
mutate(across(all_of(date_columns), mdy))
This dataset reflects a wide variety of industries, totaling 75 different industries, that are involved in the complaints received by the New York City. These range from home improvement contractors, employment agencies, and restaurants to sightseeing buses and appliance stores.
| Industry | ||
|---|---|---|
| Home Improvement Contractor - 100 | Restaurant - 818 | Sightseeing Bus - 078 |
| Appliances - 244 | Secondhand Dealer Auto - 005 | Furniture Sales - 242 |
| Debt Collection Agency - 122 | Electronic Store - 001 | Auto Rental - 213 |
| Gas Station-Retail - 815 | Misc Non-Food Retail - 817 | Tow Truck Company - 124 |
| Garage - 049 | Garage & Parking Lot - 098 | Laundries |
| Tickets-Live Perf - 260 | Immigration Svc Prv - 893 | Process Server (Individual) - 110 |
| Jewelry Store-Retail - 823 | Other | Retail Store - 820 |
| Mailorder Misc - 319 | Laundry - 064 | Dry Cleaners - 230 |
| Employment Agency - 034 | Dealer In Products For The Disabled - 119 | Electronic & Home Appliance Service Dealer - 115 |
| Hotel/Motel - 460 | Supermarket - 819 | Storage Warehouse - 120 |
| Travel Agency - 440 | Pawnbroker - 080 | Salons And Barbershop - 841 |
| Drug Store Retail - 810 | Secondhand Dealer [General] - 006 | Mini-Storage Company - 830 |
| Auction House - 128 | Debt Settlement - 248 | Tax Preparers - 891 |
| Parking Lot - 050 | Funeral Homes - 888 | Tow Truck Driver - 125 |
| Booting Company - 126 | Ticket Seller Business | Wearing Apparel - 450 |
| Car Wash | Locksmith - 062 | Cabaret - 073 |
| Grocery-Retail - 808 | Health Spa - 839 | Pedicab Driver - 131 |
| Catering Establishment - 075 | Fuel Oil Dealer - 814 | Ticket Seller |
| Hardware-Retail - 811 | Sightseeing Guide - 021 | Gift Certificate - 895 |
| Auto Leasing - 211 | Internet Complaints - 443 | Auctioneer - 036 |
| Floor Coverings - 241 | Auto Dealership - 212 | Scrap Metal Processor - 118 |
| Retail Laundry | Mobile Food Vendor - 881 | Newsstand - 024 |
| Photography Services - 415 | Megastore - 821 | Laundry Jobber - 066 |
| Horse Drawn Cab Driver - 086 | General Vendor - 094 | Pedicab Business - 130 |
| Special Sale - 102 | Third Party Food Delivery | Cigarette Retail Dealer - 127 |
Next, let’s examine the top 10 industries that frequently appear in the dataset. Collectively, these diverse sectors account for a substantial 77.02 % of all complaints. Notably, home improvement contractors hold a prominent position, contributing significantly with a 17.15 %.
| Industry | Count | Proportion |
|---|---|---|
| Home Improvement Contractor - 100 | 3196 | 17.15 % |
| Misc Non-Food Retail - 817 | 1713 | 9.19 % |
| Furniture Sales - 242 | 1687 | 9.05 % |
| Debt Collection Agency - 122 | 1607 | 8.62 % |
| Electronic Store - 001 | 1527 | 8.19 % |
| Tow Truck Company - 124 | 1441 | 7.73 % |
| Secondhand Dealer Auto - 005 | 1385 | 7.43 % |
| Garage - 049 | 964 | 5.17 % |
| Other | 453 | 2.43 % |
| Dry Cleaners - 230 | 384 | 2.06 % |
After the industry analysis, let’s delve into complaint types. There are a total of 68 distinct complaint types, covering a diverse range of issues.Subsequently, we analyze the percentages of the top ten complaint types, offering insights for prioritization by the NYC Consumer Services Division.
The top 10 categories collectively constitute a significant 80.19 % share of the overall complaints, with prominent concerns such as Misrepresentation, Exchange Goods/Contract Cancelled, and Billing Dispute leading the list. This highlights the importance of addressing these specific issues to effectively manage and improve consumer satisfaction.
| Complaint Type | Count | Proportion |
|---|---|---|
| Misrepresentation - M01 | 2630 | 14.11 % |
| Exchange Goods/Contract Cancelled - E01 | 2155 | 11.56 % |
| Billing Dispute - B02 | 2136 | 11.46 % |
| Damaged Goods - D01 | 2036 | 10.92 % |
| Quality of Work - Q01 | 1405 | 7.54 % |
| Non-Delivery of Goods - N01 | 1301 | 6.98 % |
| Non-Delivery of Service - N02 | 1215 | 6.52 % |
| Breach of Contract - B03 | 1052 | 5.64 % |
| Defective Goods - D02 | 604 | 3.24 % |
| Refund Policy - R01 | 413 | 2.22 % |
The geographic distribution underscores the prominence of Queens (3497 complaints) and Manhattan (3,179 complaints), emerging as focal points with the highest volume of received complaints.
The plot reveals a consistent trend over the past decade: the number of received complaints has steadily risen, accompanied by a simultaneous decrease in resolved complaints. This pattern indicates a recent escalation in the severity of issues leading to complaints.
Furthermore, a boxplot analysis of the solve time data provides additional insights into the distribution of resolution periods.The majority of complaints are typically resolved within 100 days, with only a small fraction requiring a more extended resolution period.
The analysis of the pie chart on complaint restitution amounts reveals that a significant proportion, 35.58 %, of cases resulted in financial restitution. On the other hand, 64.42 %, of cases resulted in financial restitution. On the other hand,
The restitution amounts ranging from $100 to $500, there were the most complaints, totaling 2368 . As the restitution amount increases, the number of complaints gradually decreases, especially in higher restitution ranges. This indicates that the majority of complaints are concentrated at lower restitution levels, with fewer cases involving higher restitution amounts.
After a comprehensive exploration of various complaint categories and their distributions, we now shift our focus to a crucial aspect: satisfaction analysis. This section delves into the satisfaction rates associated with different industries, complaint types, and other relevant factors.
In the preceding section, we sorted the data based on mediation case counts, with a specific focus on the Top-10 industries. This approach is designed to provide insights into satisfaction trends within these key sectors.
| Industry | Count | Proportion | Satisfied | Not_Satisfied | Satisfied_Rate |
|---|---|---|---|---|---|
| Home Improvement Contractor - 100 | 3196 | 17.15 % | 1030 | 2166 | 32.23 % |
| Misc Non-Food Retail - 817 | 1713 | 9.19 % | 1048 | 665 | 61.18 % |
| Furniture Sales - 242 | 1687 | 9.05 % | 933 | 754 | 55.31 % |
| Debt Collection Agency - 122 | 1607 | 8.62 % | 1584 | 23 | 98.57 % |
| Electronic Store - 001 | 1527 | 8.19 % | 1076 | 451 | 70.46 % |
| Tow Truck Company - 124 | 1441 | 7.73 % | 962 | 479 | 66.76 % |
| Secondhand Dealer Auto - 005 | 1385 | 7.43 % | 853 | 532 | 61.59 % |
| Garage - 049 | 964 | 5.17 % | 671 | 293 | 69.61 % |
| Other | 453 | 2.43 % | 251 | 202 | 55.41 % |
| Dry Cleaners - 230 | 384 | 2.06 % | 208 | 176 | 54.17 % |
Given the importance of customer satisfaction, it is also crucial to investigate whether differences exist among these complaint types.
| Complaint Type | Count | Proportion | Satisfied | Not_Satisfied | Satisfied_Rate |
|---|---|---|---|---|---|
| Misrepresentation - M01 | 2630 | 14.11 % | 1734 | 896 | 65.93 % |
| Exchange Goods/Contract Cancelled - E01 | 2155 | 11.56 % | 1275 | 880 | 59.16 % |
| Billing Dispute - B02 | 2136 | 11.46 % | 1796 | 340 | 84.08 % |
| Damaged Goods - D01 | 2036 | 10.92 % | 1088 | 948 | 53.44 % |
| Surcharge/Overcharge - S02 | 1904 | 10.21 % | 1395 | 509 | 73.27 % |
| Quality of Work - Q01 | 1405 | 7.54 % | 493 | 912 | 35.09 % |
| Non-Delivery of Goods - N01 | 1301 | 6.98 % | 755 | 546 | 58.03 % |
| Non-Delivery of Service - N02 | 1215 | 6.52 % | 487 | 728 | 40.08 % |
| Breach of Contract - B03 | 1052 | 5.64 % | 472 | 580 | 44.87 % |
| Defective Goods - D02 | 604 | 3.24 % | 390 | 214 | 64.57 % |
In the previous analyses, we observed a growing severity in the number of complaints over the years, coupled with a consistent decline in resolved cases. To further explore potential factors affecting customer satisfaction, We use the Chi-Square Test to determine if there is a significant association between Solve Times and satisfaction.
| TestStatistic | DegreesOfFreedom | PValue | |
|---|---|---|---|
| X-squared | 1950.39916281244 | 138 | < 2.2204460492503e-16 |
The result of the chi-square test indicates a highly significant association between ‘Satisfaction’ and ‘dateTimeDiff’ (p-value < 2.2e-16). This suggests that there is a relationship between these two categorical variables, and they are not independent of each other.
To gain deeper insights and quantify the impact between ‘Satisfaction’ and ‘dateTimeDiff’, we employed a logistic regression model.
| Estimate | Std. Error | z value | scientific_p.value | |
|---|---|---|---|---|
| (Intercept) | 1.4654803449657 | 0.0325909293562514 | 44.965896153084 | < 2.2204460492503e-16 |
| dateTimeDiff | -0.0366773279005097 | 0.00100309234519747 | -36.5642585910566 | < 2.2204460492503e-16 |
The logistic regression results indicate the following:
The p-value for Intercept is very small, indicating that the intercept term is significant in the model.
The p-value for dateTimeDiff is also very small,
suggesting that the effect of the dateTimeDiff variable on the response
variable (Satisfaction) is statistically
significant.
Since the p-values are less than the significance level (usually 0.05), we have sufficient evidence to reject the null hypothesis, indicating that these variables in the model have a significant impact on satisfaction.
The Estimate represents the change in the log-odds. The negative
value for dateTimeDiff indicates that as time increases,
the log-odds of satisfaction decrease. This finding emphasizes the
importance of improving resolution efficiency to enhance consumer
satisfaction.
Firstly, we analyze the satisfaction distribution and restitution status separately for cases with and without restitution to examine their respective patterns.
Satisfaction levels are notably higher in cases involving restitution, with a substantial proportion expressing high satisfaction and contentment. Conversely, situations without restitution exhibit a higher percentage of dissatisfaction, emphasizing the significant impact of restitution on enhancing overall satisfaction.
To further verify the significant difference in satisfaction with and without restitution, We use the Chi-Square Test to determine if there is a significant association between ‘Satisfaction’ and ‘Restitution.’
| TestStatistic | DegreesOfFreedom | PValue | |
|---|---|---|---|
| X-squared | 6616.47378991344 | 1699 | < 2.2204460492503e-16 |
The result of the chi-square test indicates a highly significant association between ‘Satisfaction’ and ‘Restitution’ (p-value < 2.2e-16). This suggests that there is a relationship between these two categorical variables, and they are not independent of each other. To gain deeper insights and quantify the impact of satisfaction on restitution, we conducted a regression analysis.
| Estimate | Std. Error | z value | scientific_p.value | |
|---|---|---|---|---|
| (Intercept) | -0.252568030312877 | 0.0179377054705249 | -14.0802863960441 | < 2.2204460492503e-16 |
| Restitution | 0.0298664479384555 | 0.00101872501509203 | 29.3174777255837 | < 2.2204460492503e-16 |
The logistic regression results indicate the following:
The p-value for Intercept is very small, indicating that the intercept term is significant in the model.
The p-value for Restitution is also very small,
suggesting that the effect of the Restitution variable on
the response variable (Satisfaction) is statistically
significant.
Since the p-values are less than the significance level (usually 0.05), we have sufficient evidence to reject the null hypothesis, indicating that these variables in the model have a significant impact on satisfaction.
The positive value for Restitution indicates that as
Restitution increases, the log-odds of satisfaction increase. This
finding emphasizes the importance of restitution to enhance consumer
satisfaction.
The analysis reveals a consistent increase in received complaints accompanied by a decline in resolutions over the past decade, indicating a potential escalation in the severity of complaint issues that warrants attention and adjustments.
Overall satisfaction rate stands at 60.73%. However, industry-specific variations underscore areas for improvement, notably observed in the case of home improvement contractors.
Relations are observed between solve times, restitution, and satisfaction. Complaint solve times significantly impact satisfaction, with a negative coefficient indicating a decrease in satisfaction odds with prolonged resolution times. Simultaneously, restitution emerges as a critical factor, with an increase associated with higher odds of satisfaction.
Efficiency Improvement in Complaint Resolution: Given the observed impact of solve times on satisfaction, prioritize initiatives aimed at streamlining and expediting the complaint resolution process.
Industry-Specific Strategies: Tailor strategies to address variations in satisfaction levels across industries, with a particular focus on enhancing customer experience in sectors showing lower satisfaction rates, such as home improvement contractors.
Enhancement of Restitution Processes: Further refine and optimize processes related to financial restitution, ensuring clarity, fairness, and efficiency. Explore opportunities to enhance customer satisfaction through improved restitution practices.
Continuous Customer Feedback: Establish mechanisms for continuous customer feedback and utilize feedback loops to integrate customer insights into ongoing strategies for complaint mediation.