0
我试图预测拟合gamlss模型的数据,并且有一个烦人的问题,我无法处理。r - data.frame(data,source = namelist)中的错误:参数意味着行数不同:3,4 - 在predict()中
Error in data.frame(data, source = namelist) :
arguments imply differing number of rows: 3, 4
代码&数据
library('gamlss')
asfr=c(0.0000000000,0.0001818271,0.0001818271,0.0228344684,0.0228344684)
ages=c(12:16)
data=data.frame(y=asfr,x=ages)
model=gamlss(y~x,data=data,method=mixed(1,20))
test=data.frame(x=c(12,13,14))
predict(model,newdata=test, type = "response")
我搜索了一些similiar问题,但reshape2答案没有工作。
此外,作为一个例子,我使用的代码在第89页up here