Density (dheft), cumulative probability (pheft), hazard rate (hheft), quantiles (qheft), and random samples (rheft) from a heft object

dheft(q, fit) 
hheft(q, fit) 
pheft(q, fit) 
qheft(p, fit) 
rheft(n, fit)

Arguments

q

vector of quantiles. Missing values (NAs) are allowed.

p

vector of probabilities. Missing values (NAs) are allowed.

n

sample size. If length(n) is larger than 1, then length(n) random values are returned.

fit

heft object, typically obtained from heft.

Value

Densities (dheft), hazard rates (hheft), probabilities (pheft), quantiles (qheft), or a random sample (rheft) from a heft object.

Details

Elements of q or p that are missing will cause the corresponding elements of the result to be missing.

References

Charles Kooperberg, Charles J. Stone and Young K. Truong (1995). Hazard regression. Journal of the American Statistical Association, 90, 78-94.

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.

Author

Charles Kooperberg clk@fredhutch.org.

Examples

fit <- heft(testhare[,1],testhare[,2])
dheft(0:10,fit)
#>  [1] 0.00000000 0.11950647 0.13341915 0.08061400 0.04657502 0.03742625
#>  [7] 0.03376190 0.03045046 0.02745516 0.02479511 0.02245161
hheft(0:10,fit)
#>  [1] 0.00000000 0.12882896 0.16789413 0.11758136 0.07449399 0.06406334
#>  [7] 0.06153308 0.05894438 0.05629845 0.05371861 0.05126222
pheft(0:10,fit)
#>  [1] 0.00000000 0.07236336 0.20533766 0.31439809 0.37478149 0.41579301
#>  [7] 0.45132115 0.48340360 0.51232840 0.53842604 0.56202427
qheft((1:19)/20,fit)
#>  [1]   0.8031157   1.2216213   1.5946184   1.9601485   2.3522512   2.8311603
#>  [7]   3.5203602   4.5900333   5.9750102   7.5837148   9.5526890  11.9731408
#> [13]  15.1415017  19.0423923  25.3238716  33.0818519  49.3013025  79.9747980
#> [19] 175.0957234
rheft(10,fit)
#>  [1]  1.6986147 15.0039141 12.0364470  7.3514926 18.2108673  0.8732252
#>  [7]  8.7173741  3.7435900 34.6085182 23.0530117