This is the data analysis RMarkdown file for the QCQ data after ISIRC 2022.
Mainly changes: incorporating the contol of before and after COVID
Please read the subtitles and notes added as normal text in this document. Blocks with darker backgrounds are code chunks, mostly with their outputs. I tried to add #comments within the chunck just before the code line to explain the purpose of the code line. Meanwhile I explain the purpose of the section in the texts, so that is where to find information to give you fuller pictures.
# environment setup to run ordered logit properly
options(contrasts = rep("contr.treatment", 2))
This chunk loads all the packages to use
#packages for ordered logit
library(ordinal) # package for ordinal logit regression
library(brant) # brant test for the parallel assumption for ordered logit
library(MASS) # models that work with the brant test
library(tidyverse) # package for data cleaning and plotting
library(readxl) # package for reading excel file
library(broom) # extracting model summary as data frame
library(modelsummary) # deriving model tables
library(scales) # label percent
library(lubridate) # working with dates
First, import the sampled and coded data set
#import the raw data file
socialcare_raw <- read_csv("data/sample_new_cleaned.csv")
Assign orders to the ordinal level variables and name the organizational form in a reader-friendly way.
#select relevant columns, rename and relabel
socialcare <- socialcare_raw %>%
# 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 ~ "IND",
TRUE ~ NA_character_),
inherited = ifelse(inherited == "Y", TRUE, FALSE),
rating = recode(rating,
"Insufficient evidence to rate" = "NA",
"Requires improvement" = "Req improv"),
publication_date = dmy(publication_date)) %>%
# set the order of the values in the factors
mutate(form = ordered(form, levels = c("FPO", "NPO", "GOV", "CIC", "IND")),
# 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"))) %>%
# creating a new dummy variable for facility category
mutate(category = case_when(primary_cat == "Community based adult social care services" ~ "community",
primary_cat == "Residential social care" ~ "residential",
TRUE ~ as.character(NA)),
# deriving year column and dummy variable for before_covid
year = year(publication_date),
before_covid = ifelse(year < 2020, TRUE, FALSE))
# show first several rows of the data set derived
head(socialcare)
## # A tibble: 6 × 37
## ...1 locati…¹ Locat…² Locat…³ Care …⁴ prima…⁵ Locat…⁶ Locat…⁷ Locat…⁸ Locat…⁹
## <dbl> <fct> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 1 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## 2 2 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## 3 3 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## 4 4 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## 5 5 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## 6 6 1-10000… VNH4P 69 Ten… N Commun… 69 Ten… Warmsw… Doncas… DN4 9PE
## # … with 27 more variables: `Location Local Authority` <chr>, region <chr>,
## # `Location NHS Region` <chr>, `Location ONSPD CCG Code` <chr>,
## # `Location ONSPD CCG` <chr>, `Location Commissioning CCG Code` <lgl>,
## # `Location Commissioning CCG Name` <lgl>,
## # `Service / Population Group` <chr>, domain <chr>, rating <ord>,
## # publication_date <date>, `Report Type` <chr>, inherited <lgl>, URL <chr>,
## # `Provider ID` <chr>, location_type <chr>, form_num <dbl>, …
# 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))
socialcare_num %>%
group_by(year, form) %>%
drop_na(rating_num) %>%
summarise(count = n(),
perform = mean(rating_num))
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## # A tibble: 34 × 4
## # Groups: year [6]
## year form count perform
## <dbl> <ord> <int> <dbl>
## 1 2016 FPO 168 2.96
## 2 2016 NPO 36 2.89
## 3 2016 GOV 12 3
## 4 2016 CIC 6 2.83
## 5 2016 IND 30 3
## 6 2017 FPO 4251 3.02
## 7 2017 NPO 1171 3.04
## 8 2017 GOV 210 3.05
## 9 2017 CIC 30 3.07
## 10 2017 IND 376 3.00
## # … with 24 more rows
socialcare_new <- socialcare_num %>%
filter(year > 2016)
table1 <- datasummary((category + inherited + before_covid + region) ~ form,
data = socialcare_num, fmt = 0)
## Warning in !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output
## %in% : 'length(x) = 3 > 1' in coercion to 'logical(1)'
table1
| FPO | NPO | GOV | CIC | IND | ||
|---|---|---|---|---|---|---|
| category | community | 22454 | 3365 | 1194 | 390 | 798 |
| residential | 41721 | 9022 | 1231 | 114 | 4355 | |
| inherited | FALSE | 60318 | 11772 | 2185 | 492 | 5069 |
| TRUE | 3869 | 627 | 246 | 12 | 84 | |
| before_covid | FALSE | 18976 | 2588 | 510 | 115 | 1197 |
| TRUE | 45211 | 9811 | 1921 | 389 | 3956 | |
| region | East Midlands | 6510 | 896 | 306 | 24 | 396 |
| East of England | 7451 | 1128 | 181 | 108 | 509 | |
| London | 7055 | 1180 | 246 | 60 | 600 | |
| North East | 2646 | 654 | 186 | 18 | 144 | |
| North West | 7911 | 1448 | 348 | 132 | 774 | |
| South East | 11835 | 2400 | 408 | 36 | 930 | |
| South West | 7304 | 2070 | 180 | 36 | 858 | |
| West Midlands | 7547 | 1303 | 258 | 42 | 498 | |
| Yorkshire and The Humber | 5928 | 1320 | 318 | 48 | 444 |
The OLS models and the ordered logit models can be written as follows
\(rating_{numerical} = \beta_0 + \beta_1form + \beta_2category+ \beta_3region + \beta_4inherited + u\)
\(log-odds(rating_{ordinal} \leq j) = \beta_{j0} + \beta_1form + \beta_2category+ \beta_3region + \beta_4inherited + u\)
In this section, we first run the OLS models. In the OLS models, we kind of “cheat” R by treating the four rating levels with orders as if they are numbers 1-4. There are the flowing reasons that we report the results from OLS models, even though the more suitable methods should be ordered logit models, about which we will discuss in a while.
# run the model loops with nest() method
models_ols <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ols_models = map(data,
~lm(rating_num ~ form +
category + region + inherited ,
data = .x))) %>%
mutate(results = map(ols_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ols_models, name = domain)
# run the model loops with nest() method
# add before_covid as control
# add also interaction term
table_ols <- modelsummary(models_ols, statistic = "({p.value}) {stars}")
table_ols
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| (Intercept) | 2.789*** | 2.892*** | 3.016*** | 2.961*** | 2.814*** | 2.873*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.082*** | 0.040*** | 0.027*** | 0.064*** | 0.100*** | 0.082*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.097*** | 0.039* | 0.029+ | 0.053** | 0.097*** | 0.081*** |
| (0.000) *** | (0.023) * | (0.061) + | (0.006) ** | (0.000) *** | (0.001) *** | |
| formCIC | 0.100* | 0.019 | 0.079* | 0.039 | 0.109+ | 0.104* |
| (0.030) * | (0.604) | (0.014) * | (0.339) | (0.055) + | (0.043) * | |
| formIND | −0.019 | −0.033** | −0.004 | −0.007 | −0.040* | −0.036* |
| (0.214) | (0.007) ** | (0.712) | (0.621) | (0.033) * | (0.035) * | |
| categoryresidential | −0.064*** | −0.037*** | −0.047*** | −0.030*** | −0.067*** | −0.070*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.047** | 0.041** | 0.015 | 0.035* | 0.030 | 0.043* |
| (0.004) ** | (0.002) ** | (0.189) | (0.016) * | (0.132) | (0.017) * | |
| regionLondon | 0.048** | 0.054*** | 0.003 | −0.003 | 0.025 | 0.019 |
| (0.004) ** | (0.000) *** | (0.807) | (0.820) | (0.206) | (0.308) | |
| regionNorth East | 0.123*** | 0.095*** | 0.069*** | 0.082*** | 0.155*** | 0.133*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.067*** | 0.064*** | 0.022* | 0.040** | 0.052** | 0.052** |
| (0.000) *** | (0.000) *** | (0.050) * | (0.004) ** | (0.007) ** | (0.003) ** | |
| regionSouth East | 0.098*** | 0.049*** | 0.040*** | 0.051*** | 0.057** | 0.062*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.002) ** | (0.000) *** | |
| regionSouth West | 0.124*** | 0.094*** | 0.085*** | 0.091*** | 0.144*** | 0.142*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.019 | 0.020 | −0.015 | 0.000 | −0.075*** | −0.030+ |
| (0.233) | (0.114) | (0.173) | (0.982) | (0.000) *** | (0.092) + | |
| regionYorkshire and The Humber | −0.012 | 0.031* | 0.036** | 0.008 | −0.033 | −0.025 |
| (0.467) | (0.020) * | (0.002) ** | (0.576) | (0.115) | (0.186) | |
| inheritedTRUE | −0.018 | −0.032** | −0.032** | −0.032* | −0.018 | −0.020 |
| (0.248) | (0.008) ** | (0.003) ** | (0.020) * | (0.346) | (0.260) | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| R2 | 0.023 | 0.013 | 0.017 | 0.013 | 0.025 | 0.023 |
| R2 Adj. | 0.021 | 0.012 | 0.016 | 0.012 | 0.024 | 0.022 |
| AIC | 14402.5 | 8181.6 | 5099.3 | 11037.1 | 19530.8 | 16998.2 |
| BIC | 14522.0 | 8301.1 | 5218.8 | 11156.6 | 19650.3 | 17117.7 |
| Log.Lik. | −7185.242 | −4074.798 | −2533.650 | −5502.563 | −9749.405 | −8483.091 |
| RMSE | 0.42 | 0.33 | 0.29 | 0.37 | 0.51 | 0.47 |
# run the model loops with nest() method
# add before_covid as control
models_ols_covid <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ols_models = map(data,
~lm(rating_num ~ form + before_covid +
category + region + inherited,
data = .x))) %>%
mutate(results = map(ols_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ols_models, name = domain)
table_ols_covid <- modelsummary(models_ols_covid, statistic = "({p.value}) {stars}")
table_ols_covid
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| (Intercept) | 2.609*** | 2.790*** | 2.953*** | 2.879*** | 2.594*** | 2.650*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.056*** | 0.032*** | 0.023** | 0.058*** | 0.069*** | 0.050*** |
| (0.000) *** | (0.000) *** | (0.002) ** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.069** | 0.032+ | 0.025 | 0.048* | 0.065* | 0.050* |
| (0.001) ** | (0.058) + | (0.102) | (0.013) * | (0.011) * | (0.028) * | |
| formCIC | 0.084+ | 0.016 | 0.079* | 0.037 | 0.085 | 0.080+ |
| (0.058) + | (0.661) | (0.014) * | (0.357) | (0.118) | (0.100) + | |
| formIND | −0.038* | −0.039** | −0.008 | −0.012 | −0.062*** | −0.059*** |
| (0.011) * | (0.001) ** | (0.454) | (0.387) | (0.001) *** | (0.000) *** | |
| before_covidTRUE | 0.271*** | 0.135*** | 0.083*** | 0.107*** | 0.329*** | 0.332*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| categoryresidential | −0.060*** | −0.037*** | −0.048*** | −0.031*** | −0.061*** | −0.063*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.038* | 0.040** | 0.014 | 0.034* | 0.019 | 0.032+ |
| (0.016) * | (0.002) ** | (0.212) | (0.016) * | (0.325) | (0.058) + | |
| regionLondon | 0.045** | 0.055*** | 0.002 | −0.001 | 0.024 | 0.018 |
| (0.004) ** | (0.000) *** | (0.834) | (0.919) | (0.209) | (0.303) | |
| regionNorth East | 0.133*** | 0.104*** | 0.074*** | 0.089*** | 0.169*** | 0.150*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.062*** | 0.063*** | 0.020+ | 0.039** | 0.047* | 0.046** |
| (0.000) *** | (0.000) *** | (0.068) + | (0.006) ** | (0.012) * | (0.006) ** | |
| regionSouth East | 0.085*** | 0.047*** | 0.038*** | 0.050*** | 0.042* | 0.047** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.014) * | (0.002) ** | |
| regionSouth West | 0.110*** | 0.092*** | 0.082*** | 0.088*** | 0.128*** | 0.126*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.007 | 0.018 | −0.017 | −0.002 | −0.090*** | −0.045** |
| (0.662) | (0.142) | (0.125) | (0.892) | (0.000) *** | (0.008) ** | |
| regionYorkshire and The Humber | −0.016 | 0.031* | 0.036** | 0.008 | −0.036+ | −0.029 |
| (0.334) | (0.018) * | (0.003) ** | (0.596) | (0.066) + | (0.105) | |
| inheritedTRUE | −0.045** | −0.042*** | −0.037*** | −0.038** | −0.051** | −0.053** |
| (0.003) ** | (0.001) *** | (0.001) *** | (0.005) ** | (0.006) ** | (0.001) ** | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| R2 | 0.104 | 0.041 | 0.030 | 0.027 | 0.107 | 0.124 |
| R2 Adj. | 0.103 | 0.039 | 0.029 | 0.026 | 0.106 | 0.123 |
| AIC | 13271.6 | 7815.4 | 4933.2 | 10857.2 | 18399.2 | 15587.3 |
| BIC | 13398.6 | 7942.4 | 5060.2 | 10984.2 | 18526.2 | 15714.3 |
| Log.Lik. | −6618.794 | −3890.704 | −2449.623 | −5411.619 | −9182.592 | −7776.674 |
| RMSE | 0.40 | 0.33 | 0.29 | 0.37 | 0.49 | 0.44 |
# run the model loops with nest() method
# add before_covid as control
# and interaction term
models_ols_inter <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ols_models = map(data,
~lm(rating_num ~ form * before_covid +
category + region + inherited,
data = .x))) %>%
mutate(results = map(ols_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ols_models, name = domain)
The gap of before vs. after covid rating (before is higher) is larger for for-profit smaller for NPO, GOV, which is consistent with the NYT articles
table_ols_inter <- modelsummary(models_ols_inter, statistic = "({p.value}) {stars}")
table_ols_inter
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| (Intercept) | 2.605*** | 2.784*** | 2.946*** | 2.871*** | 2.590*** | 2.642*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.099*** | 0.089*** | 0.064*** | 0.129*** | 0.112*** | 0.117*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.196*** | 0.134*** | 0.084* | 0.102* | 0.179** | 0.187*** |
| (0.000) *** | (0.001) *** | (0.022) * | (0.024) * | (0.001) ** | (0.000) *** | |
| formCIC | 0.228** | 0.070 | 0.274*** | 0.055 | 0.203+ | 0.243* |
| (0.010) ** | (0.363) | (0.000) *** | (0.530) | (0.066) + | (0.014) * | |
| formIND | −0.120*** | −0.101*** | −0.023 | −0.034 | −0.132*** | −0.122*** |
| (0.000) *** | (0.000) *** | (0.376) | (0.281) | (0.000) *** | (0.000) *** | |
| before_covidTRUE | 0.276*** | 0.143*** | 0.092*** | 0.119*** | 0.336*** | 0.344*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| categoryresidential | −0.059*** | −0.037*** | −0.048*** | −0.031*** | −0.061*** | −0.063*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.037* | 0.039** | 0.014 | 0.034* | 0.018 | 0.032+ |
| (0.017) * | (0.002) ** | (0.230) | (0.017) * | (0.342) | (0.064) + | |
| regionLondon | 0.045** | 0.055*** | 0.002 | −0.002 | 0.024 | 0.018 |
| (0.004) ** | (0.000) *** | (0.843) | (0.893) | (0.207) | (0.306) | |
| regionNorth East | 0.132*** | 0.103*** | 0.074*** | 0.089*** | 0.168*** | 0.149*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.062*** | 0.063*** | 0.021+ | 0.039** | 0.047* | 0.046** |
| (0.000) *** | (0.000) *** | (0.063) + | (0.005) ** | (0.012) * | (0.006) ** | |
| regionSouth East | 0.085*** | 0.046*** | 0.038*** | 0.049*** | 0.042* | 0.047** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.015) * | (0.002) ** | |
| regionSouth West | 0.109*** | 0.091*** | 0.082*** | 0.088*** | 0.128*** | 0.125*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.006 | 0.018 | −0.018 | −0.002 | −0.091*** | −0.046** |
| (0.691) | (0.157) | (0.119) | (0.867) | (0.000) *** | (0.007) ** | |
| regionYorkshire and The Humber | −0.016 | 0.031* | 0.035** | 0.007 | −0.037+ | −0.029 |
| (0.314) | (0.021) * | (0.003) ** | (0.623) | (0.063) + | (0.100) | |
| inheritedTRUE | −0.045** | −0.042*** | −0.037*** | −0.038** | −0.051** | −0.054** |
| (0.003) ** | (0.001) *** | (0.001) *** | (0.005) ** | (0.006) ** | (0.001) ** | |
| formNPO × before_covidTRUE | −0.055* | −0.070*** | −0.049* | −0.086*** | −0.056+ | −0.088*** |
| (0.020) * | (0.001) *** | (0.010) * | (0.000) *** | (0.050) + | (0.001) *** | |
| formGOV × before_covidTRUE | −0.160** | −0.124** | −0.071+ | −0.067 | −0.145* | −0.176** |
| (0.002) ** | (0.005) ** | (0.076) + | (0.181) | (0.019) * | (0.001) ** | |
| formCIC × before_covidTRUE | −0.192+ | −0.070 | −0.248** | −0.023 | −0.156 | −0.215+ |
| (0.059) + | (0.424) | (0.002) ** | (0.818) | (0.217) | (0.058) + | |
| formIND × before_covidTRUE | 0.109** | 0.075* | 0.017 | 0.027 | 0.093* | 0.084* |
| (0.001) ** | (0.015) * | (0.542) | (0.446) | (0.024) * | (0.023) * | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| R2 | 0.106 | 0.043 | 0.032 | 0.028 | 0.108 | 0.126 |
| R2 Adj. | 0.105 | 0.041 | 0.030 | 0.027 | 0.107 | 0.125 |
| AIC | 13249.0 | 7796.5 | 4921.7 | 10849.4 | 18390.5 | 15564.4 |
| BIC | 13405.9 | 7953.3 | 5078.5 | 11006.3 | 18547.3 | 15721.2 |
| Log.Lik. | −6603.505 | −3877.241 | −2439.846 | −5403.713 | −9174.233 | −7761.182 |
| RMSE | 0.40 | 0.33 | 0.29 | 0.37 | 0.49 | 0.44 |
I find this reference regarding understanding ordered logit models useful. https://stats.oarc.ucla.edu/r/dae/ordinal-logistic-regression/
# run the model loops with nest() method
models_order <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ordinal_models = map(data,
~clm(rating ~ form +
category + region + inherited ,
data = .x, link = "logit"))) %>%
mutate(results = map(ordinal_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ordinal_models, name = domain)
table_order <- modelsummary(models_order, statistic = "({p.value}) {stars}")
table_order
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| Inadequate|Req improv | −4.253*** | −5.932*** | −7.094*** | −6.856*** | −4.102*** | −4.449*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Req improv|Good | −1.444*** | −2.079*** | −3.431*** | −2.365*** | −1.334*** | −1.702*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Good|Outstanding | 5.856*** | 4.395*** | 3.024*** | 2.980*** | 3.178*** | 3.144*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.580*** | 0.413*** | 0.316*** | 0.507*** | 0.475*** | 0.457*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.685*** | 0.397* | 0.328+ | 0.415** | 0.445*** | 0.429** |
| (0.000) *** | (0.029) * | (0.066) + | (0.006) ** | (0.000) *** | (0.001) ** | |
| formCIC | 0.797* | 0.188 | 0.819* | 0.306 | 0.478+ | 0.586* |
| (0.040) * | (0.622) | (0.013) * | (0.340) | (0.085) + | (0.045) * | |
| formIND | −0.117 | −0.275* | −0.050 | −0.057 | −0.162* | −0.183* |
| (0.197) | (0.011) * | (0.710) | (0.592) | (0.045) * | (0.036) * | |
| categoryresidential | −0.423*** | −0.374*** | −0.574*** | −0.237*** | −0.302*** | −0.387*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.274** | 0.350** | 0.208 | 0.280* | 0.133 | 0.245* |
| (0.004) ** | (0.002) ** | (0.147) | (0.014) * | (0.134) | (0.011) * | |
| regionLondon | 0.260** | 0.482*** | 0.037 | −0.029 | 0.132 | 0.104 |
| (0.008) ** | (0.000) *** | (0.797) | (0.794) | (0.138) | (0.279) | |
| regionNorth East | 0.828*** | 0.948*** | 0.864*** | 0.645*** | 0.749*** | 0.761*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.420*** | 0.582*** | 0.286* | 0.324** | 0.257** | 0.293** |
| (0.000) *** | (0.000) *** | (0.041) * | (0.003) ** | (0.003) ** | (0.002) ** | |
| regionSouth East | 0.597*** | 0.416*** | 0.505*** | 0.404*** | 0.235** | 0.322*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.003) ** | (0.000) *** | |
| regionSouth West | 0.841*** | 0.932*** | 1.030*** | 0.721*** | 0.712*** | 0.836*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.101 | 0.168 | −0.204 | −0.002 | −0.331*** | −0.156+ |
| (0.277) | (0.131) | (0.146) | (0.985) | (0.000) *** | (0.090) + | |
| regionYorkshire and The Humber | −0.068 | 0.281* | 0.450** | 0.069 | −0.144 | −0.121 |
| (0.474) | (0.019) * | (0.002) ** | (0.554) | (0.107) | (0.208) | |
| inheritedTRUE | −0.140 | −0.288** | −0.397** | −0.251* | −0.076 | −0.108 |
| (0.146) | (0.010) ** | (0.003) ** | (0.017) * | (0.372) | (0.238) | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| AIC | 13440.5 | 10365.2 | 8969.0 | 12726.4 | 18898.5 | 16608.8 |
| BIC | 13567.5 | 10492.1 | 9096.0 | 12853.4 | 19025.5 | 16735.8 |
| RMSE | 2.12 | 2.13 | 2.21 | 2.27 | 2.26 | 2.26 |
# run the model loops with nest() method
# add before_covid as control
models_order_covid <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ordinal_models = map(data,
~clm(rating ~ form + before_covid +
category + region + inherited ,
data = .x, link = "logit"))) %>%
mutate(results = map(ordinal_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ordinal_models, name = domain)
table_order_covid <- modelsummary(models_order_covid, statistic = "({p.value}) {stars}")
table_order_covid
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| Inadequate|Req improv | −3.504*** | −5.201*** | −6.404*** | −6.279*** | −3.384*** | −3.622*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Req improv|Good | −0.583*** | −1.311*** | −2.723*** | −1.767*** | −0.494*** | −0.722*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Good|Outstanding | 7.041*** | 5.346*** | 3.890*** | 3.676*** | 4.278*** | 4.571*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.450*** | 0.350*** | 0.274** | 0.467*** | 0.357*** | 0.307*** |
| (0.000) *** | (0.000) *** | (0.002) ** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.561** | 0.337+ | 0.290 | 0.378* | 0.316* | 0.290* |
| (0.001) ** | (0.065) + | (0.107) | (0.012) * | (0.014) * | (0.036) * | |
| formCIC | 0.756+ | 0.183 | 0.802* | 0.296 | 0.408 | 0.494+ |
| (0.056) + | (0.633) | (0.015) * | (0.354) | (0.146) | (0.097) + | |
| formIND | −0.248** | −0.344** | −0.097 | −0.097 | −0.282*** | −0.339*** |
| (0.009) ** | (0.002) ** | (0.469) | (0.364) | (0.001) *** | (0.000) *** | |
| before_covidTRUE | 1.496*** | 1.132*** | 1.042*** | 0.843*** | 1.412*** | 1.776*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| categoryresidential | −0.420*** | −0.386*** | −0.587*** | −0.244*** | −0.294*** | −0.377*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.232* | 0.348** | 0.196 | 0.279* | 0.084 | 0.197* |
| (0.021) * | (0.003) ** | (0.172) | (0.014) * | (0.358) | (0.047) * | |
| regionLondon | 0.273** | 0.512*** | 0.035 | −0.011 | 0.136 | 0.115 |
| (0.007) ** | (0.000) *** | (0.808) | (0.920) | (0.136) | (0.244) | |
| regionNorth East | 0.952*** | 1.051*** | 0.915*** | 0.707*** | 0.840*** | 0.891*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.428*** | 0.592*** | 0.271+ | 0.318** | 0.252** | 0.286** |
| (0.000) *** | (0.000) *** | (0.053) + | (0.004) ** | (0.005) ** | (0.003) ** | |
| regionSouth East | 0.570*** | 0.412*** | 0.488*** | 0.402*** | 0.193* | 0.279** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.019) * | (0.002) ** | |
| regionSouth West | 0.808*** | 0.933*** | 1.007*** | 0.712*** | 0.678*** | 0.805*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.028 | 0.162 | −0.227 | −0.016 | −0.426*** | −0.256** |
| (0.770) | (0.153) | (0.107) | (0.886) | (0.000) *** | (0.008) ** | |
| regionYorkshire and The Humber | −0.092 | 0.292* | 0.443** | 0.065 | −0.176+ | −0.162 |
| (0.354) | (0.016) * | (0.003) ** | (0.582) | (0.057) + | (0.107) | |
| inheritedTRUE | −0.335*** | −0.398*** | −0.460*** | −0.306** | −0.238** | −0.322*** |
| (0.001) *** | (0.000) *** | (0.001) *** | (0.004) ** | (0.007) ** | (0.001) *** | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| AIC | 12507.3 | 10045.6 | 8808.0 | 12548.2 | 17890.6 | 15296.7 |
| BIC | 12641.8 | 10180.0 | 8942.4 | 12682.7 | 18025.1 | 15431.1 |
| RMSE | 2.10 | 2.13 | 2.21 | 2.27 | 2.25 | 2.24 |
# run the model loops with nest() method
# add before_covid as control
# and interaction term
models_order_inter <- socialcare_num %>%
group_by(domain) %>%
nest()%>%
mutate(ordinal_models = map(data,
~clm(rating ~ form * before_covid +
category + region + inherited,
data = .x, link = "logit"))) %>%
mutate(results = map(ordinal_models, ~tidy(.x, conf.int = TRUE))) %>%
pull(ordinal_models, name = domain)
table_order_inter <- modelsummary(models_order_inter, statistic = "({p.value}) {stars}")
table_order_inter
| Safe | Effective | Caring | Responsive | Well-led | Overall | |
|---|---|---|---|---|---|---|
| Inadequate|Req improv | −3.514*** | −5.171*** | −6.326*** | −6.225*** | −3.380*** | −3.602*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Req improv|Good | −0.590*** | −1.279*** | −2.642*** | −1.711*** | −0.487*** | −0.698*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| Good|Outstanding | 7.028*** | 5.372*** | 3.989*** | 3.738*** | 4.281*** | 4.588*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formNPO | 0.413*** | 0.638*** | 0.814*** | 1.035*** | 0.426*** | 0.489*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| formGOV | 0.857** | 1.045* | 1.053* | 0.778* | 0.637* | 0.748** |
| (0.003) ** | (0.013) * | (0.021) * | (0.035) * | (0.013) * | (0.005) ** | |
| formCIC | 1.017 | 0.447 | 2.702*** | 0.387 | 0.659 | 1.057+ |
| (0.102) | (0.523) | (0.000) *** | (0.574) | (0.206) | (0.082) + | |
| formIND | −0.434** | −0.460* | −0.196 | −0.223 | −0.421** | −0.433** |
| (0.003) ** | (0.016) * | (0.489) | (0.304) | (0.004) ** | (0.003) ** | |
| before_covidTRUE | 1.477*** | 1.181*** | 1.163*** | 0.925*** | 1.422*** | 1.817*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| categoryresidential | −0.418*** | −0.385*** | −0.588*** | −0.245*** | −0.293*** | −0.376*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionEast of England | 0.232* | 0.345** | 0.191 | 0.276* | 0.082 | 0.196* |
| (0.021) * | (0.003) ** | (0.182) | (0.015) * | (0.366) | (0.049) * | |
| regionLondon | 0.278** | 0.513*** | 0.033 | −0.014 | 0.138 | 0.116 |
| (0.006) ** | (0.000) *** | (0.818) | (0.903) | (0.132) | (0.243) | |
| regionNorth East | 0.950*** | 1.050*** | 0.920*** | 0.702*** | 0.837*** | 0.890*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionNorth West | 0.425*** | 0.595*** | 0.274* | 0.324** | 0.252** | 0.290** |
| (0.000) *** | (0.000) *** | (0.050) * | (0.003) ** | (0.005) ** | (0.003) ** | |
| regionSouth East | 0.571*** | 0.409*** | 0.486*** | 0.400*** | 0.193* | 0.279** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.019) * | (0.002) ** | |
| regionSouth West | 0.809*** | 0.931*** | 1.006*** | 0.711*** | 0.678*** | 0.805*** |
| (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | (0.000) *** | |
| regionWest Midlands | 0.028 | 0.158 | −0.232 | −0.018 | −0.427*** | −0.258** |
| (0.775) | (0.163) | (0.101) | (0.868) | (0.000) *** | (0.007) ** | |
| regionYorkshire and The Humber | −0.095 | 0.290* | 0.442** | 0.061 | −0.177+ | −0.163 |
| (0.339) | (0.017) * | (0.003) ** | (0.600) | (0.056) + | (0.106) | |
| inheritedTRUE | −0.333*** | −0.399*** | −0.463*** | −0.309** | −0.238** | −0.325*** |
| (0.001) *** | (0.000) *** | (0.001) *** | (0.004) ** | (0.007) ** | (0.001) *** | |
| formNPO × before_covidTRUE | 0.065 | −0.394* | −0.641** | −0.684*** | −0.099 | −0.271+ |
| (0.674) | (0.048) * | (0.008) ** | (0.000) *** | (0.457) | (0.058) + | |
| formGOV × before_covidTRUE | −0.468 | −0.928* | −0.907+ | −0.490 | −0.437 | −0.658* |
| (0.189) | (0.047) * | (0.068) + | (0.225) | (0.138) | (0.037) * | |
| formCIC × before_covidTRUE | −0.464 | −0.394 | −2.409*** | −0.121 | −0.362 | −0.792 |
| (0.564) | (0.638) | (0.001) *** | (0.877) | (0.559) | (0.262) | |
| formIND × before_covidTRUE | 0.316 | 0.166 | 0.120 | 0.159 | 0.205 | 0.148 |
| (0.101) | (0.474) | (0.708) | (0.521) | (0.245) | (0.428) | |
| Num.Obs. | 12966 | 12931 | 12927 | 12953 | 12964 | 12942 |
| AIC | 12510.2 | 10044.4 | 8796.7 | 12541.4 | 17893.9 | 15294.6 |
| BIC | 12674.5 | 10208.7 | 8961.0 | 12705.8 | 18058.3 | 15458.9 |
| RMSE | 2.10 | 2.13 | 2.21 | 2.27 | 2.25 | 2.24 |