5
$\begingroup$

I'm looking for some advice as to how to best show graphically the results of my GLMER model. In my model I try to explain Y (a count variable for a business related outcome), in terms of X, Xsquared, and FirmSize, with random effects for Industry/Firm, by year. My results, here below, appear to show a positive relationship between Y and X, but with an inverted-U shape (the Xsquared term is negative and significant). Ideally I would like to obtain a graph showing this inverted-U relationship, but I'm clueless as to how to move forward (I'm relatively new to R and GLMER models).

My GLMER model:

model <- glmer(Y ~ Year + X + Xsquared + Size + (1 + Year|Industry/Firm), data = mydata, family = poisson)

My results:

Random effects:
 Groups        Name        Variance  Std.Dev. Corr
 Firm:Industry (Intercept) 5.840e-01 0.764205     
               cYear       5.546e-03 0.074474 0.38
 Industry      (Intercept) 8.243e-05 0.009079     
               cYear       2.011e-05 0.004485 0.54
Number of obs: 436, groups:  Firm:Industry, 109; Industry, 37

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept) -2.87753    0.47970  -5.999 1.99e-09 ***
cYear       -0.02303    0.02778  -0.829    0.407    
X            1.32358    0.33632   3.935 8.30e-05 ***
Xsquared    -0.27628    0.14217  -1.943    0.049 *  
FirmSize     0.31789    0.04989   6.371 1.87e-10 ***
$\endgroup$

1 Answer 1

3
$\begingroup$

sjPlot package is awesome for plotting graphs for GLMER Model.

http://www.strengejacke.de/sjPlot/

You can use the sjPlot package to plot the model. I think that you can do

sjp.glmer(model, type = "pred", vars = c("X", "FirmSize"))

to plot the way you want!

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.