2

I want to analyze when the claims of a protest are directed at the state, based on action and country level characteristics, using glmer. So, I would like to obtain p-values of both the fixed and random effects. My model looks like this:

targets <- glmer(state ~ ENV + HLH + HRI + LAB + SMO + Capital + 
(1 + rile + parties + rep + rep2 + gdppc + election| Country), 
data = df, family = binomial)

The output only gives me the Variance & Std.Dev. of the random effects, as well as the correlations among them, which makes sense for most multilevel analyses but not for my purposes. Is there any way I can get something like the estimates and the p-values for the random effects?

If this cannot be done with R, is there any other statistical software that would give such an output?

UPDATE: Following the suggestions here, I have moved this question to Cross Validated: https://stats.stackexchange.com/questions/381208/r-how-to-get-estimates-and-p-values-for-random-effects-in-glmer

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
Spl4t
  • 53
  • 8
  • have you tried summary(targets)? – paoloeusebi Dec 08 '18 at 18:54
  • That is how I get the results I mentioned in the post. It only provides the estimates and p-values of the fixed effects and the Variance & Std.Dev. of the random effects, as well as the correlations among them. – Spl4t Dec 08 '18 at 19:47

1 Answers1

1
library(lme4)

library(lattice) 

xyplot(incidence/size ~ period|herd, cbpp, type=c('g','p','l'),
   layout=c(3,5), index.cond = function(x,y)max(y))

gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
          data = cbpp, family = binomial)

summary(gm1) 
paoloeusebi
  • 1,056
  • 8
  • 19
  • Thanks! Could you please help a bit understanding the code, especially of the xyplot line, I am far from an expert in R. – Spl4t Dec 08 '18 at 19:48
  • It's a random intercept model with a binomial response. Lattice is loaded for having a reproducible example. – paoloeusebi Dec 08 '18 at 19:55
  • Grazie. I was hoping that you could guide me a bit adapting it to my model, because I am struggling to figure out how to do it. – Spl4t Dec 08 '18 at 21:34
  • Hard to say. You should move this question to cross validated with greater details of problem, expected outcomes, data. – paoloeusebi Dec 08 '18 at 22:07
  • Thanks for the suggestion, I have asked the question here: https://stats.stackexchange.com/questions/381208/r-how-to-get-estimates-and-p-values-for-random-effects-in-glmer – Spl4t Dec 10 '18 at 07:22