Greetings all,
I’ve been trying to obtain odds ratio for random effects. I’ve used the parameters package to get summary of posterior distribution and ploted the results, however I get fixed effects on the plot. How can I get the results for random effects in model and more importantly how can I visualize them?
Here is my model and codes I’ve used.
results <- stan_glmer(Alternation ~ Agent_Pos + Agent_Animacy + Semantic_Class + Theme_Pos + Theme_Animacy + Theme_length + Recipient_Pos + Recipient_Animacy + Recipient_length + (1 | Native_Language), data = df, family = binomial(link = 'logit'), init_r = 0.5, QR = TRUE)
model <- model_parameters(results, exponentiate = TRUE)
plot(model)
Since Native_language (factor with 27 levels) was provided as the random effects in the model, I would like to visualize odds ratio for each level in the factor. I guess adding effects = "random"
just assume all variable in the model as random.
Output from the model_parameters(results, exponentiate = TRUE)
Parameter | Median | 95% CI | pd | % in ROPE | Rhat | ESS | Prior
(Intercept) | 0.30 | [0.14, 0.72] | 99.88% | 0% | 0.999 | 5968.00 | Normal (0 ± 2.50)
Agent_PosPRON | 0.88 | [0.72, 1.09] | 87.30% | 73.16% | 1.000 | 7166.00 | Normal (0 ± 2.50)
Agent_PosPROPN | 1.06 | [0.75, 1.51] | 62.15% | 68.98% | 1.000 | 7977.00 | Normal (0 ± 2.50)
Agent_AnimacyInanimate | 0.67 | [0.55, 0.83] | 99.98% | 0% | 1.000 | 7148.00 | Normal (0 ± 2.50)
Semantic_Classc | 0.42 | [0.27, 0.66] | 100% | 0% | 0.999 | 7574.00 | Normal (0 ± 2.50)
Semantic_Classf | 1.65 | [1.18, 2.28] | 99.98% | 0.63% | 1.000 | 7729.00 | Normal (0 ± 2.50)
Semantic_Classnd | 0.16 | [0.09, 0.30] | 100% | 0% | 1.000 | 6717.00 | Normal (0 ± 2.50)
Semantic_Classp | 0.06 | [0.03, 0.14] | 100% | 0% | 1.000 | 5814.00 | Normal (0 ± 2.50)
Semantic_Classt | 1.57 | [1.15, 2.12] | 99.75% | 2.92% | 1.000 | 8817.00 | Normal (0 ± 2.50)
Theme_PosPRON | 3.52 | [2.31, 5.25] | 100% | 0% | 0.999 | 6166.00 | Normal (0 ± 2.50)
Theme_PosPROPN | 1.57 | [0.54, 3.95] | 80.80% | 19.18% | 1.000 | 7146.00 | Normal (0 ± 2.50)
Theme_AnimacyInanimate | 1.81 | [1.08, 2.96] | 99.15% | 3.05% | 0.999 | 6099.00 | Normal (0 ± 2.50)
Theme_length | 0.32 | [0.20, 0.50] | 100% | 0% | 1.000 | 7644.00 | Normal (0 ± 2.50)
Recipient_PosPRON | 0.23 | [0.18, 0.29] | 100% | 0% | 1.000 | 8672.00 | Normal (0 ± 2.50)
Recipient_PosPROPN | 1.01 | [0.60, 1.76] | 52.48% | 53.01% | 0.999 | 7980.00 | Normal (0 ± 2.50)
Recipient_AnimacyInanimate | 1.86 | [1.48, 2.35] | 100% | 0% | 0.999 | 7963.00 | Normal (0 ± 2.50)
Recipient_length | 9.90 | [5.67, 16.95] | 100% | 0% | 1.000 | 6322.00 | Normal (0 ± 2.50)