When I do:

> apc <- glm( D ~ ns( Ax, knots=seq(50,80,10), Bo=c(40,90) ) +
+                 ns( Cx, knots=seq(1880,1940,20), Bo=c(1840,1960) ) +
+                 ns( Px, knots=seq(1960,1980,10), Bo=c(1940,2000) ) +
+                 offset( log( Y ) ),
+             family=poisson )
> pterm <-  predict( apc, type="terms" )
> plink <-  predict( apc, type="link" )
> ( apply( pterm, 1, sum ) + log( Y ) - plink )[1:10]
      1       2       3       4       5       6       7       8       9
10 
6.85047 6.85047 6.85047 6.85047 6.85047 6.85047 6.85047 6.85047 6.85047
6.85047 
> coef( apc )[1] 
(Intercept) 
  -13.61998 

>From the help page for predict.glm I would have expected that the
constant 6.85 
was -intercept.

What am I missing from predict.glm? (or from splines?)

Bendix Carstensen

----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to