glmBfp (version 0.0-51)

plotCurveEstimate: Function for plotting a fractional polynomial curve estimate

Description

Plot a fractional polynomial curve estimate using samples from a single GLM / Cox model or a model average.

Usage

plotCurveEstimate(samples, termName, plevel = 0.95, slevel = plevel,
  plot = TRUE, rug = FALSE, addZeros = FALSE, ...)

Arguments

samples

an object of class '>GlmBayesMfpSamples, produced by sampleGlm and sampleBma.

termName

string denoting an FP term, as written by the as.data.frame method

plevel

credible level for pointwise HPD, and NULL means no pointwise HPD (default: 0.95). The pointwise intervals are plotted in blue color.

slevel

credible level for simultaneous credible band (SCB), NULL means no SCB (defaults to plevel). The simultaneous intervals are plotted in green color.

plot

if FALSE, only return values needed to produce the plot, but do not plot (default is TRUE, so a plot is made)

rug

add a rug to the plot? (default: FALSE)

addZeros

include zero samples for models where the covariate is not included? (default: FALSE) If TRUE, this changes the interpretation of the samples, and therefore curve estimates based on these samples: it is no longer conditional on inclusion of the covariate, but marginally over all models, also those not including the covariate.

further arguments for plotting with matplot

Value

a list of various plotting information:

original

grid on the original covariate scale

grid

grid on the transformed scale

mean

pointwise mean curve values

plower

lower boundaries for pointwise HPD

pupper

upper boundaries for pointwise HPD

slower

lower boundaries for SCB

supper

upper boundaries for SCB

obsVals

observed values of the covariate on the original scale

partialResids

not implemented: partial residuals

transform

vector of shift and scale parameter