On Mon, 20 Feb 2012, Hans Ekbrand wrote:

> When I was looking at official statistics for level of education, for
> native vs migrant populations in different areas of a city I'm
> currently studying, it struck me that I could use mixed models to back
> up an initial observation I did. After conducting the analysis, I was
> unsure whether or not this was a proper thing to do. Perhaps you can
> give some judgement on this?

> 'data.frame': 362319 obs. of  3 variables:
> $ area     : Factor w/ 21 levels "Gunnared","L?rjedalen",..: 1 1 1 1 1 1 1 1 1 1 ...
> $ native   : Factor w/ 2 levels "yes","no": 1 1 1 1 1 1 1 1 1 1 ...
> $ education: Ord.factor w/ 6 levels "Folkskola"<"Grundskola"<..: 1 1 1 1 1 1 1 1 1 1 ...
> 
> (I translated the labels of the education factor into a rough estimate
> in years in the tables above, since the labels are only meaningful for
> speakers of the swedish language)

> I fitted the following model on the data:
> 
> library(lme4)
> my.fit <- lmer(education ~ 1 + (native | area), data = test.df)

> While the causal relations in this case thus are unclear, or mixed, is
> it still reasonable to use the mixed model as I did to get proper
> confidence intervals, for the mere correlation/association between
> area, nativeness and educational level?

My first thought is that there are other features, such as how you are treating level of education in this
linear model, that have more effect on "proper confidence intervals".  Which is to say, it may be a useful
way to summarize the data and rank areas.  If you wanted to test specific hypotheses, then a fixed effects
log-linear model is a flexible method, which is agnostic about direction of causation:

x <- with(test.df, as.data.frame(table(area, native, education))
x2 <- subset(x, area %in% c("Gunnared","Lärjedalen","Styrs?))
anova(glm(Freq ~ area*native*education, data=x2, family=poisson()), test="Chisq")
                       Df Deviance Resid. Df Resid. Dev  Pr(>Chi)
...
area:native:education 10    150.7         0        0.0 < 2.2e-16 ***

You can then place ordinal constraints on odds ratios for level of education, test whether only highly
educated individuals migrate into some areas etc.

Truly just 2c, David Duffy.

PS this is third time I have tried to mail this to the list.  No-one else is having nondelivery problems?

-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD@qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v


	[[alternative HTML version deleted]]


