[R-sig-ME] random slope models with several terms with the same grouping variable

Hans Ekbrand hans.ekbrand at gmail.com
Thu May 30 15:26:13 CEST 2013


On Thu, May 30, 2013 at 01:31:53AM +0200, Hans Ekbrand wrote:
> Dear list,
> 
> I am trying to model the probability of poverty at the individual
> level using predictors at the country level. The dependent variable is
> measuring poverty is cdepidxs, and individuals are nested in
> household/cluster/country. ("cluster" is a small area consisting of a
> few hundred households).
> 
> I want to test the effect of three predictors variables at the country
> level: loggdp, wbgi_gee, and killed.per.million. In a random intercept
> version with these variables as fixed terms they all come out as
> significant:
> 
> ## If you want to load the data set example.data, use 
> (load(url("http://dl.dropboxusercontent.com/u/99038959/data/example.data.RData")))

...

> Should I specifically specify that I don't want a random intercept for each of the variables loggdp, wgbi_gee and killed.per.million? Like this?
> 
> lmer(cdepidxs ~ (1|country) + (1|cluster) + (1|household) + (0+loggdp|rural) + (0+wbgi_gee|rural) + (0+killed.per.million|rural) + (1|rural), data = example.data)

After thinking about it one more time, I came to the conclusion that "rural" should be a fixed term, and then the problem just goes away:

lmer(cdepidxs ~ (1|country) + (1|cluster) + (1|household) + loggdp*rural + wbgi_gee*rural + killed.per.million*rural, data = example.data)

work just fine.



More information about the R-sig-mixed-models mailing list