[R] How can we predict the value of dependent variable using independent variable

Eik Vettorazzi E.Vettorazzi at uke.uni-hamburg.de
Mon Apr 21 11:41:00 CEST 2008


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  =?
>



More information about the R-help mailing list