Try this: data(tcm, package="tseries") mod <- lm(tcm[,"tcm1y"]~., data=tcm[,- which(dimnames(tcm)[[2]]=="tcm1y")])
On 07/11/2007, livia <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > I would like to a linear regression with the following code. > lm(a[,"fquamsci"]~., data=a) > > a is a list with class "mts" "ts" , and "fquamsci" is the name of the > response variable in a. I would like to do a linear regression of > "fquamsci" > to the rest of the variables. But it turns out the "fquamsci" is also > included in the explanatory variables. I tried the following, it is quite > strange that it does not work as well. > > lm(a[,"fquamsci"]~.-a[,"fquamsci"], data=a) > > Could anyone give me some advice? > Many thanks > > -- > View this message in context: > http://www.nabble.com/Linear-Regression-tf4764346.html#a13626039 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.