icsurv2cdf {icensBKL} | R Documentation |
Conversion of icsurv objects in a data.frame
Description
Convert an object of class icsurv
(created by several functions
of the package Icens
to a two-column data.frame
that can
be easily used to plot the fitted distribution function.
Usage
icsurv2cdf(fit)
Arguments
fit |
an object of class |
Value
A data.frame
with columns labeled time
and cdf
.
Author(s)
Arnošt Komárek arnost.komarek@mff.cuni.cz
See Also
Examples
### Distribution function of the emergence of tooth 44 on boys
### (this example: only a subset of boys)
data("tandmob", package="icensBKL")
Boys <- subset(tandmob, fGENDER=="boy")
Sboy <- Surv(Boys$L44, Boys$R44, type="interval2")
Aboy <- subset(Boys, select=c("L44", "R44"))
Aboy$L44[is.na(Aboy$L44)] <- 0
Aboy$R44[is.na(Aboy$R44)] <- 20 ## 20 = infinity in this case
fitB.NPMLE <- EMICM(Aboy)
print(fitB.NPMLE)
plot(fitB.NPMLE)
fitB.NPMLE <- icsurv2cdf(fitB.NPMLE)
print(fitB.NPMLE)
plot(fitB.NPMLE$time, fitB.NPMLE$cdf, type="l", xlim=c(6, 13), ylim=c(0, 1),
xlab="Age (years)", ylab="Proportion emerged")
[Package icensBKL version 1.5 Index]