使用MAPE函数的R错误,我该如何解决?
我建立了一个模型
model.5 <- lm(formula = rent ~ area + rooms + age + nationality + maritalstat + education + traveltime + region + center, data=mysample)
,现在我做了预测
sel <- is.na(mysample$rent)
predict(model.5, newdata=subset(mysample, sel), interval="pred")
newprediction <- predict(model.5, newdata=subset(mysample, sel), interval="prediction")
我想知道为什么我的Mape不起作用
MAPE(newprediction, mysample$rent)
有人可以帮助我吗?我会很高兴的。
一切顺利
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我注意到MAPE函数后有一个空间(就在开放括号之前)。这可能会导致错误。
如果这无法解决您的问题,那么如果您可以分享您收到的错误消息,这将很有帮助。
I noticed that there is a space after the MAPE function (right before the opening parenthesis). That could cause an error.
If that doesnt solve your issue, it would help a lot if you could share the error message you get.