Skip to content

Commit

Permalink
code for issue 222
Browse files Browse the repository at this point in the history
example code for #222
  • Loading branch information
florianhartig committed Jun 3, 2024
1 parent 5533367 commit e269198
Show file tree
Hide file tree
Showing 2 changed files with 3,027 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Code/DHARMaIssues/222.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dat = read.table("222.txt", header = T, sep = "|")
head(dat)
library(lme4)
mod1=glmer(RT~DISP+(DISP|subj),family=Gamma(link="inverse"),data = dat)

simulationOutput <- simulateResiduals(fittedModel = mod1, plot = T)
# produces infinity error

x = predict(mod1, type = "response")
min(x)
max(x)

# unconditional simulations, default in DHARMa
simulate(mod1)
simulate(mod1, re.form = ~0)

# conditional simulations
simulate(mod1, re.form = NULL)

simulationOutput <- simulateResiduals(fittedModel = mod1, plot = T, re.form = NULL)

Loading

0 comments on commit e269198

Please sign in to comment.