[R] Linear multivariate regression with Robust error

Mike Marchywka marchywka at hotmail.com
Fri Jun 10 12:07:25 CEST 2011













----------------------------------------
> Date: Fri, 10 Jun 2011 09:53:20 +0530
> From: bkkochar at gmail.com
> To: r-help at r-project.org
> Subject: [R] Linear multivariate regression with Robust error
>
> Dear all,
>
> i am doing linear regression with robust error to know the effect of
> a (x) variable on (y)other if i execute the command i found positive
> trend.
> But if i check the effect of number of (x.x1,x2,x3)variables
> on same (y)variable then the positive effect shwon by x variable turns
> to negative. so plz help me in this situation.

take y as goodness and x and x1 have something to do with
a product. The first analysis is from company A, second is from company
B and the underlying relationship is given with some noise LOL, 
( I'm still on first cup of cofee, this was fist example to
come to mind as these question keep coming up here everyday )

> x=1:100
> x1=x*x
> y<-x-x1+runif(100)
> lm(y~x)

Call:
lm(formula = y ~ x)

Coefficients:
(Intercept)            x
       1718         -100

> lm(y~x+x1)

Call:
lm(formula = y ~ x + x1)

Coefficients:
(Intercept)            x           x1
     0.5253       1.0024      -1.0000

>











>
> Barjesh Kochar
> Research scholar
>
> ______________________________________________
> 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.
 		 	   		  


More information about the R-help mailing list