I know how to obtain the fixed effects from a mer object:
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1)
or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
7 messages · Andrzej, Gang Chen, Joehanes, Roby (NIH/NHLBI) [F] +2 more
I know how to obtain the fixed effects from a mer object:
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1)
or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
Try summary(fm1) Andrzej
I know how to obtain the fixed effects from a mer object:
(fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1) or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
Sorry I should have stated a little clearer. I do know how to see or print the t-statistic values at the R prompt. What I meant to ask is how to extract the t-statistic values from the mer slots. Gang
Try summary(fm1) Andrzej On 5/22/2012 1:56 PM, Gang Chen wrote: I know how to obtain the fixed effects from a mer object:
(fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1) or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
How about summary(fm1)@coefs[,3] Or if you are using the next-generation lme4: summary(fm1)$coef[,3] Roby On 5/22/12 2:35 PM, "Chen, Gang (NIH/NIMH) [C]" <gangchen at mail.nih.gov> wrote:
Sorry I should have stated a little clearer. I do know how to see or print the t-statistic values at the R prompt. What I meant to ask is how to extract the t-statistic values from the mer slots. Gang On Tue, May 22, 2012 at 2:21 PM, Andrzej <agalecki at umich.edu> wrote:
Try summary(fm1) Andrzej On 5/22/2012 1:56 PM, Gang Chen wrote: I know how to obtain the fixed effects from a mer object:
(fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1) or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Yes, that works well. Thanks a lot, Roby! Gang On Tue, May 22, 2012 at 2:48 PM, Joehanes, Roby (NIH/NHLBI) [F]
How about summary(fm1)@coefs[,3] Or if you are using the next-generation lme4: summary(fm1)$coef[,3] Roby On 5/22/12 2:35 PM, "Chen, Gang (NIH/NIMH) [C]" <gangchen at mail.nih.gov> wrote:
Sorry I should have stated a little clearer. I do know how to see or print the t-statistic values at the R prompt. What I meant to ask is how to extract the t-statistic values from the mer slots. Gang On Tue, May 22, 2012 at 2:21 PM, Andrzej <agalecki at umich.edu> wrote:
Try summary(fm1) Andrzej On 5/22/2012 1:56 PM, Gang Chen wrote: I know how to obtain the fixed effects from a mer object:
(fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1) or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
The preferred idiom is coef(summary(fm1))
library(lme4) fm1 <- lmer(Yield ~ 1|Batch, Dyestuff) str(coef(summary(fm1)))
num [1, 1:3] 1527.5 19.4 78.8 - attr(*, "dimnames")=List of 2 ..$ : chr "(Intercept)" ..$ : chr [1:3] "Estimate" "Std. Error" "t value" because it works in lme4.0 and the development lme4 (and for many other types of fitted models too). On Tue, May 22, 2012 at 1:48 PM, Joehanes, Roby (NIH/NHLBI) [F]
How about summary(fm1)@coefs[,3] Or if you are using the next-generation lme4: summary(fm1)$coef[,3] Roby On 5/22/12 2:35 PM, "Chen, Gang (NIH/NIMH) [C]" <gangchen at mail.nih.gov> wrote:
Sorry I should have stated a little clearer. I do know how to see or print the t-statistic values at the R prompt. What I meant to ask is how to extract the t-statistic values from the mer slots. Gang On Tue, May 22, 2012 at 2:21 PM, Andrzej <agalecki at umich.edu> wrote:
Try summary(fm1) Andrzej On 5/22/2012 1:56 PM, Gang Chen wrote: I know how to obtain the fixed effects from a mer object:
(fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
fixef(fm1) or,
getME(fm1, 'beta')
But how can I obtain the t-statistic values for the fixed effects? Thanks, Gang
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Gang Chen <gangchen6 at ...> writes:
Yes, that works well. Thanks a lot, Roby! Gang On Tue, May 22, 2012 at 2:48 PM, Joehanes, Roby (NIH/NHLBI) [F] <roby.joehanes at ...> wrote:
How about summary(fm1)@coefs[,3] Or if you are using the next-generation lme4: summary(fm1)$coef[,3]
Generally I think coef(summary(fm1))[,3] should allow you to get the t-statistics in either case, *without* delving into the internal structure of the fitted model. If you find that you consistently need to dig into the internals of the fitted objects, you should ask on the list and/or ask the maintainers to provide an appropriate accessor method ... (I will admit that I haven't tested this) Ben Bolker