Skip to content

Commit

Permalink
gemeans contrast for posthoc testing
Browse files Browse the repository at this point in the history
  • Loading branch information
phelps-sg committed Jan 21, 2024
1 parent 889f216 commit 773923e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions environment-frozen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ dependencies:
- r-lme4=1.1_35.1=r43ha503ecb_0
- r-lmtest=0.9_40=r43h61816a4_2
- r-loo=2.6.0=r43hc72bb7e_1
- r-lsmeans=2.30_0=r43hc72bb7e_4
- r-lubridate=1.9.3=r43h57805ef_0
- r-magrittr=2.0.3=r43h57805ef_2
- r-maptools=1.1_8=r43h57805ef_0
Expand All @@ -505,6 +506,7 @@ dependencies:
- r-modelmetrics=1.2.2.2=r43ha503ecb_3
- r-modelr=0.1.11=r43hc72bb7e_1
- r-modelsummary=1.4.3=r43hc72bb7e_0
- r-multcomp=1.4_25=r43hc72bb7e_0
- r-munsell=0.5.0=r43hc72bb7e_1006
- r-mvtnorm=1.2_4=r43hd9ac46e_0
- r-nleqslv=3.3.5=r43h61816a4_0
Expand Down Expand Up @@ -580,6 +582,7 @@ dependencies:
- r-rstatix=0.7.2=r43hc72bb7e_1
- r-rstudioapi=0.15.0=r43hc72bb7e_0
- r-rvest=1.0.3=r43hc72bb7e_2
- r-sandwich=3.1_0=r43hc72bb7e_0
- r-sass=0.4.8=r43ha503ecb_0
- r-scales=1.3.0=r43hc72bb7e_0
- r-selectr=0.4_2=r43hc72bb7e_3
Expand Down Expand Up @@ -612,6 +615,7 @@ dependencies:
- r-tensora=0.36.2.1=r43h57805ef_0
- r-texreg=1.39.3=r43hc72bb7e_0
- r-textshaping=0.3.7=r43hd87b9d6_0
- r-th.data=1.1_2=r43hc72bb7e_1
- r-threejs=0.3.3=r43hc72bb7e_3
- r-tibble=3.2.1=r43h57805ef_2
- r-tidyr=1.3.0=r43ha503ecb_1
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ dependencies:
- r-cmdstanr
- r-languageserver
- r-marginaleffects
- r-multcomp
- pip
- pip:
- -e ./
Expand Down
27 changes: 13 additions & 14 deletions jupyter-book/R-MixedModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ use_condaenv("llm-cooperation")
llm_coop <- import("llm_cooperation.main")

# %%
config <- llm_coop$Configuration(
grid = dict(
temperature = list(0.1),
model = list("gpt-3.5-turbo-1106"),
max_tokens = list(500)
),
experiment_names = list("dilemma"),
num_participant_samples = 30,
num_replications = 3
)
# config <- llm_coop$Configuration(
# grid = dict(
# temperature = list(0.1),
# model = list("gpt-3.5-turbo-1106"),
# max_tokens = list(500)
# ),
# experiment_names = list("dilemma"),
# num_participant_samples = 30,
# num_replications = 3
# )

# %%
config <- llm_coop$Configuration(
Expand Down Expand Up @@ -440,8 +440,7 @@ summary(model_pd_2)

# %%
texreg(

model_pd_1,
model_pd_2,
caption = "Fitted model for Prisoners Dilemma",
label = "table:pd-estimates",
file = "pd-estimates.tex",
Expand All @@ -461,7 +460,7 @@ texreg(

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

# %%
Expand Down Expand Up @@ -723,7 +722,7 @@ combined.plots
options(repr.plot.height = 12)
pdf("figs/residuals-plots.pdf")
simulationOutput <-
simulateResiduals(fittedModel = model_pd_1, plot = TRUE, integerResponse = TRUE)
simulateResiduals(fittedModel = model_pd_2, plot = TRUE, integerResponse = TRUE)
dev.off()

# %%
Expand Down

0 comments on commit 773923e

Please sign in to comment.