[R] Regression with Missing values. na.action?

David Barron mothsailor at googlemail.com
Thu Jul 26 11:57:58 CEST 2007


na.exclude should give the same results as na.omit, which is the
default na.action.  Is the number of complete cases the same in these
two regressions?

On 26/07/07, Vaibhav Gathibandhe <gathibandhe.vaibhav at gmail.com> wrote:
> Hi all,
>
> Can you please tell me what is the problem here.
>
> My regression eq is  y = B0 + B1X1 +B2X2 +e
> And i am interested in coefficient B1
>
> I am doing regression with two cases:
>
> 1) reg<-lm(y ~ X1 + X2, sam) where sam is the data
>
> 2) reg<-lm(y ~ X1 + X2, sam, na.action= na.exclude) . I have missing values
> in X1
>
>
> but the values of coefficient is not consistent in two cases.
>
> Actually B1 in case one sould be smaller than B1 in case 2. But sometimes it
> comes greater.
>
> I can't figure it out. Is there some problem with *na.action ? *My sample
> size is 100
>
>
> *Regards,*
> *Vaibhav*
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>


-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP



More information about the R-help mailing list