Skip to content

Commit 6dc26a5

Browse files
committed
Create 282.R
1 parent 6bb9e97 commit 6dc26a5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Code/DHARMaIssues/282.R

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
library(DHARMa)
2+
testData = createData(sampleSize = 1000, randomEffectVariance = 3, family = gaussian(), numGroups = 10)
3+
library(mgcv)
4+
fit <- gam(observedResponse ~ Environment1 + s(group, bs="re"), data=testData)
5+
simulateResiduals(fit, plot = T)
6+
7+
plotResiduals(fit, predict.gam(fit, exclude ="s(group)"))
8+
9+
10+
library(lme4)
11+
fit <- lmer(observedResponse ~ Environment1 + (1|group), data=testData)
12+
simulateResiduals(fit, plot = T)
13+
summary(fit)
14+

0 commit comments

Comments
 (0)