[R] Tabulating Baseline Characteristics on specific observations

justin jarvis littledude.jarvis at gmail.com
Tue Sep 20 02:49:24 CEST 2011

I have a data set with many missing observations.  When I run a
regression, R of course discards the observations (the whole row) that
have "NA".  I want to tabulate some baseline characteristics (column
means) but only for the observations that R used for the regression.
I tried to recreate this data frame by using na.omit on the original
data frame, but this will not work as this will discard an observation
with an "NA" in any column, and not just in the covariates.

In summary, I only want to remove observations that have an "NA" in
the covariate columns.  Something like Stata's e(sample), as far as I
can tell.

Justin Jarvis
PhD student, University of California, Irvine

More information about the R-help mailing list