我正在尝试执行 gamlss 的零膨胀 beta 回归模型,如下所示>它适用于变量 V255,但通过 simialr 变量 V256 的错误
Error in glim.fit(f = nu.object, X = nu.X, y = y, w = w, fv = nu, os = nu.offset, :
object 'fit' not foundim.fit. Object 'fit' not found.
有什么建议可以解决这个问题吗?代码和模型。
library(tidyverse)
library(gamlss)
ddf<-as_tibble(structure(c(0, 0.250601410865784, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.0859533622860909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.070460669696331,
0, 0, 0, 0.0223423503339291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0.249115347862244, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0.135218366980553, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.069370836019516,
0, 0, 0, 0.0225795395672321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65), .Dim = c(65L, 3L), .Dimnames = list(NULL,
c("V255", "V256", "year"))))
ddf
#Model for variable V255, it works
model1<-gamlss(ddf$V255~ddf$year, sigma.fo=~ddf$year, nu.fo=~ddf$year,tau.fo=~ddf$year, family=BEINF)
model1
#Model for varable V256; it through an error
model2<-gamlss(ddf$V256~ddf$year, sigma.fo=~ddf$year, nu.fo=~ddf$year,tau.fo=~ddf$year, family=BEINF)