[R] Data extraction problem after importation using RODBC

Dieter Menne dieter.menne at menne-biomed.de
Thu May 14 15:32:15 CEST 2009

Axel Leroix wrote:
> Then I perform an lm regression using the following code:
> reg1 <-lm(data$prod~data$pri+data$cli) 
> summary(reg1)


reg1 <-lm(prod~pri+cli, data=data) 

instead. It is not necessary to call the data frame you read your stuff into
"data", any more useful name, such as "ecg" or "delivery" will do.
Then I try to perform a gls regression because I have a correlation problem.
For this I use the following code:
reg1gls <- gls(data$prod ~ data$pri + data$cli + 
correlation=corAR1(form= ~data$Year), method='ML')
The problem is that after this gls regression, I have the fellowing error
message :
Error in eval(expr, envir, enclos) :  'Year' object is not find 

If you have problems, print

str(data) << or whatever you want to call this

Use the same form as above; check the documentation example. This has
nothing to do with ODBC import, because your first example worked (I


View this message in context: http://www.nabble.com/Data-extraction-problem-after-importation-using-RODBC-tp23536716p23540678.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list