rbind(deparse.level,…)中出错:将变量存储为因子后,参数的列数不匹配

rbind(deparse.level,…)中出错:将变量存储为因子后,参数的列数不匹配,r,linear-regression,categorical-data,rbind,psych,R,Linear Regression,Categorical Data,Rbind,Psych,我在R中运行分层回归。当我运行下面的代码来更改分类变量以存储为因子时,它会导致我的模型更改 #Check to see if Frame is stored as a factor (categorical variable) is.factor(dat$Frame) #Frame is not stored categorically #Change Frame to a factor dat$Frame <- as.factor(dat$Frame) 我为我的模型使用的代码如下: M

我在R中运行分层回归。当我运行下面的代码来更改分类变量以存储为因子时,它会导致我的模型更改

#Check to see if Frame is stored as a factor (categorical variable)
is.factor(dat$Frame)
#Frame is not stored categorically
#Change Frame to a factor
dat$Frame <- as.factor(dat$Frame)
我为我的模型使用的代码如下:

Model1 <- lm(data = dat, Memory ~ Word_Count) 
Model2 = lm(data = dat, Memory ~ Word_Count + Frame)

Model1如果使用因子,则
lm
模型对象是一个列表,其中现在包含一个名为
对比度的列表,该列表列出了因子的对比度。我也有同样的问题。仍在尝试找出答案。如果使用因子,则
lm
模型对象是一个列表,其中现在包含一个名为
对比度的列表,该列表列出了因子的对比度。我也有同样的问题。我还在想办法。
Model1 <- lm(data = dat, Memory ~ Word_Count) 
Model2 = lm(data = dat, Memory ~ Word_Count + Frame)