Dear listmembers
I have a rather large dataset which needs one random effect to be analysed properly (group). I also have many explanatory variables, each with a few NAs at different places.
I can easily enough fit a model with 2 fixed effects, but as the number of fixed effects increase so does tha NAs as they are not in the same rows. I am no statistician, and this may be a naive question, but is there a way to fit each fixed efefct with its full data?
My first ide was to use lme, where na.pass works, but I found this comment by Bates;
"I don't think you want to use na.pass here. The underlying C code for
fitting lme or lmer models doesn't take kindly to finding NA's in the
data."
I couldnt make na.pass work in any other package dealing with mixed models.
there are a few NAs in the data scattered throughout, eliminating the data severly (although each single variable only have 0-10%NA)
This may illustrate what my problem is;
x<-c(1:10)
y<-c(1:10)
pa<-c(NA,2:10)
pb<-c(1,NA,3:10)
pc<-c(1:2,NA,4:10)
pd<-c(1:3,NA,5:10)
pe<-c(1:4,NA,6:10)
pf<-c(1:5,NA,7:10)
group<-factor(rep(c("A","B"), each=5))
Ignore that the data is not enough to analyse and only has two levels of the random effect, that is not the important bit. I want my model (x~y+pa+pb+pc+pd+pe+pf+(1|group))
to use 10 values on y and 9 values on the p variables. not 4 values on all.
Is that even possible?
Regards Henrik Thurfjell
NAs in fixed effects
2 messages · Henrik Thurfjell, David Duffy
On Wed, 5 Jan 2011, Henrik Thurfjell wrote:
I have a rather large dataset which needs one random effect to be analysed properly (group). I also have many explanatory variables, each with a few NAs at different places. I can easily enough fit a model with 2 fixed effects, but as the number of fixed effects increase so does tha NAs as they are not in the same rows. I am no statistician, and this may be a naive question, but is there a way to fit each fixed effect with its full data?
One way out is to impute the missing data, recalling you would have had the same problem if you wanted to just fit a fixed effects model.
| David Duffy (MBBS PhD) ,-_|\ | email: davidD at 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