man4ish
2008-Apr-21 07:17 UTC
[R] How can we predict the value of dependent variable using independent variable
hi , i am trying to predict the value of dependent variable using the independent variable using R . like y is dependent and x1,x2,x3 ...,xn are independent variables so how can predict the value of y using x1,x2,x3 ...,xn . y x1 x2 x3 x4 x5 x6 6 0 1 2 3 1 2 5 1 3 4 5 6 8 8 4 6 9 0 0 1 3 5 7 2 1 0 3 4 5 6 7 8 2 1 1 0 1 1 1 2 2 y (predicted) values =? -- View this message in context: http://www.nabble.com/How-can-we-predict-the-value-of-dependent-variable--using-independent-variable-tp16804086p16804086.html Sent from the R help mailing list archive at Nabble.com.
Eik Vettorazzi
2008-Apr-21 09:41 UTC
[R] How can we predict the value of dependent variable using independent variable
Generally lm and predict.lm will solve this kind of problems, see ?lm ?predict.lm But with your given data there is nothing to predict, since you have 6 independent variables and 6 observations. So you have a complete System of linear equations, which you can solve, see ?solve. hth. man4ish schrieb:> hi , > i am trying to predict the value of dependent variable using the independent > variable using R . > like y is dependent and x1,x2,x3 ...,xn are independent variables so how can > predict the value of y using x1,x2,x3 ...,xn . > > y x1 x2 x3 x4 x5 x6 > 6 0 1 2 3 1 2 > 5 1 3 4 5 6 8 > 8 4 6 9 0 0 1 > 3 5 7 2 1 0 3 > 4 5 6 7 8 2 1 > 1 0 1 1 1 2 2 > y (predicted) values =? >