Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7737201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:56:10+00:00 2026-06-01T07:56:10+00:00

I have an example mixed lmer model with 8 predictors and I want to

  • 0

I have an example mixed lmer model with 8 predictors and I want to extract the names of the covariates, their coefficients, their standard errors and their p-values and place them into a matrix so I can write them out to a .csv.

I’ve extracted the first 3 into columns fine, but I can’t figure out how to extract the p values. How do you do this? Is it a variation of vcov or getME()?

Here is what the model and summary look like:

mod <- lmer(outcome ~ predictor1 + etc...
summary(mod)

Generalized linear mixed model fit by the Laplace approximation 
Formula: Freq ~ pm.lag0 + pm.lag1 + pm.lag2 + pm.lag3 + pm.lag4 + pm.lag5 
+ temp13 + temp013 + rh13 + rh013 + (1 | county) 
   Data: dt 
  AIC  BIC logLik deviance
 3574 3636  -1775     3550
Random effects:
 Groups Name        Variance Std.Dev.
 county (Intercept) 1.6131   1.2701  
Number of obs: 1260, groups: county, 28

Fixed effects:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)  2.9356504  0.2614892  11.227  < 2e-16 ***
pm.lag0      0.0012996  0.0005469   2.376 0.017494 *  
pm.lag1      0.0005021  0.0005631   0.892 0.372568    
pm.lag2      0.0009126  0.0005596   1.631 0.102893    
pm.lag3     -0.0007073  0.0005678  -1.246 0.212896    
pm.lag4      0.0031566  0.0005316   5.939 2.88e-09 ***
pm.lag5      0.0019598  0.0005359   3.657 0.000255 ***
temp13      -0.0028040  0.0007315  -3.833 0.000126 ***
temp013     -0.0023532  0.0009683  -2.430 0.015087 *  
rh13         0.0058769  0.0009909   5.931 3.01e-09 ***
rh013       -0.0028568  0.0006070  -4.706 2.52e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Correlation of Fixed Effects:
        (Intr) pm.lg0 pm.lg1 pm.lg2 pm.lg3 pm.lg4 pm.lg5 temp13 tmp013 rh13  
pm.lag0 -0.025                                                               
pm.lag1 -0.032 -0.154                                                        
pm.lag2 -0.021  0.044 -0.179                                                 
pm.lag3  0.002  0.003  0.033 -0.176                                          
pm.lag4  0.016  0.102 -0.016  0.041 -0.176                                   
pm.lag5  0.008  0.027  0.090 -0.002  0.040 -0.186                            
temp13  -0.316  0.026  0.027  0.004 -0.019 -0.055 -0.035                     
temp013  0.030 -0.015  0.051  0.015 -0.015  0.002 -0.069 -0.205              
rh13    -0.350  0.043  0.078  0.056 -0.012 -0.042 -0.030  0.430  0.055       
rh013    0.193 -0.008 -0.021  0.011  0.030  0.101 -0.028 -0.278  0.025 -0.524

I’ve gone ahead here and left a space for the p-value column and entered a colname for it, so this sample of code isn’t operational:

mixed.results <- mod
cbind(names(fixef(mod)),as.numeric(fixef(mod)),sqrt(diag(vcov(mod))),  ????  )
mixed.results
colnames(mixed.results) <- c("Pred", "Coef", "St. Error", "Pr(>|z|)")
mixed.results
write.csv(mixed.results, file="mixedmod1.csv")

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:56:11+00:00Added an answer on June 1, 2026 at 7:56 am

    This is just coef(summary(model)), I believe:

    gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
                       data = cbpp, family = binomial)
    cc <- coef(summary(gm1))
    str(cc)
    # num [1:4, 1:4] -1.376 -1.058 -1.196 -1.638 0.205 ...
    # - attr(*, "dimnames")=List of 2
    #  ..$ : chr [1:4] "(Intercept)" "period2" "period3" "period4"
    #  ..$ : chr [1:4] "Estimate" "Std. Error" "z value" "Pr(>|z|)"
    cc[,4] ## or cc[,"Pr(>|z)"] to be more explicit
    # (Intercept)      period2      period3      period4 
    #1.907080e-11 1.996120e-41 4.634385e-43 4.657952e-47 
    

    I used the development version of lme4 but I think this has worked for a while.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have example.org and foo.example.org pointing to the same directory, /var/www/html/ , and want
I have some source code file which has mixed tabs/spaces and I want to
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser
Anyone have example Rx code that shows how to execute an action due to
I have example: for line in IN.readlines(): line = line.rstrip('\n') mas = line.split('\t') row
If I have example.com/dir and dir is basically a folder in the example.com server,
Anyone have an example snippet showing how to scale a Font using AffineTransform? Thanks.
I have an example in C# code, but it is using streamWriter . It
I have an example of some code that I see often in websites that
I have an example where a protocol would be ideal except for the fact

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.