Learn R Programming

SurvRegCensCov (version 1.1)

ParamSampleCens: Maximum Likelihood Estimator of parameters from a censored sample

Description

Computes maximum likelihood estimators of the canonical parameters for several distributions, based on a censored sample.

Usage

ParamSampleCens(censdata, dist = c("normal", "logistic", "gamma", "weibull")[1], 
     null.values = c(0, 1), conf.level = 0.95, initial = NULL)

Arguments

censdata
A dataframe of two columns, describing each observed value as an interval. The left column contains either NA for left censored observations, the left bound of the interval for interval censored observations, or the observed value for non-cen
dist
Assumed distribution of the sample.
null.values
Fixed values for hypothesis tests.
conf.level
Confidence level of confidence intervals.
initial
Initial values for the maximization.

Value

  • coeffEstimators, standard errors, confidence intervals, and 2-sided $p$-values for the null hypothesis as given in null.values. All this inference is based on maximum likelihood theory, i.e. standard errors are computed using the inverse expected Hessian at the maximum likelihood estimator.
  • percent.censPercentage of censored observations.
  • loglikLog likelihood function value at the estimator.
  • info.convergConvergence information provided by the function optim.
  • info.converg.messageMessage provided by the function optim.

References

Hubeaux, S. (2013). Estimation from left- and/or interval-censored samples. Technical report, Biostatistics Oncology, F. Hoffmann-La Roche Ltd. Lynn, H. S. (2001). Maximum likelihood inference for left-censored HIV RNA data. Stat. Med., 20, 33--45.

Examples

Run this code
n <- 500
prop.cens <- 0.35

## example with a left-censored Normally distributed sample
set.seed(2013)
mu <- 3.5
sigma <- 1
x <- rnorm(n, mean = mu, sd = sigma)
LOD <- qnorm(prop.cens, mean = mu, sd = sigma)
x[x <= LOD] <- LOD
index.noncens <- which(x > LOD)
left <- rep(NA, n)
left[index.noncens] <- x[index.noncens]
s1 <- cbind(left, x)

ParamSampleCens(censdata = s1)


## example with an interval-censored Normal sample
set.seed(2013)
x <- rnorm(n, mean = mu, sd = sigma)
min.value <- min(x)
LOD <- qnorm(0.35, mean = mu, sd = sigma)
x[x <= LOD] <- LOD
index.noncens <- which(x > LOD)
left <- rep(NA, n)
left[index.noncens] <- x[index.noncens]

index.cens <- which(x <= LOD)
index.interval <- index.cens[index.cens >= 250]
left[index.interval] <- min.value
s2 <- cbind(left, x)

ParamSampleCens(censdata = s2)

## compare to fitdistrplus
library(fitdistrplus)
s2 <- as.data.frame(s2)
colnames(s2) <- c("left", "right")
summary(fitdistcens(censdata = s2, distr = "norm"))

Run the code above in your browser using DataLab