Learn R Programming

groupedSurv (version 1.0.5.1)

thetaEst: Estimate the Baseline Survival Rates and Covariate Parameters for the Grouped Survival Model

Description

A method to estimate the baseline survival rate for each time interval and the covariate nuisance parameters for a grouped survival model. The estimation is conducted under the null hypothesis, i.e., that there is no effect from the variable of interest.

Usage

thetaEst(Z=NULL, gtime, delta, method="BFGS")

Value

A list containing two vectors: alpha, the baseline survival rate for each time interval, and theta, the estimated nuisance parameters of the covariates.

Arguments

Z

Optional data.frame or matrix of numeric covariate values for each sample.

gtime

Vector of observed survival times for each sample.

delta

Vector of event indicators for each sample: 1 indicates observed event, 0 indicates censored.

method

String indicating optimization method, passed to stats::optim. Supports "BFGS" and "CG". Default is "BFGS".

Examples

Run this code
# Generate dummy data	
cov1  <- c(1, 2, 2, 2, 1, 1, 0, 1, 1)
cov2  <- c(2, 2, 1, 0, 1, 0, 1, 1, 0.5) 
Z     <- cbind(cov1, cov2)
gtime <- c(1, 3, 3, 2, 1, 1, 2, 3, 1)
delta <- c(1, 0, 1, 1, 1, 0, 1, 0, 1)

#res   <- thetaEst(Z, gtime, delta) 
#res

Run the code above in your browser using DataLab