Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Apr 18, 2024
1 parent 669ccb2 commit fa1d333
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/library/stats/tests/offsets.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ stopifnot(exprs = {
is.null(model.weights(model.frame(fit5)))
})
## these were all (even the model fit!) wrong in R <= 4.2.1

## via formula, with stats:: namespace-qualification (#18706)
fit6 <- lm(Postwt ~ Prewt + Treat + stats::offset(Prewt), data = anorexia)
summary(fit6)
pred <- fitted(fit6)
stopifnot(all.equal(predict(fit6, anorexia), pred))

0 comments on commit fa1d333

Please sign in to comment.