The R Project SVN R

Rev

Rev 69213 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69213 Rev 69217
Line 1... Line 1...
1
## tests of offsets, and prediction from them.
1
## tests of offsets, and prediction from them.
2
 
2
 
3
have_MASS <- requireNamespace('MASS', quietly = TRUE)
-
 
4
if(!have_MASS) q()
-
 
5
 
-
 
6
data(anorexia, package = "MASS")
3
load("anorexia.rda") # copied from package MASS
7
 
4
 
8
## via formula
5
## via formula
9
fit1 <- lm(Postwt ~ Prewt + Treat + offset(Prewt), data = anorexia)
6
fit1 <- lm(Postwt ~ Prewt + Treat + offset(Prewt), data = anorexia)
10
summary(fit1)
7
summary(fit1)
11
pred <- fitted(fit1)
8
pred <- fitted(fit1)