Skip to content

Commit

Permalink
hessian estimation for dictator model and histograms of random effect…
Browse files Browse the repository at this point in the history
…s for both mixed models
  • Loading branch information
phelps-sg committed Jan 13, 2024
1 parent 9347e04 commit f1475a4
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion jupyter-book/R-MixedModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ model_dictator <- clmm(
)
summary(model_dictator)

#f%%

model_dictator_hess <- clmm(
Response ~
Participant_group + Participant_group:Model + t + Model + Temperature +
(1 | Participant_id),
link = "logit", threshold = "equidistant",
data = results_dictator,
Hess = TRUE,
nAGQ = 10
)
summary(model_dictator_hess)

# %%
model_pd_poisson <- glmmTMB(
Num_cooperates ~
Expand Down Expand Up @@ -311,14 +324,34 @@ summary(model_pd_1)

# %%
texreg(
model_pd,

model_pd_1,
caption = "Fitted model for Prisoners Dilemma",
label = "table:pd-estimates",
file = "pd-estimates.tex",
single.row = TRUE,
fontsize = "small"
)

# %%
texreg(
model_dictator,
caption = "Fitted model for Dictator",
label = "table:dictator-estimates",
file = "dictator-estimates.tex",
single.row = TRUE,
fontsize = "small"
)

# %%
pdf("figs/ranef_hist_pd.pdf")
hist(ranef(model_pd_1)$cond$Participant_id[, 1])
dev.off()

# %%
pdf("figs/ranef_hist_dictator.pdf")
hist(ranef(model_dictator)$Participant_id[, 1])
dev.off()
# %%
xtable(lme4::formatVC(summary(model_pd)$varcor$cond))

Expand Down

0 comments on commit f1475a4

Please sign in to comment.