Debs Majumdar
2011-Jul-06 19:22 UTC
[R] Dealing with missing values in a linear mixed model
Hello, ?? I am trying to run a linear mixed model using model.a <- lme(Psstotals ~ Visit, data=caf, random= ~ Visit|Id) My dataset looks lie the following: ? ? Id?? Visit? Agecorrected Psstotals 1 106???? 0?????????? 19??????????? 8???????? 2 106???? 1?????????? 19??????????? 9 ??????? 3 106???? 2?????????? 19?????????? NA?????? 4 106???? 3?????????? 19?????????? NA?????? 5 106???? 4?????????? 19?????????? NA?????? 6 106???? 5?????????? 19?????????? 11 ????? ........................ ............. I have 14 visits for each ID and I do have some missing values for each Id. I get the following error when I run the above model: Error in na.fail.default(list(Visit = c(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L,? : ? missing values in object I do not want to do a listwise deletion as I would like to run model with all available data. So, I tried the following model.a <- lme(Psstotals ~ Visit, data=caf, random= ~Visit |Id, na.action=na.exclude) Is this the right syntax? Thanks, Debs
Hi, within lme(), I think it is only possible to do na.action = na.omit. The default action (= na.fail) causes lme() to print an error message and terminate if there are any incomplete observations Best, Christine ----- -- Christine Adrion, Dipl.-Stat.,MPH Ludwig-Maximilians-Universit?t M?nchen IBE - Institut f?r Medizinische Informations- verarbeitung, Biometrie und Epidemiologie Marchioninistr. 15 D- 81377 M?nchen Germany Tel: +49 89 7095 7486 Fax: +49 89 7095 7491 eMail: adrion at ibe.med.uni-muenchen.de web: http://www.ibe.med.uni-muenchen.de -- View this message in context: http://r.789695.n4.nabble.com/Dealing-with-missing-values-in-a-linear-mixed-model-tp3649747p3649941.html Sent from the R help mailing list archive at Nabble.com.