As the R very beginner I'd like to ask if anyone could help me with the following problem?
library(foreign)
reg1 <- read.spss("URL of the spss file")
library(nlme)
model1 <- gls(v1 ~ x1 + x2 + x3 + x4 + x5 + x6, correlation=corARMA(p=1), data=reg1)
Error in eval(expr, envir, enclos) : object 'v1' not found
All the variables v1 to x6 are present in the spss file. Thanks in advance for help.
Thanks Nick. I can't share the file. I tried the procedure, but I got the similar result:
library(foreign)
library(nlme)
reg1 <- read.spss("URL", to.data.frame=TRUE)
class(reg1) #check that it is indeed a data.frame [1] "data.frame"
colnames(reg1) #check that all column names are properly imported ....
[17] "x1" "x2" "x3" "x4"
[21] "x5" "x6"
....
[97] "...." "v1" "...." "...."
....
model1 <- gls(v1 ~ x1 + x2 + x3 + x4 + x5 + x6, correlation=corARMA(p=1), data=reg1)
Error in eval(expr, envir, enclos) : object 'img4' not found