问题遇到的现象和发生背景
做LGM时step1要estimate inter- and intra-individual variability in the time-varying DV
需要用到glm做自回归检验,复制粘贴老师上课练习的code,但是不知道为什么自己做的时候就error了?
getwd()
list.files()
lgm<-read.csv("homework_daily(996)person(116).csv",header=T)
lgm
library(multilevel)
library(nlme)
library(MASS)
library(rio)
colnames(lgm)
var.names.lgm <- tolower(colnames(lgm))
colnames(lgm)<-var.names.lgm
Model.1<-gls(dts~1,data=glm,na.action=na.omit)
Error in as.data.frame.default(data, optional = TRUE) :
cannot coerce class ‘"function"’ to a data.frame