I have a dataset with plenty of variables and lots of missing data. As far as I understand, R automatically removes subjects with missing values. I'm trying to fit a mixed effects model, adding covariate by covariate. I suspect that my sample gets smaller and smaller each time I add a covariate, because more and more lines get deleted. Is there a way of displaying how many subjects are "left" in each analysis? Thanks E [[alternative HTML version deleted]]
R. Michael Weylandt
2012-Apr-24 14:14 UTC
[R] Number of lines in analysis after removed missings
Take a look at nobs() Michael On Tue, Apr 24, 2012 at 10:05 AM, Eiko Fried <torvon at gmail.com> wrote:> I have a dataset with plenty of variables and lots of missing data. As far > as I understand, R automatically removes subjects with missing values. > > I'm trying to fit a mixed effects model, adding covariate by covariate. I > suspect that my sample gets smaller and smaller each time I add a > covariate, because more and more lines get deleted. > > Is there a way of displaying hTow many subjects are "left" in each analysis? > > Thanks > E > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.