首页 > 解决方案 > GAMLSS centile.fan 给出错误“if (any(mu < 0)) stop(paste("mu must be positive", "\n", "")) 中的错误:需要 TRUE/FALSE 的缺失值”

问题描述

我正在使用GAMLSS中的lms()命令创建增长百分位曲线。我可以拟合一个模型,也可以绘制centiles()曲线。但是,我无法使用centiles.fan()绘制拟合模型的扇形图。

这是我的代码及其产生的错误。Gm_girl_1 是拟合的 gamlss 模型。

centiles.fan(Gm_girl_1, xvar=ht_B_2$age, cent = c( 10, 25, 50, 75, 90),  xlim=c(4,19), colors=c("gray"))

if (any(mu < 0)) stop(paste("mu must be positive", "\n", "")) 出错:需要 TRUE/FALSE 的地方缺少值

令人惊讶的是 centile() 命令可以正常工作,是 centiles.fan() 的问题吗?任何帮助将不胜感激。谢谢你。

标签: rgamlss

解决方案


推荐阅读