Re: [R] lm() function

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Thu, 29 May 2008 17:57:30 -0400

Dear Hanen,

You don't need "1" in your R code. Try this:

# Model
mymodel<-lm(y~x1+x2)

# Coefficients
summary(mymodel)

See also ?lm.

Thanks,

Jorge

On Thu, May 29, 2008 at 5:15 PM, hanen <hanen.mastouri_at_yahoo.fr> wrote:

>
> hi,
>
>
> my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of:
>
> mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length
>
> the result is a=NA.so i want to know where is the problem.
> --
> View this message in context:
> http://www.nabble.com/lm%28%29-function-tp17546079p17546079.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]



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 Thu 29 May 2008 - 22:05:04 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 Thu 29 May 2008 - 22:30:44 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