A wrapper for termplot that optionally (but by default) exponentiates terms, and plot them on a common logscale. Also scales xaxes to the same physical scale.
Description
The function uses termplot
to extract terms from a model
with, say, spline, terms, including the standard errors, computes
confidence intervals and transform these to the rate / rateratio
scale. Thus the default use is for models on the logscale such as
Poissonregression models. The function produces a plot with panels
sidebyside, one panel per term, and returns the
Usage
1 2 3 4 5 6 7 8 9 
Arguments
obj 
An object with a 
plot 
Should a plot be produced? 
xlab 
Labels for the 
ylab 
Labels for the 
xeq 
Should the units all all plots have the same physical scale
for the 
yshr 
Shrinking of 
alpha 
1 minus the confidence level for computing confidence intervals 
terms 
Which terms should be reported. Passed on to

max.pt 
The maximal number of points in which to report the
terms. If 
Value
A list with one component per term in the model object obj
,
each component is a 4column matrix with $x$ as the first column, and
3 columns with estimae and lower and upper confidence limit.
Author(s)
Bendix Cartensen
See Also
Ns
, termplot
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  # Get the diabetes data and set up as Lexis object
data(DMlate)
DMlate < DMlate[sample(1:nrow(DMlate),500),]
dml < Lexis( entry = list(Per=dodm, Age=dodmdobth, DMdur=0 ),
exit = list(Per=dox),
exit.status = factor(!is.na(dodth),labels=c("DM","Dead")),
data = DMlate )
# Split in 1year age intervals
dms < splitLexis( dml, time.scale="Age", breaks=0:100 )
# Model with 6 knots for both age and period
n.kn < 6
# Model agespecific rates with period referenced to 2004
( a.kn < with( subset(dms,lex.Xst=="Dead"),
quantile( Age+lex.dur, probs=(1:n.kn0.5)/n.kn ) ) )
( p.kn < with( subset(dms,lex.Xst=="Dead"),
quantile( Per+lex.dur, probs=(1:n.kn0.5)/n.kn ) ) )
m2 < glm( lex.Xst=="Dead" ~ 1 +
Ns( Age, kn=a.kn, intercept=TRUE ) +
Ns( Per, kn=p.kn, ref=2004 ),
offset = log( lex.dur ), family=poisson, data=dms )
# Finally we can plot the two effects:
Termplot( m2, yshr=0.9 )
