[R-lang] Re: What happens if I include a continuous variable?

Zhenguang Cai s0782345@sms.ed.ac.uk
Thu Sep 16 04:35:36 PDT 2010


I had the same problem before. What I did is, following Florian's 
advice, test whether one of the predictors can be subsumed by the other. 
For instance, in your case, you can compare models to see whether 
frequency still had an effect when length is considered:

fit.length <- lmer(lexdectime ~ length + (1|participant) + (1|item), 
data = testdata)

fit.length-frequency <- lmer(lexdectime ~ length + frequency + 
(1|participant) + (1|item), data = testdata)

anova (fit.length, fit.length-frequency)

You can then do the reverse - testing whether frequency had an effect 
over length.

fit.frequency <- lmer(lexdectime ~ frequency + (1|participant) + 
(1|item), data = testdata)

fit.length-frequency <- lmer(lexdectime ~ length + frequency + 
(1|participant) + (1|item), data = testdata)

anova (fit.frequency, fit.length-frequency)



Garry


Roger van-Gompel wrote:
> I am wondering what happens if I include a continuous variable in my LME
> model.
> 
> Let’s say that I am interested in the effect of frequency on lexical
> decision times. I analyse this using the following LME model (the
> variable frequency has two levels (high/low) and is centered):
> 
> testdata.lmer <- lmer(lexdectime ~ frequency + (1|participant) +
> (1|item), data = testdata)
> 
> However, let’s say I failed to control for word length, and length
> and frequency tend to be highly correlated. Can I then include length as
> a continuous variable (after centering) in order to deconfound frequency
> from length?
> 
> testdata.lmer <- lmer(lexdectime ~ frequency*length + (1|participant) +
> (1|item), data = testdata)
> 
> In other words, if I still get an effect of frequency in the second
> model, does this mean that this effect is not due to/not confounded with
> length?
> 
> Roger van Gompel
> 
> ************************************************************
> Please consider the environment.  Do you really need to print this
> email?
> 
> 
> 
> The University of Dundee is a registered Scottish charity, No: SC015096
> 
> 

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the ling-r-lang-L mailing list