我正在使用betamix
R 中的包来拟合 beta 回归的混合。如果我使用包中给出的示例和代码:
data("ReadingSkills", package = "betareg")
set.seed(4040)
rs_mix <- betamix(accuracy ~ iq, data = ReadingSkills, k = 3,
nstart = 10, extra_components = extraComponent(type = "uniform",
coef = 0.99, delta = 0.01))
summary(rs_mix)
运行拟合betamix
对象的摘要会给出结果:
> summary(rs_mix)
$Comp.1
$Comp.1$mean
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.40342 0.26332 5.3296 9.84e-08 ***
iq 0.82502 0.21630 3.8142 0.0001366 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$Comp.1$precision
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.68509 0.45435 5.9097 3.427e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$Comp.2
$Comp.2$mean
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.502523 0.082476 6.0930 1.108e-09 ***
iq -0.048415 0.112923 -0.4287 0.6681
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$Comp.2$precision
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.25160 0.74737 5.6888 1.279e-08 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
结果Component 2
表明变量iq
不显着。有没有办法从汇总结果中删除这个变量?我试过使用summary(rs_mix)$Comp.1
,它给了我错误:
Error in summary(rs_mix)$Comp.1 :
$ operator not defined for this S4 class