Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.logspline

Logspline Density Estimation


Description

Plots a logspline density, distribution function, hazard function or survival function from a logspline density that was fitted using the 1997 knot addition and deletion algorithm (logspline). The 1992 algorithm is available using the oldlogspline function.

Usage

## S3 method for class 'logspline'
plot(x, n = 100, what = "d", add = FALSE, xlim, xlab = "",
ylab = "", type = "l", ...)

Arguments

x

logspline object, typically the result of logspline.

n

the number of equally spaced points at which to plot the density.

what

what should be plotted: "d" (density), "p" (distribution function), "s" (survival function) or "h" (hazard function).

add

should the plot be added to an existing plot.

xlim

range of data on which to plot. Default is from the 1th to the 99th percentile of the density, extended by 10% on each end.

xlab,ylab

labels plotted on the axes.

type

type of plot.

...

other plotting options, as desired

Details

This function produces a plot of a logspline fit at n equally spaced points roughly covering the support of the density. (Use xlim = c(from, to) to change the range of these points.)

Author(s)

Charles Kooperberg clk@fredhutch.org.

References

Charles Kooperberg and Charles J. Stone. Logspline density estimation for censored data (1992). Journal of Computational and Graphical Statistics, 1, 301–328.

Charles J. Stone, Mark Hansen, Charles Kooperberg, and Young K. Truong. The use of polynomial splines and their tensor products in extended linear modeling (with discussion) (1997). Annals of Statistics, 25, 1371–1470.

See Also

Examples

y <- rnorm(100)
fit <- logspline(y)       
plot(fit)

polspline

Polynomial Spline Routines

v1.1.19
GPL (>= 2)
Authors
Charles Kooperberg [aut, cre], Cleve Moler [ctb] (LINPACK routines in src), Jack Dongarra [ctb] (LINPACK routines in src)
Initial release
2020-05-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.