Skip to content

Commit

Permalink
playing around with weights
Browse files Browse the repository at this point in the history
  • Loading branch information
florianhartig committed Jul 17, 2021
1 parent 536632e commit 7a08736
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/DHARMaDevelopment/weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library(lme4)
library(glmmTMB)
library(spaMM)

testData = createData(sampleSize = 200, overdispersion = 0, family = gaussian())
testData = createData(sampleSize = 200, overdispersion = 0, family = poisson())

# lm weights are considered in simulate()
fit <- lm(observedResponse ~ Environment1 , weights = Environment1 +1,
Expand Down Expand Up @@ -38,7 +38,7 @@ simulateResiduals(fittedModel = fit, plot = T)

# glmmTMB does not warn

fit <- glmmTMB(ceiling(exp(observedResponse)) ~ Environment1 + (1|group), weights = Environment1 +1,
fit <- glmmTMB(observedResponse ~ Environment1 + (1|group), weights = (testData$Environment1 +1)*1,
data = testData, family = "poisson")
simulateResiduals(fittedModel = fit, plot = T)

Expand Down

0 comments on commit 7a08736

Please sign in to comment.