Description Usage Arguments Value Author(s) References See Also Examples

Fits a `logspline`

density using splines to approximate the log-density
using
the 1992 knot deletion algorithm (`oldlogspline`

).
The 1997 algorithm using knot
deletion and addition is available using the `logspline`

function.

1 2 | ```
oldlogspline(uncensored, right, left, interval, lbound,
ubound, nknots, knots, penalty, delete = TRUE)
``` |

`uncensored` |
vector of uncensored observations from the distribution whose density is
to be estimated. If there are no uncensored observations, this argument can
be omitted. However, either |

`right` |
vector of right censored observations from the distribution whose density is to be estimated. If there are no right censored observations, this argument can be omitted. |

`left` |
vector of left censored observations from the distribution whose density is to be estimated. If there are no left censored observations, this argument can be omitted. |

`interval` |
two column matrix of lower and upper bounds of observations that are interval censored from the distribution whose density is to be estimated. If there are no interval censored observations, this argument can be omitted. |

`lbound,ubound` |
lower/upper bound for the support of the density. For example, if there
is a priori knowledge that the density equals zero to the left of 0,
and has a discontinuity at 0,
the user could specify |

`nknots` |
forces the method to start with nknots knots ( |

`knots` |
ordered vector of values (that should cover the complete range of the
observations), which forces the method to start with these knots ( |

`penalty` |
the parameter to be used in the AIC criterion. The method chooses
the number of knots that minimizes |

`delete` |
should stepwise knot deletion be employed? |

Object of the class `oldlogspline`

, that is intended as input for
`plot.oldlogspline`

,
`summary.oldlogspline`

,
`doldlogspline`

(densities),
`poldlogspline`

(probabilities),

`qoldlogspline`

(quantiles),
`roldlogspline`

(random numbers from the fitted distribution).
The function `oldlogspline.to.logspline`

can translate an object of the class
`oldlogspline`

to an object of the class `logspline`

.

The object has the following members:

`call` |
the command that was executed. |

`knots ` |
vector of the locations of the knots in the |

`coef` |
coefficients of the spline. The first coefficient is the constant term,
the second is the linear term and the k-th |

`bound` |
first element: 0 - |

`logl` |
the |

`penalty` |
the penalty that was used. |

`sample` |
the sample size that was used. |

`delete` |
was stepwise knot deletion employed? |

Charles Kooperberg clk@fredhutch.org.

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.

`logspline`

,
`oldlogspline`

,
`plot.oldlogspline`

,
`summary.oldlogspline`

,

`doldlogspline`

,
`poldlogspline`

,
`qoldlogspline`

,
`roldlogspline`

,
`oldlogspline.to.logspline`

.

1 2 3 4 5 6 7 8 9 10 | ```
# A simple example
y <- rnorm(100)
fit <- oldlogspline(y)
plot(fit)
# An example involving censoring and a lower bound
y <- rlnorm(1000)
censoring <- rexp(1000) * 4
delta <- 1 * (y <= censoring)
y[delta == 0] <- censoring[delta == 0]
fit <- oldlogspline(y[delta == 1], y[delta == 0], lbound = 0)
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.