icsurv2cdf | R Documentation |
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.
icsurv2cdf(fit)
fit |
an object of class |
A data.frame
with columns labeled time
and cdf
.
Arnošt Komárek arnost.komarek@mff.cuni.cz
EM
,
PGM
,
VEM
,
ISDM
,
EMICM
.
### 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.