user3288202
user3288202

Reputation: 313

Cannot make R exclude NA cells

I am doing lmer and would like R to ignore NA cells. I have put this command:

lmer8 <- lmer(height ~ (1|item) + (1+|speaker) + color*sex, data=data4.frame,REML=FALSE,na.action=na.exclude)

However, in the summary of lmer, it still gives me the same number of rows (in the Number of obs) as the number of rows in excel original file, so it seems like the NA rows are not excluded in the formula. Do you have recommendations about this?

Upvotes: 0

Views: 242

Answers (2)

user3288202
user3288202

Reputation: 313

I have found answer to this question! It is because I specified 'no answer' as 'na' instead of 'NA' in .txt file. Oh, poor me. Sorry to bother you asking this stupid question. Now that formula with na.omit works fine for me.

Upvotes: 1

Gyan Veda
Gyan Veda

Reputation: 6599

Have you tried na.omit instead of na.exclude? For some functions, the two are not interchangeable (for more information, see here).

Upvotes: 0

Related Questions