3 回答
TA贡献1942条经验 获得超3个赞
model <- lm(Total ~ Coupon, data=df)
不 model <-lm(df$Total ~ df$Coupon, data=df)
.
lm(Total ~ Coupon)
Total
Coupon
Total = a + b*Coupon
a
b
~
Coupon
Total
.
newdata
Coupon
Total
model <- lm(Coupon ~ Total, data=df)new.df <- data.frame(Total=c(79037022, 83100656, 104299800))predict(model, new.df)
TA贡献2037条经验 获得超6个赞
lm(olive$Area@olive$Palmitic)
anewdata<-data.frame(Palmitic=2)
lm(Area@Palmitic,data=olive)
警告消息:“anewdata”有1行,但变量有X行
TA贡献1848条经验 获得超10个赞
model <- lm(Coupon ~ Total, data=df)predict(model, data.frame(Total=c(79037022, 83100656, 104299800)))
model <- lm(Coupon ~ Total, data=df) #Okmodel <- lm(df$Coupon ~ df$Total) #Ko
- 3 回答
- 0 关注
- 470 浏览
添加回答
举报