加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何从elrm摘要输出中提取系数

发布时间:2020-12-17 21:27:12 所属栏目:安全 来源:网络整理
导读:我使用包elrm在我的数据集上运行了精确的逻辑回归 我将它与普通的逻辑回归进行比较. 我能够在普通的逻辑回归上运行一个自举,我提取的兴趣统计数据是估计的系数和p值. 但是,我无法运行我的elrm bootstrap,因为我无法从输出中提取我需要的系数. 使用我的数据,
我使用包elrm在我的数据集上运行了精确的逻辑回归

我将它与普通的逻辑回归进行比较.

我能够在普通的逻辑回归上运行一个自举,我提取的兴趣统计数据是估计的系数和p值.

但是,我无法运行我的elrm bootstrap,因为我无法从输出中提取我需要的系数.

使用我的数据,摘要会打印出来:

Results:
   estimate p-value p-value_se mc_size
M  0.15116 0.06594    0.00443   49000

95% Confidence Intervals for Parameters

     lower     upper
M 0.00156155 0.3647232

我想提取M估计值和p值,这样我就可以在执行引导程序时提取这些统计数据.我尝试了一些不同的组合来尝试拉取值,但它们无法正常工作.

summary(model)$coefficient 
summary(model)$Results
summary(model)$estimate

所有这些只是再次吐出摘要.

有谁知道是否有可能从elrm摘要中提取?

任何帮助,将不胜感激.

解决方法

library(elrm)
data(drugDat)
drug.elrm <- elrm(formula=recovered/n~sex+treatment,interest=~sex+treatment,r=4,iter=100000,burnIn=1000,dataset=drugDat)

> summary.elrm(drug.elrm)

Call:
[[1]]
elrm(formula = recovered/n ~ sex + treatment,interest = ~sex + 
    treatment,r = 4,iter = 1e+05,dataset = drugDat,burnIn = 1000)


Results:
          estimate p-value p-value_se mc_size
joint           NA 0.14886    0.00173   99000
sex        0.27092 0.69385    0.01204    2649
treatment  0.76739 0.07226    0.00314   13160

95% Confidence Intervals for Parameters

               lower    upper
sex       -0.6217756 1.212499
treatment -0.1216884 1.852346

# If you look at the summary function,it simply outputs formatted results to
# the screen. So instead,we can just work with the original drug.elrm object

names(drug.elrm)
# shows you everything in this object

# to see the p-values
drug.elrm$p.values.se
      joint         sex   treatment 
0.001734482 0.012039701 0.003143006 

# to get the p-value for joint
drug.elrm$p.values.se[[1]]

# now for the CI
drug.elrm$coeffs.ci
               lower    upper
sex       -0.6217756 1.212499
treatment -0.1216884 1.852346

> drug.elrm$coeffs.ci[[1]]
[1] -0.6217756 -0.1216884
> drug.elrm$coeffs.ci[[1]][1]
[1] -0.6217756
>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读