如何从Elrm摘要输出中提取系数 [英] How to extract coefficients from elrm summary output

查看:237
本文介绍了如何从Elrm摘要输出中提取系数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用软件包elrm

我正在将其与普通逻辑回归进行比较.

I am comparing it to ordinary logistic regression.

我能够对普通的logistic回归进行引导,我所关注的统计数据是估计系数和p值.

I was able to run a bootstrap on the ordinary logistic regression, the statistics of interest I pulled were the estimated coefficient and p-value.

但是,我无法运行elrm引导程序,因为无法从输出中提取所需的系数.

However, I cannot run my elrm bootstrap because I can't pull the coefficients I need from the output.

使用我的数据,摘要提供了打印输出:

With my data the summary gives a print out:

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值,以便在执行引导时可以提取这些统计信息.我尝试了一堆不同的组合来尝试提取值,但它们不起作用.

I want to extract the M estimate and p-value so I can pull these stats when I do the bootstrap. I have tried a bunch of different combinations to try and pull the values and they aren't working.

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

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

All of these just spit out the summary again.

有人知道是否可以从elrm摘要中提取吗?

Does anyone know if it is possible to extract from the elrm summary?

任何帮助将不胜感激.

Any help would be appreciated.

推荐答案

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
> 

这篇关于如何从Elrm摘要输出中提取系数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆