Skip to content

Commit

Permalink
comment factorial model
Browse files Browse the repository at this point in the history
  • Loading branch information
phelps-sg committed Dec 26, 2023
1 parent e483ad1 commit 19d6d71
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions jupyter-book/R-MixedModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@
# %%
xtable(coef(summary(model.pd))$cond, digits=3)

# %%
predicted.plot <- ggpredict(model.pd, c("Partner_condition", "Participant_group"))
plot(predicted.plot)

# %%
predicted.plot <- ggpredict(model.pd, c("Partner_condition", "Participant_group", "Model [gpt-3.5-turbo-1106]"))
plot(predicted.plot)

# %%
predicted.plot <- ggpredict(model.pd, c("Partner_condition", "Participant_group", "Model"))
plot(predicted.plot)

# %%
pdf("figs/glmm-predicted.pdf", width=24, height=12)
plot(predicted.plot)
dev.off()

# %%
plot(ggpredict(model.pd, c("Participant_group", "Model")))

Expand Down Expand Up @@ -269,13 +286,13 @@
overdispersion_check

# %%
model.pd.factorial <- glmmTMB(cbind(Num_cooperates, 6 - Num_cooperates) ~
Participant_group + Partner_condition + t + Model + Temperature +
Partner_condition:Model + Participant_group:Model + Participant_labels_reversed:Participant_label + Participant_labels_reversed:Model +
Participant_label + Participant_chain_of_thought + Participant_pronoun + Participant_defect_first + Participant_labels_reversed,
data = results.clean,
family = betabinomial)
summary(model.pd.factorial)
#model.pd.factorial <- glmmTMB(cbind(Num_cooperates, 6 - Num_cooperates) ~
# Participant_group + Partner_condition + t + Model + Temperature +
# Partner_condition:Model + Participant_group:Model + Participant_labels_reversed:Participant_label + Participant_labels_reversed:Model +
# Participant_label + Participant_chain_of_thought + Participant_pronoun + Participant_defect_first + Participant_labels_reversed,
# data = results.clean,
# family = betabinomial)
#summary(model.pd.factorial)

# %%
simulationOutput.factorial<- simulateResiduals(fittedModel = model.factorial, plot = TRUE, integerResponse=TRUE)
Expand Down

0 comments on commit 19d6d71

Please sign in to comment.