Hi,

I have got a dataset with
the variables Y,X1,X2,X3.
Some of these variables contain NAs. Therefore
incomplete datasets aren't recognized when
I am doing a regression like:

model <- lm(Y~X1+X2+X3)

so the resulting vector of resid(model) is
obviousely shorter then the original variables.

How can I combine the residuals-vector with
the original dataset (Y,Xi,...). I recognize
that the residuals give also a kind of an index
like from the row names (2,5,7,8,9,12)...

Is it possible to use in such a case the
data.frame command? Or what is the best
way to attach the resulting residuals back to
the original dataframe with incomplete datasets?

thanks

/Johannes
--

______________________________________________
R-help@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.

Reply via email to