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

From: Eik Vettorazzi <E.Vettorazzi_at_uke.uni-hamburg.de>
Date: Mon, 21 Apr 2008 11:41:00 +0200

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



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. Received on Mon 21 Apr 2008 - 09:44:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Apr 2008 - 10:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive