Combining two secondary datasets, we are interested in finding out the effect of political outcome variables (e.g. mayor's party and percentage of vote) at a low administrative level (e.g. township) on the quality of supply of public goods (e.g. hours of electricity, etc.) at a higher level (e.g. county) in a developing country. There are also control variables such as income at the higher level, and "distance to state capital" or "area to be serviced" at the lower level.
The linear model (written in R code) would be something like:
lm(hours_electricity ~ as.factor(party_t) + majority_t + income_c + area_t, ...)
with _t denoting township (n = 3141) and _c denoting county (n = 434) arranged in a tidy dataset. The response variable does have a somewhat odd distribution:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.00 18.00 24.00 20.73 24.00 24.00
Regardless of common transformations, it yields, as I feared, horrible-looking residuals plots, which don't help me in finding a solution.
This paper describes a similar problem in psychology research with group-level responses relying on individual-level predictors. However, in our study, there is no latent variable complementing the individual-level variables (i.e. we know the exact scores for all townships as opposed to a sample of them). I understand they suggest a Structural Equation Model would work if scores are known for individuals but they elaborate on their more complex problem with latent variables.
Is a Structural Equation Model what is required here? How should I go about applying that?
Otherwise, what is causing the problems with the residuals and how could it be solved?
Apologies if I'm missing something obvious, I'm out of my depth here. Accordingly, also sorry if I haven't provided enough information to answer properly. Happy to clarify, I'm just mindful of post length! Thank you very much for any pointers!
supply_qual_t
and what are it's possible values? Do you have repeated measurements? $\endgroup$