View source: R/plot.stepmented.r
plot.stepmented | R Documentation |
Takes a fitted stepmented
object returned by stepmented()
and plots (or adds)
the fitted piecewise constant lines for the selected stepmented term.
## S3 method for class 'stepmented'
plot(x, term, add = FALSE, res = TRUE, conf.level=0, interc = TRUE, add.fx = FALSE,
psi.lines = TRUE, link=TRUE, const=NULL, res.col=grey(.15, alpha = .4),
surf=FALSE, zero.cor=TRUE, heurs=TRUE, shade=FALSE, se.type=c("cdf","abs","none"),
k=NULL, .vcov=NULL, leg="topleft", ...)
x |
a fitted |
term |
the stepmented variable having the piece-wise constant relationship to be plotted.
If there is a single stepmented variable in the fitted model |
add |
when |
res |
when |
conf.level |
the confidence level for the pointwise confidence intervals for the expected values. |
interc |
if |
add.fx |
logical. If TRUE and the object fit also includes an additional term for the same stepmented variable, the plot also portrays such ‘additional’ term. |
psi.lines |
if |
link |
if |
const |
constant to add to each fitted segmented relationship (on the scale of the linear predictor) before plotting.
If |
res.col |
when |
surf |
if the object fit |
zero.cor |
see |
heurs |
logical; if |
shade |
if |
se.type |
which standard errors should be computed? see |
k |
The value to be passed to |
.vcov |
The estimate var-covariance matrix; if |
leg |
If the plot refers to stepmented relationships in groups, i.e. |
... |
other graphics parameters to pass to plotting commands: ‘col’, ‘lwd’ and ‘lty’ (that
can be vectors and are recycled if necessary, see the example below) for the fitted piecewise constant lines; ‘ylab’, ‘xlab’, ‘main’, ‘sub’, ‘cex.axis’, ‘cex.lab’, ‘xlim’ and ‘ylim’ when a new plot is produced (i.e. when |
Produces (or adds to the current device) the fitted step-function like relationship between the
response and the selected term
. If the fitted model includes just a single ‘stepmented’ variable,
term
may be omitted. If surf=TRUE
, and res=TRUE
the point widths are proportional to the partial residual values.
None.
Implementation of confidence intervals for the conditional means in stepmented regression is under development; conf.level>0
should be used with care, especially with multiple jumpoints.
Vito M. R. Muggeo
See Also as stepmented
#Following code in stepmented..
## Not run:
par(mfrow=c(1,3))
plot(os,"x")
plot(os,"z")
plot(os,"z", add.fx=TRUE, psi.lines=FALSE )
lines(os, "z")
#display the 'surface'
par(mfrow=c(1,3))
plot(os, surf=TRUE, col=1, res.col=2)
plot(os, surf=TRUE, lty=2)
plot(x,z)
plot(os, surf=TRUE, add=TRUE, col=4, res=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.