options(contrasts = rep("contr.treatment", 2))
library(tidyverse) # package for data cleaning and plotting
library(ordinal) # package for ordinal logit regression
library(MetBrewer) # package for nice color scale
library(modelsummary)
#import the raw data file
socialcare_raw <- read_csv("data/socialcare.csv")
#select relevant columns, rename and relabel
socialcare <- socialcare_raw %>%
select(location_id,
primary_cat = `Location Primary Inspection Category`,
region = `Location Region`,
domain = Domain,
rating = latest_rating,
inherited = `Inherited Rating (Y/N)`,
form_num = legal_form) %>%
# recode legal form types to be more readable / easier to present
mutate(location_id = factor(location_id),
form = case_when(form_num == 1 ~ "FPO",
form_num == 2 ~ "NPO",
form_num == 3 ~ "GOV",
form_num == 4 ~ "CIC",
form_num == 5 ~ "FAM"),
inherited = ifelse(inherited == "Y", TRUE, FALSE),
rating = recode(rating,
"Insufficient evidence to rate" = "NA",
"Requires improvement" = "Req improv")) %>%
# set the order of the values in the factors
mutate(form = ordered(form, levels = c("FPO", "NPO", "GOV", "CIC", "FAM")),
domain = ordered(domain, levels = c("Safe", "Effective", "Caring",
"Reponsive", "Well-led", "Overall")),
# assume the order of the ratings as follows but need to double check with the source
rating = ordered(rating, levels = c("Inadequate","Req improv", "Good", "Outstanding")))
# show first several rows of the data set derived
head(socialcare)
## # A tibble: 6 x 8
## location_id primary_cat region domain rating inherited form_num form
## <fct> <chr> <chr> <ord> <ord> <lgl> <dbl> <ord>
## 1 1-10000792582 Community based a~ Yorks~ Safe Req i~ TRUE 1 FPO
## 2 1-10000792582 Community based a~ Yorks~ Effec~ Req i~ TRUE 1 FPO
## 3 1-10000792582 Community based a~ Yorks~ Caring Good TRUE 1 FPO
## 4 1-10000792582 Community based a~ Yorks~ <NA> Req i~ TRUE 1 FPO
## 5 1-10000792582 Community based a~ Yorks~ Well-~ Req i~ TRUE 1 FPO
## 6 1-10000792582 Community based a~ Yorks~ Overa~ Req i~ TRUE 1 FPO
# inspecting the distribution of the data
point_graph <- ggplot(socialcare, aes(x = form, y = fct_rev(rating),
color = domain)) +
facet_wrap(vars(domain), ncol = 3) +
geom_point(size = 0.3, position = position_jitter(), alpha = 0.5) +
scale_color_manual(values = met.brewer("Austria", 5)) +
guides(color = "none") +
theme_minimal()
point_graph
I check here the region and primary_cat
variables, since the total number of categories are not too large, I
decide to first include region in the model. But the
primary_cat’s distribution is actually two main categories
– community based and residential (divided by 6 rating domains, there
are only 1 or 2 facilities in other categories).I will only keep the
data for these two categories.
table(socialcare$region)
##
## East Midlands East of England London
## 8132 9360 9135
## North East North West South East
## 3660 10559 15621
## South West West Midlands Yorkshire and The Humber
## 10448 9636 8046
table(socialcare$primary_cat)
##
## Acute hospital - Independent non-specialist
## 36
## Ambulance service
## 12
## Community based adult social care services
## 28039
## Community health - NHS & Independent
## 6
## Community substance misuse
## 12
## Hospice services
## 12
## Independent consulting doctors
## 12
## Mental health - community & hospital - independent
## 12
## Remote clinical advice
## 6
## Residential social care
## 56450
# creating a new dummy variable for facility category
socialcare <- socialcare %>%
mutate(category = case_when(primary_cat == "Community based adult social care services" ~ "community",
primary_cat == "Residential social care" ~ "residential",
TRUE ~ as.character(NA)))
# converting the ordinal variable to numerical
socialcare_num <- socialcare %>%
mutate(rating_num = case_when(rating == "Inadequate" ~ 1,
rating == "Req improv" ~ 2,
rating == "Good" ~ 3,
rating == "Outstanding" ~ 4))
# sum up the scores
socialcare_total = socialcare_num %>%
group_by(location_id) %>%
summarise(total = sum(rating_num),
form = first(form),
category = first(category),
region = first(region),
inherited = first(inherited))
# show first several rows of the data set derived
head(socialcare_total)
## # A tibble: 6 x 6
## location_id total form category region inherited
## <fct> <dbl> <ord> <chr> <chr> <lgl>
## 1 1-10000792582 13 FPO community Yorkshire and The Humber TRUE
## 2 1-10000812939 18 FPO residential North West TRUE
## 3 1-10000813008 18 FPO residential North West FALSE
## 4 1-1000210669 18 FPO residential South East FALSE
## 5 1-1000401911 18 FPO residential London FALSE
## 6 1-10005776421 19 FPO residential South West TRUE
I think I am right by using location_id instead of
provider_id. My understanding is that one provider can have
multiple locations. In other words. location_id is the
unique id for the facilities rated.
# run the naive ols model
model_ols_simple <- lm(total ~ form,
data = socialcare_total)
summary(model_ols_simple)
##
## Call:
## lm(formula = total ~ form, data = socialcare_total)
##
## Residuals:
## Min 1Q Median 3Q Max
## -13.8937 0.1063 0.4284 0.4284 18.4284
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.5716029 0.0192467 912.969 < 2e-16 ***
## formNPO 0.3221353 0.0498265 6.465 1.05e-10 ***
## formGOV 0.2927588 0.0961872 3.044 0.002343 **
## formCIC -0.0001743 0.2617685 -0.001 0.999469
## formFAM -0.2626285 0.0682041 -3.851 0.000118 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.827 on 11796 degrees of freedom
## (1744 observations deleted due to missingness)
## Multiple R-squared: 0.005943, Adjusted R-squared: 0.005606
## F-statistic: 17.63 on 4 and 11796 DF, p-value: 1.938e-14
# run the ols model with control
model_ols_total <- lm(total ~ form + category + region + inherited,
data = socialcare_total)
summary(model_ols_total)
##
## Call:
## lm(formula = total ~ form + category + region + inherited, data = socialcare_total)
##
## Residuals:
## Min 1Q Median 3Q Max
## -13.8416 -0.1845 0.3532 0.6066 18.8155
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.53247 0.05943 294.990 < 2e-16 ***
## formNPO 0.30909 0.04931 6.268 3.79e-10 ***
## formGOV 0.28652 0.09524 3.009 0.002631 **
## formCIC -0.11683 0.25863 -0.452 0.651464
## formFAM -0.24361 0.06779 -3.594 0.000327 ***
## categoryresidential -0.25339 0.03573 -7.091 1.40e-12 ***
## regionEast of England 0.19022 0.07294 2.608 0.009116 **
## regionLondon 0.11430 0.07442 1.536 0.124575
## regionNorth East 0.61282 0.09747 6.287 3.34e-10 ***
## regionNorth West 0.34683 0.07196 4.819 1.46e-06 ***
## regionSouth East 0.28692 0.06582 4.359 1.32e-05 ***
## regionSouth West 0.61044 0.07155 8.532 < 2e-16 ***
## regionWest Midlands -0.09459 0.07250 -1.305 0.192013
## regionYorkshire and The Humber 0.03716 0.07617 0.488 0.625665
## inheritedTRUE -0.27851 0.06826 -4.080 4.53e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.801 on 11776 degrees of freedom
## (1754 observations deleted due to missingness)
## Multiple R-squared: 0.02514, Adjusted R-squared: 0.02398
## F-statistic: 21.69 on 14 and 11776 DF, p-value: < 2.2e-16
What I find interesting is he the dummy variable “inherited” does negatively affect the total score. Does it mean facilities with lower rating are more liked to be bought by others?
One caveat with the summing up method is not all locations have all the ratings in each domain. But as shown below the result is quite consistent among different rating categories, with NPO and GOV having higher rating, FAM has lower rating, CIC insignificant difference, compared with FPO.
# run the ols model with control
model_ols_safe <- lm(rating_num ~ form + category + region + inherited,
data = filter(socialcare_num, domain == "Safe"))
summary(model_ols_safe)
##
## Call:
## lm(formula = rating_num ~ form + category + region + inherited,
## data = filter(socialcare_num, domain == "Safe"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.94801 0.08776 0.16318 0.20917 1.27294
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.790830 0.013283 210.107 < 2e-16 ***
## formNPO 0.082874 0.011236 7.376 1.73e-13 ***
## formGOV 0.095768 0.021818 4.389 1.15e-05 ***
## formCIC 0.035772 0.059943 0.597 0.55068
## formFAM -0.024464 0.015329 -1.596 0.11054
## categoryresidential -0.063773 0.007986 -7.986 1.52e-15 ***
## regionEast of England 0.045994 0.016335 2.816 0.00487 **
## regionLondon 0.048137 0.016540 2.910 0.00362 **
## regionNorth East 0.121406 0.021709 5.593 2.28e-08 ***
## regionNorth West 0.066565 0.015988 4.164 3.15e-05 ***
## regionSouth East 0.098220 0.014743 6.662 2.81e-11 ***
## regionSouth West 0.125273 0.016012 7.824 5.52e-15 ***
## regionWest Midlands 0.021178 0.016248 1.303 0.19245
## regionYorkshire and The Humber -0.010843 0.016973 -0.639 0.52294
## inheritedTRUE -0.019351 0.015767 -1.227 0.21972
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4219 on 12922 degrees of freedom
## (1163 observations deleted due to missingness)
## Multiple R-squared: 0.02158, Adjusted R-squared: 0.02052
## F-statistic: 20.36 on 14 and 12922 DF, p-value: < 2.2e-16
# run the ols model with control
model_ols_effective <- lm(rating_num ~ form + category + region + inherited,
data = filter(socialcare_num, domain == "Effective"))
summary(model_ols_effective)
##
## Call:
## lm(formula = rating_num ~ form + category + region + inherited,
## data = filter(socialcare_num, domain == "Effective"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.98755 0.04845 0.07859 0.10228 1.15913
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.892971 0.010496 275.638 < 2e-16 ***
## formNPO 0.040251 0.008843 4.552 5.36e-06 ***
## formGOV 0.038998 0.017189 2.269 0.02330 *
## formCIC -0.034248 0.047165 -0.726 0.46778
## formFAM -0.037483 0.012097 -3.099 0.00195 **
## categoryresidential -0.035998 0.006304 -5.710 1.15e-08 ***
## regionEast of England 0.040743 0.012895 3.159 0.00158 **
## regionLondon 0.053853 0.013069 4.121 3.80e-05 ***
## regionNorth East 0.094263 0.016954 5.560 2.75e-08 ***
## regionNorth West 0.064435 0.012617 5.107 3.32e-07 ***
## regionSouth East 0.048744 0.011622 4.194 2.76e-05 ***
## regionSouth West 0.094574 0.012619 7.494 7.09e-14 ***
## regionWest Midlands 0.021377 0.012771 1.674 0.09417 .
## regionYorkshire and The Humber 0.031479 0.013410 2.347 0.01892 *
## inheritedTRUE -0.032852 0.012270 -2.677 0.00743 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3319 on 12887 degrees of freedom
## (1197 observations deleted due to missingness)
## Multiple R-squared: 0.01261, Adjusted R-squared: 0.01154
## F-statistic: 11.75 on 14 and 12887 DF, p-value: < 2.2e-16
# run the ols model with control
model_ols_caring <- lm(rating_num ~ form + category + region + inherited,
data = filter(socialcare_num, domain == "Caring"))
summary(model_ols_caring)
##
## Call:
## lm(formula = rating_num ~ form + category + region + inherited,
## data = filter(socialcare_num, domain == "Caring"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.05497 -0.04283 -0.00912 0.01721 1.06343
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.016595 0.009296 324.515 < 2e-16 ***
## formNPO 0.031403 0.007848 4.001 6.33e-05 ***
## formGOV 0.033714 0.015252 2.210 0.02709 *
## formCIC 0.013166 0.041802 0.315 0.75280
## formFAM -0.005309 0.010722 -0.495 0.62052
## categoryresidential -0.047334 0.005590 -8.468 < 2e-16 ***
## regionEast of England 0.013524 0.011421 1.184 0.23639
## regionLondon 0.003283 0.011591 0.283 0.77701
## regionNorth East 0.067230 0.015054 4.466 8.04e-06 ***
## regionNorth West 0.020847 0.011184 1.864 0.06235 .
## regionSouth East 0.039856 0.010302 3.869 0.00011 ***
## regionSouth West 0.085706 0.011167 7.675 1.78e-14 ***
## regionWest Midlands -0.013562 0.011332 -1.197 0.23143
## regionYorkshire and The Humber 0.035718 0.011888 3.005 0.00266 **
## inheritedTRUE -0.032688 0.010811 -3.024 0.00250 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2942 on 12883 degrees of freedom
## (1200 observations deleted due to missingness)
## Multiple R-squared: 0.01699, Adjusted R-squared: 0.01593
## F-statistic: 15.91 on 14 and 12883 DF, p-value: < 2.2e-16
# run the ols model with control
model_ols_well_led <- lm(rating_num ~ form + category + region + inherited,
data = filter(socialcare_num, domain == "Well-led"))
summary(model_ols_well_led)
##
## Call:
## lm(formula = rating_num ~ form + category + region + inherited,
## data = filter(socialcare_num, domain == "Well-led"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.99857 0.03341 0.15569 0.22222 1.36997
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.816197 0.016185 174.001 < 2e-16 ***
## formNPO 0.101806 0.013681 7.441 1.06e-13 ***
## formGOV 0.093419 0.026569 3.516 0.000439 ***
## formCIC 0.027025 0.072988 0.370 0.711190
## formFAM -0.046930 0.018665 -2.514 0.011940 *
## categoryresidential -0.066530 0.009726 -6.841 8.24e-12 ***
## regionEast of England 0.028108 0.019892 1.413 0.157665
## regionLondon 0.025987 0.020144 1.290 0.197062
## regionNorth East 0.155352 0.026386 5.888 4.01e-09 ***
## regionNorth West 0.050004 0.019474 2.568 0.010249 *
## regionSouth East 0.056969 0.017958 3.172 0.001515 **
## regionSouth West 0.145312 0.019508 7.449 1.00e-13 ***
## regionWest Midlands -0.072713 0.019789 -3.674 0.000239 ***
## regionYorkshire and The Humber -0.030121 0.020676 -1.457 0.145187
## inheritedTRUE -0.019364 0.019211 -1.008 0.313489
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5137 on 12920 degrees of freedom
## (1167 observations deleted due to missingness)
## Multiple R-squared: 0.02449, Adjusted R-squared: 0.02343
## F-statistic: 23.17 on 14 and 12920 DF, p-value: < 2.2e-16
# run the ols model with control
model_ols_overall <- lm(rating_num ~ form + category + region + inherited,
data = filter(socialcare_num, domain == "Overall"))
summary(model_ols_overall)
##
## Call:
## lm(formula = rating_num ~ form + category + region + inherited,
## data = filter(socialcare_num, domain == "Overall"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.03404 0.04739 0.10623 0.15384 1.26561
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.874615 0.014716 195.337 < 2e-16 ***
## formNPO 0.085695 0.012439 6.889 5.87e-12 ***
## formGOV 0.080432 0.024104 3.337 0.000849 ***
## formCIC 0.021967 0.066971 0.328 0.742907
## formFAM -0.042417 0.016966 -2.500 0.012429 *
## categoryresidential -0.069350 0.008846 -7.840 4.86e-15 ***
## regionEast of England 0.041544 0.018080 2.298 0.021589 *
## regionLondon 0.019154 0.018315 1.046 0.295664
## regionNorth East 0.130930 0.024003 5.455 5.00e-08 ***
## regionNorth West 0.050613 0.017716 2.857 0.004286 **
## regionSouth East 0.061654 0.016322 3.777 0.000159 ***
## regionSouth West 0.143077 0.017736 8.067 7.83e-16 ***
## regionWest Midlands -0.028454 0.017980 -1.583 0.113544
## regionYorkshire and The Humber -0.023589 0.018803 -1.255 0.209652
## inheritedTRUE -0.020701 0.017365 -1.192 0.233237
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4666 on 12897 degrees of freedom
## (1187 observations deleted due to missingness)
## Multiple R-squared: 0.02259, Adjusted R-squared: 0.02152
## F-statistic: 21.29 on 14 and 12897 DF, p-value: < 2.2e-16
modelsummary(list("total" = model_ols_total, "overall" = model_ols_overall, "safe" = model_ols_safe,
"effective" = model_ols_effective, "caring"= model_ols_caring, "well-led" = model_ols_well_led),
statistic = "{std.error} ({p.value}) {stars}")
| total | overall | safe | effective | caring | well-led | |
|---|---|---|---|---|---|---|
| (Intercept) | 17.532*** | 2.875*** | 2.791*** | 2.893*** | 3.017*** | 2.816*** |
| 0.059 (0.000) *** | 0.015 (0.000) *** | 0.013 (0.000) *** | 0.010 (0.000) *** | 0.009 (0.000) *** | 0.016 (0.000) *** | |
| formNPO | 0.309*** | 0.086*** | 0.083*** | 0.040*** | 0.031*** | 0.102*** |
| 0.049 (0.000) *** | 0.012 (0.000) *** | 0.011 (0.000) *** | 0.009 (0.000) *** | 0.008 (0.000) *** | 0.014 (0.000) *** | |
| formGOV | 0.287** | 0.080*** | 0.096*** | 0.039* | 0.034* | 0.093*** |
| 0.095 (0.003) ** | 0.024 (0.001) *** | 0.022 (0.000) *** | 0.017 (0.023) * | 0.015 (0.027) * | 0.027 (0.000) *** | |
| formCIC | -0.117 | 0.022 | 0.036 | -0.034 | 0.013 | 0.027 |
| 0.259 (0.651) | 0.067 (0.743) | 0.060 (0.551) | 0.047 (0.468) | 0.042 (0.753) | 0.073 (0.711) | |
| formFAM | -0.244*** | -0.042* | -0.024 | -0.037** | -0.005 | -0.047* |
| 0.068 (0.000) *** | 0.017 (0.012) * | 0.015 (0.111) | 0.012 (0.002) ** | 0.011 (0.621) | 0.019 (0.012) * | |
| categoryresidential | -0.253*** | -0.069*** | -0.064*** | -0.036*** | -0.047*** | -0.067*** |
| 0.036 (0.000) *** | 0.009 (0.000) *** | 0.008 (0.000) *** | 0.006 (0.000) *** | 0.006 (0.000) *** | 0.010 (0.000) *** | |
| regionEast of England | 0.190** | 0.042* | 0.046** | 0.041** | 0.014 | 0.028 |
| 0.073 (0.009) ** | 0.018 (0.022) * | 0.016 (0.005) ** | 0.013 (0.002) ** | 0.011 (0.236) | 0.020 (0.158) | |
| regionLondon | 0.114 | 0.019 | 0.048** | 0.054*** | 0.003 | 0.026 |
| 0.074 (0.125) | 0.018 (0.296) | 0.017 (0.004) ** | 0.013 (0.000) *** | 0.012 (0.777) | 0.020 (0.197) | |
| regionNorth East | 0.613*** | 0.131*** | 0.121*** | 0.094*** | 0.067*** | 0.155*** |
| 0.097 (0.000) *** | 0.024 (0.000) *** | 0.022 (0.000) *** | 0.017 (0.000) *** | 0.015 (0.000) *** | 0.026 (0.000) *** | |
| regionNorth West | 0.347*** | 0.051** | 0.067*** | 0.064*** | 0.021+ | 0.050* |
| 0.072 (0.000) *** | 0.018 (0.004) ** | 0.016 (0.000) *** | 0.013 (0.000) *** | 0.011 (0.062) + | 0.019 (0.010) * | |
| regionSouth East | 0.287*** | 0.062*** | 0.098*** | 0.049*** | 0.040*** | 0.057** |
| 0.066 (0.000) *** | 0.016 (0.000) *** | 0.015 (0.000) *** | 0.012 (0.000) *** | 0.010 (0.000) *** | 0.018 (0.002) ** | |
| regionSouth West | 0.610*** | 0.143*** | 0.125*** | 0.095*** | 0.086*** | 0.145*** |
| 0.072 (0.000) *** | 0.018 (0.000) *** | 0.016 (0.000) *** | 0.013 (0.000) *** | 0.011 (0.000) *** | 0.020 (0.000) *** | |
| regionWest Midlands | -0.095 | -0.028 | 0.021 | 0.021+ | -0.014 | -0.073*** |
| 0.072 (0.192) | 0.018 (0.114) | 0.016 (0.192) | 0.013 (0.094) + | 0.011 (0.231) | 0.020 (0.000) *** | |
| regionYorkshire and The Humber | 0.037 | -0.024 | -0.011 | 0.031* | 0.036** | -0.030 |
| 0.076 (0.626) | 0.019 (0.210) | 0.017 (0.523) | 0.013 (0.019) * | 0.012 (0.003) ** | 0.021 (0.145) | |
| inheritedTRUE | -0.279*** | -0.021 | -0.019 | -0.033** | -0.033** | -0.019 |
| 0.068 (0.000) *** | 0.017 (0.233) | 0.016 (0.220) | 0.012 (0.007) ** | 0.011 (0.003) ** | 0.019 (0.313) | |
| Num.Obs. | 11791 | 12912 | 12937 | 12902 | 12898 | 12935 |
| R2 | 0.025 | 0.023 | 0.022 | 0.013 | 0.017 | 0.024 |
| R2 Adj. | 0.024 | 0.022 | 0.021 | 0.012 | 0.016 | 0.023 |
| AIC | 47354.7 | 16976.3 | 14402.8 | 8172.5 | 5056.0 | 19494.6 |
| BIC | 47472.7 | 17095.8 | 14522.2 | 8292.0 | 5175.4 | 19614.0 |
| Log.Lik. | -23661.348 | -8472.163 | -7185.377 | -4070.273 | -2511.979 | -9731.282 |
| F | 21.687 | 21.286 | 20.356 | 11.754 | 15.909 | 23.167 |
# run the ordered logit model with control
model_order_overall <- clm(rating ~ form + category + region + inherited,
data = filter(socialcare, domain == "Overall"),
link = "logit")
summary(model_order_overall)
## formula: rating ~ form + category + region + inherited
## data: filter(socialcare, domain == "Overall")
##
## link threshold nobs logLik AIC niter max.grad cond.H
## logit flexible 12912 -8271.64 16577.28 7(0) 3.73e-08 4.2e+02
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## formNPO 0.47845 0.06956 6.878 6.07e-12 ***
## formGOV 0.42458 0.13368 3.176 0.001493 **
## formCIC 0.19437 0.37377 0.520 0.603053
## formFAM -0.21323 0.08625 -2.472 0.013426 *
## categoryresidential -0.38394 0.04828 -7.952 1.84e-15 ***
## regionEast of England 0.23672 0.09607 2.464 0.013742 *
## regionLondon 0.10559 0.09581 1.102 0.270446
## regionNorth East 0.76075 0.13379 5.686 1.30e-08 ***
## regionNorth West 0.28325 0.09380 3.020 0.002531 **
## regionSouth East 0.32239 0.08632 3.735 0.000188 ***
## regionSouth West 0.84297 0.09758 8.639 < 2e-16 ***
## regionWest Midlands -0.14595 0.09196 -1.587 0.112514
## regionYorkshire and The Humber -0.11460 0.09640 -1.189 0.234543
## inheritedTRUE -0.11451 0.09136 -1.253 0.210068
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Threshold coefficients:
## Estimate Std. Error z value
## Inadequate|Req improv -4.44996 0.11015 -40.40
## Req improv|Good -1.71073 0.07848 -21.80
## Good|Outstanding 3.13660 0.08622 36.38
## (1187 observations deleted due to missingness)
I will ran the models but only show the results in the comparing table
# run the ordered logit model with control
model_order_safe <- clm(rating ~ form + category + region + inherited,
data = filter(socialcare, domain == "Safe"),
link = "logit")
model_order_effective <- clm(rating ~ form + category + region + inherited,
data = filter(socialcare, domain == "Effective"),
link = "logit")
model_order_caring <- clm(rating ~ form + category + region + inherited,
data = filter(socialcare, domain == "Caring"),
link = "logit")
model_order_well_led <- clm(rating ~ form + category + region + inherited,
data = filter(socialcare, domain == "Well-led"),
link = "logit")
modelsummary(list("overall" = model_order_overall, "safe" = model_order_safe,
"effective" = model_order_effective, "caring"= model_order_caring, "well-led" = model_order_well_led),
statistic = "{std.error} ({p.value}) {stars}")
| overall | safe | effective | caring | well-led | |
|---|---|---|---|---|---|
| Inadequate|Req improv | -4.450*** | -4.257*** | -5.939*** | -7.098*** | -4.106*** |
| 0.110 (0.000) *** | 0.108 (0.000) *** | 0.206 (0.000) *** | 0.310 (0.000) *** | 0.097 (0.000) *** | |
| Req improv|Good | -1.711*** | -1.455*** | -2.086*** | -3.435*** | -1.346*** |
| 0.078 (0.000) *** | 0.078 (0.000) *** | 0.094 (0.000) *** | 0.122 (0.000) *** | 0.072 (0.000) *** | |
| Good|Outstanding | 3.137*** | 5.875*** | 4.390*** | 3.021*** | 3.170*** |
| 0.086 (0.000) *** | 0.165 (0.000) *** | 0.115 (0.000) *** | 0.119 (0.000) *** | 0.082 (0.000) *** | |
| formNPO | 0.478*** | 0.589*** | 0.422*** | 0.369*** | 0.479*** |
| 0.070 (0.000) *** | 0.081 (0.000) *** | 0.093 (0.000) *** | 0.093 (0.000) *** | 0.064 (0.000) *** | |
| formGOV | 0.425** | 0.685*** | 0.396* | 0.385* | 0.426*** |
| 0.134 (0.001) ** | 0.166 (0.000) *** | 0.180 (0.028) * | 0.176 (0.029) * | 0.125 (0.001) *** | |
| formCIC | 0.194 | 0.333 | -0.345 | 0.160 | 0.134 |
| 0.374 (0.603) | 0.424 (0.432) | 0.428 (0.421) | 0.500 (0.748) | 0.344 (0.696) | |
| formFAM | -0.213* | -0.145 | -0.315** | -0.067 | -0.190* |
| 0.086 (0.013) * | 0.089 (0.105) | 0.105 (0.003) ** | 0.132 (0.615) | 0.080 (0.017) * | |
| categoryresidential | -0.384*** | -0.420*** | -0.368*** | -0.574*** | -0.300*** |
| 0.048 (0.000) *** | 0.052 (0.000) *** | 0.063 (0.000) *** | 0.068 (0.000) *** | 0.044 (0.000) *** | |
| regionEast of England | 0.237* | 0.267** | 0.350** | 0.186 | 0.124 |
| 0.096 (0.014) * | 0.096 (0.005) ** | 0.116 (0.002) ** | 0.144 (0.195) | 0.089 (0.160) | |
| regionLondon | 0.106 | 0.262** | 0.478*** | 0.042 | 0.134 |
| 0.096 (0.270) | 0.098 (0.007) ** | 0.120 (0.000) *** | 0.145 (0.770) | 0.089 (0.133) | |
| regionNorth East | 0.761*** | 0.825*** | 0.938*** | 0.848*** | 0.763*** |
| 0.134 (0.000) *** | 0.149 (0.000) *** | 0.174 (0.000) *** | 0.180 (0.000) *** | 0.125 (0.000) *** | |
| regionNorth West | 0.283** | 0.415*** | 0.584*** | 0.271+ | 0.245** |
| 0.094 (0.003) ** | 0.096 (0.000) *** | 0.117 (0.000) *** | 0.140 (0.053) + | 0.087 (0.005) ** | |
| regionSouth East | 0.322*** | 0.599*** | 0.415*** | 0.504*** | 0.235** |
| 0.086 (0.000) *** | 0.089 (0.000) *** | 0.104 (0.000) *** | 0.129 (0.000) *** | 0.080 (0.003) ** | |
| regionSouth West | 0.843*** | 0.848*** | 0.934*** | 1.037*** | 0.721*** |
| 0.098 (0.000) *** | 0.103 (0.000) *** | 0.122 (0.000) *** | 0.136 (0.000) *** | 0.090 (0.000) *** | |
| regionWest Midlands | -0.146 | 0.113 | 0.179 | -0.183 | -0.319*** |
| 0.092 (0.113) | 0.093 (0.224) | 0.112 (0.108) | 0.141 (0.195) | 0.085 (0.000) *** | |
| regionYorkshire and The Humber | -0.115 | -0.060 | 0.284* | 0.444** | -0.133 |
| 0.096 (0.235) | 0.095 (0.530) | 0.120 (0.017) * | 0.148 (0.003) ** | 0.090 (0.137) | |
| inheritedTRUE | -0.115 | -0.148 | -0.295** | -0.402** | -0.082 |
| 0.091 (0.210) | 0.096 (0.124) | 0.111 (0.008) ** | 0.133 (0.002) ** | 0.085 (0.332) | |
| Num.Obs. | 12912 | 12937 | 12902 | 12898 | 12935 |
| AIC | 16577.3 | 13423.3 | 10345.6 | 8934.4 | 18854.9 |
| BIC | 16704.2 | 13550.2 | 10472.5 | 9061.3 | 18981.9 |
| Log.Lik. | -8271.638 | -6694.648 | -5155.787 | -4450.188 | -9410.471 |
| edf | 17.000 | 17.000 | 17.000 | 17.000 | 17.000 |
My exposure to ordered logit models is limited. Will research more into the correct way to interpret results and derive essential model metrics later. But as is shown the coeffients for the main IV form is consistent with ols models.
# derive the sub-set of home-based care facilities
socialcare_home <- socialcare_num %>%
filter(category == "community")
I will ran the ordered logit models but only show the results in the comparing table
# run the ordered logit model with control
model_order_overall2 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_home, domain == "Overall"),
link = "logit")
model_order_safe2 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_home, domain == "Safe"),
link = "logit")
model_order_effective2 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_home, domain == "Effective"),
link = "logit")
model_order_caring2 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_home, domain == "Caring"),
link = "logit")
model_order_well_led2 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_home, domain == "Well-led"),
link = "logit")
modelsummary(list("overall" = model_order_overall2, "safe" = model_order_safe2,
"effective" = model_order_effective2, "caring"= model_order_caring2,
"well-led" = model_order_well_led2),
statistic = "{std.error} ({p.value}) {stars}")
| overall | safe | effective | caring | well-led | |
|---|---|---|---|---|---|
| Inadequate|Req improv | -4.441*** | -4.285*** | -5.708*** | -7.784*** | -4.155*** |
| 0.206 (0.000) *** | 0.201 (0.000) *** | 0.381 (0.000) *** | 0.732 (0.000) *** | 0.175 (0.000) *** | |
| Req improv|Good | -1.672*** | -1.386*** | -1.974*** | -4.073*** | -1.318*** |
| 0.132 (0.000) *** | 0.130 (0.000) *** | 0.155 (0.000) *** | 0.221 (0.000) *** | 0.119 (0.000) *** | |
| Good|Outstanding | 3.454*** | 5.966*** | 4.935*** | 2.784*** | 3.254*** |
| 0.151 (0.000) *** | 0.254 (0.000) *** | 0.206 (0.000) *** | 0.196 (0.000) *** | 0.136 (0.000) *** | |
| formNPO | 0.657*** | 0.917*** | 0.629** | 0.312+ | 0.662*** |
| 0.139 (0.000) *** | 0.185 (0.000) *** | 0.201 (0.002) ** | 0.173 (0.071) + | 0.125 (0.000) *** | |
| formGOV | 0.810*** | 1.357*** | 0.849** | 0.319 | 0.757*** |
| 0.204 (0.000) *** | 0.308 (0.000) *** | 0.299 (0.005) ** | 0.260 (0.220) | 0.185 (0.000) *** | |
| formCIC | 0.372 | 0.102 | 0.056 | 0.203 | 0.134 |
| 0.471 (0.430) | 0.476 (0.831) | 0.596 (0.925) | 0.597 (0.734) | 0.410 (0.744) | |
| formFAM | -0.288 | -0.266 | -0.676* | -0.398 | -0.237 |
| 0.235 (0.219) | 0.239 (0.265) | 0.273 (0.013) * | 0.368 (0.280) | 0.208 (0.255) | |
| regionEast of England | 0.384* | 0.308+ | 0.721** | -0.120 | 0.207 |
| 0.177 (0.030) * | 0.177 (0.082) + | 0.224 (0.001) ** | 0.255 (0.638) | 0.158 (0.189) | |
| regionLondon | 0.037 | 0.025 | 0.416* | -0.506* | 0.014 |
| 0.166 (0.824) | 0.164 (0.879) | 0.204 (0.042) * | 0.253 (0.046) * | 0.149 (0.924) | |
| regionNorth East | 0.742** | 0.638* | 0.917** | 0.168 | 0.710** |
| 0.262 (0.005) ** | 0.293 (0.029) * | 0.350 (0.009) ** | 0.348 (0.629) | 0.235 (0.003) ** | |
| regionNorth West | 0.580** | 0.624*** | 0.949*** | -0.002 | 0.330* |
| 0.179 (0.001) ** | 0.189 (0.001) *** | 0.230 (0.000) *** | 0.253 (0.994) | 0.158 (0.037) * | |
| regionSouth East | 0.582*** | 0.768*** | 0.809*** | 0.241 | 0.381** |
| 0.166 (0.000) *** | 0.177 (0.000) *** | 0.208 (0.000) *** | 0.232 (0.300) | 0.147 (0.010) ** | |
| regionSouth West | 1.028*** | 1.211*** | 1.347*** | 0.869*** | 0.796*** |
| 0.190 (0.000) *** | 0.225 (0.000) *** | 0.255 (0.000) *** | 0.239 (0.000) *** | 0.170 (0.000) *** | |
| regionWest Midlands | -0.065 | 0.174 | 0.293 | -0.508+ | -0.241 |
| 0.171 (0.703) | 0.174 (0.317) | 0.208 (0.159) | 0.263 (0.053) + | 0.152 (0.113) | |
| regionYorkshire and The Humber | -0.293 | -0.155 | 0.236 | -0.056 | -0.335* |
| 0.181 (0.105) | 0.182 (0.394) | 0.230 (0.303) | 0.275 (0.838) | 0.163 (0.039) * | |
| inheritedTRUE | -0.135 | -0.031 | -0.379* | -0.503* | -0.229+ |
| 0.151 (0.370) | 0.167 (0.850) | 0.189 (0.044) * | 0.226 (0.026) * | 0.131 (0.081) + | |
| Num.Obs. | 4318 | 4336 | 4299 | 4291 | 4333 |
| AIC | 4983.8 | 3951.7 | 2931.9 | 2765.8 | 6047.2 |
| BIC | 5085.7 | 4053.7 | 3033.8 | 2867.6 | 6149.1 |
| Log.Lik. | -2475.909 | -1959.832 | -1449.967 | -1366.898 | -3007.576 |
| edf | 16.000 | 16.000 | 16.000 | 16.000 | 16.000 |
# derive the sub-set of home-based care facilities
socialcare_resident <- socialcare_num %>%
filter(category == "residential")
I will ran the ordered logit models but only show the results in the comparing table
# run the ordered logit model with control
model_order_overall3 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_resident, domain == "Overall"),
link = "logit")
model_order_safe3 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_resident, domain == "Safe"),
link = "logit")
model_order_effective3 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_resident, domain == "Effective"),
link = "logit")
model_order_caring3 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_resident, domain == "Caring"),
link = "logit")
model_order_well_led3 <- clm(rating ~ form + region + inherited,
data = filter(socialcare_resident, domain == "Well-led"),
link = "logit")
modelsummary(list("overall" = model_order_overall3, "safe" = model_order_safe3,
"effective" = model_order_effective3, "caring"= model_order_caring3,
"well-led" = model_order_well_led2),
statistic = "{std.error} ({p.value}) {stars}")
| overall | safe | effective | caring | well-led | |
|---|---|---|---|---|---|
| Inadequate|Req improv | -4.085*** | -3.843*** | -5.664*** | -6.319*** | -4.155*** |
| 0.121 (0.000) *** | 0.117 (0.000) *** | 0.236 (0.000) *** | 0.336 (0.000) *** | 0.175 (0.000) *** | |
| Req improv|Good | -1.353*** | -1.072*** | -1.768*** | -2.663*** | -1.318*** |
| 0.083 (0.000) *** | 0.081 (0.000) *** | 0.097 (0.000) *** | 0.124 (0.000) *** | 0.119 (0.000) *** | |
| Good|Outstanding | 3.368*** | 6.354*** | 4.524*** | 3.654*** | 3.254*** |
| 0.097 (0.000) *** | 0.220 (0.000) *** | 0.129 (0.000) *** | 0.135 (0.000) *** | 0.136 (0.000) *** | |
| formNPO | 0.418*** | 0.500*** | 0.364*** | 0.395*** | 0.662*** |
| 0.080 (0.000) *** | 0.091 (0.000) *** | 0.104 (0.000) *** | 0.110 (0.000) *** | 0.125 (0.000) *** | |
| formGOV | 0.161 | 0.324+ | 0.135 | 0.497* | 0.757*** |
| 0.175 (0.360) | 0.196 (0.098) + | 0.227 (0.553) | 0.249 (0.046) * | 0.185 (0.000) *** | |
| formCIC | 0.021 | 1.189 | -0.900 | 0.169 | 0.134 |
| 0.648 (0.975) | 0.955 (0.213) | 0.648 (0.165) | 1.036 (0.870) | 0.410 (0.744) | |
| formFAM | -0.211* | -0.146 | -0.264* | -0.014 | -0.237 |
| 0.092 (0.022) * | 0.096 (0.129) | 0.113 (0.020) * | 0.141 (0.923) | 0.208 (0.255) | |
| regionEast of England | 0.172 | 0.242* | 0.208 | 0.299+ | 0.207 |
| 0.115 (0.134) | 0.114 (0.034) * | 0.136 (0.125) | 0.171 (0.081) + | 0.158 (0.189) | |
| regionLondon | 0.177 | 0.456*** | 0.573*** | 0.295+ | 0.014 |
| 0.120 (0.140) | 0.125 (0.000) *** | 0.152 (0.000) *** | 0.179 (0.100) + | 0.149 (0.924) | |
| regionNorth East | 0.752*** | 0.870*** | 0.919*** | 1.102*** | 0.710** |
| 0.156 (0.000) *** | 0.173 (0.000) *** | 0.200 (0.000) *** | 0.210 (0.000) *** | 0.235 (0.003) ** | |
| regionNorth West | 0.170 | 0.336** | 0.460*** | 0.373* | 0.330* |
| 0.110 (0.124) | 0.111 (0.003) ** | 0.136 (0.001) *** | 0.165 (0.024) * | 0.158 (0.037) * | |
| regionSouth East | 0.228* | 0.539*** | 0.287* | 0.597*** | 0.381** |
| 0.101 (0.024) * | 0.104 (0.000) *** | 0.120 (0.017) * | 0.151 (0.000) *** | 0.147 (0.010) ** | |
| regionSouth West | 0.772*** | 0.749*** | 0.801*** | 1.075*** | 0.796*** |
| 0.114 (0.000) *** | 0.117 (0.000) *** | 0.139 (0.000) *** | 0.161 (0.000) *** | 0.170 (0.000) *** | |
| regionWest Midlands | -0.183+ | 0.080 | 0.136 | -0.066 | -0.241 |
| 0.110 (0.095) + | 0.110 (0.467) | 0.132 (0.305) | 0.164 (0.689) | 0.152 (0.113) | |
| regionYorkshire and The Humber | -0.057 | -0.038 | 0.287* | 0.640*** | -0.335* |
| 0.114 (0.620) | 0.112 (0.731) | 0.140 (0.041) * | 0.174 (0.000) *** | 0.163 (0.039) * | |
| inheritedTRUE | -0.110 | -0.211+ | -0.257+ | -0.363* | -0.229+ |
| 0.116 (0.344) | 0.118 (0.075) + | 0.139 (0.065) + | 0.168 (0.030) * | 0.131 (0.081) + | |
| Num.Obs. | 8594 | 8601 | 8603 | 8607 | 4333 |
| AIC | 11587.4 | 9463.4 | 7408.6 | 6172.4 | 6047.2 |
| BIC | 11700.3 | 9576.3 | 7521.5 | 6285.3 | 6149.1 |
| Log.Lik. | -5777.691 | -4715.685 | -3688.285 | -3070.180 | -3007.576 |
| edf | 16.000 | 16.000 | 16.000 | 16.000 | 16.000 |