1
$\begingroup$

UPDATE - One of the authors of the nlme package wrote the following: Internally the nlme package uses compiled code such as LAPACK which does not have provision for missing values. The results when using na.pass will be unpredictable and invalid.

I am calculating mixed models (linear growth models) with the nlme package in R for a sample with N = 45 and 10 time points measuring change in health over time. Health (outcome) is measured at all time points, but the predictors are only measured at one time point. I have some missing values in the predictors (10 people have missing values in the predictors) so I decided to use na.action = na.pass to include all persons. However, the results vary immensely when I conduct small changes that should not change a lot. My basic function is:

lgm1 <- lme(health ~ predictor*time, data=data1, random= ~time | id, na.action = na.pass,
            correlation = corAR1())

With this function, the predictor and the predictor * time interaction are significant. However, when I change the order of the predictors (now: time * predictor), the result is completely different, there is not even a hint of significance in the predictor, only the interaction stays the same. When I replace na.pass with na.omit, the result is completely different as well (n.s. for all). At least, with na.omit, the order of the predictors doesn't change the result anymore.

Does anybody know why this happens and how I can deal with it in a good way? What does na.pass do? I am not sure how to deal with this finding as the differences are huge and I don't want to draw the wrong conclusions from the data.

$\endgroup$
  • $\begingroup$ As for the order of the predictors this may help: stats.stackexchange.com/questions/14522/… Regarding the difference of na.pass and na.omit look in the R help file: ?na.pass. You probably want na.exclude? $\endgroup$ – Stefan Dec 21 '17 at 16:15
  • $\begingroup$ Thank you for this link, this is very helpful! I am however still not sure what na.pass does when using it in the lme function. R help says: "na.pass returns the object unchanged" - What does this mean for the lme function? It seems to include the cases with missings, but I don't understand how. The way it deals with the missings seems to have a huge impact on the result. $\endgroup$ – ElI Dec 22 '17 at 9:49
  • 1
    $\begingroup$ UPDATE - One of the authors of the nlme package wrote the following: Internally the nlme package uses compiled code such as LAPACK which does not have provision for missing values. The results when using na.pass will be unpredictable and invalid. $\endgroup$ – ElI Jan 15 '18 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.