varEstFam: Estimate the Frailty Variance for the Frailty Model

View source: R/varEstFam.R

varEstFamR Documentation

Estimate the Frailty Variance for the Frailty Model

Description

A method to estimate the frailty variance for a frailty model accounting for family structure of related individuals (e.g., trios). The input data is assumed to be organized such that records for each family occur consecutively, and that records for offspring precede those for parents. The variance matrix for the random effects is assumed to be of the form var*K, where K is a matrix of kinship coefficients between family members. The following groupings are permitted: (Individual), (Offspring, Offspring), (Offspring, Parent), (Offspring, Parent, Parent), and (Offspring, Offspring, Parent, Parent). Other family structures have not been implemented.

Usage

  varEstFam(x, fam_group, fam_role, alpha, gtime, delta, lower, upper, beta=0)  	

Arguments

x

Vector of numeric variables of interest for each sample.

fam_group

Vector of family IDs for each sample.

fam_role

Vector of indicators for the role within a family of each sample, i.e., {"Offspring","Mother","Father"}, or {"o","m","f"}.

alpha

Vector of baseline survival rates for each time interval.

gtime

Vector of observed survival times for each sample.

delta

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

lower

Scalar for the lower bound of the variance estimation search region.

upper

Scalar for the upper bound of the variance estimation search region.

beta

Scalar for the fixed effect size. Default is 0.

Value

Scalar estimate of the frailty variance.

Examples

# Generate dummy data	
x     <- c(0, 1, 1, 1, 2, 2, 0, 0, 0)
fam_group <- c('1', '1', '1', '2', '2', '2', '3', '3', '3')
fam_role  <- c("o","f","m","o","f","m","o","f","m")
alpha <- c(0.7500000, 0.6666667, 0.5000000, 0.0000000)
gtime <- c(1, 3, 3, 2, 1, 1, 2, 3, 1)
delta <- c(1, 0, 1, 1, 1, 0, 1, 0, 1)
lower <- 0
upper <- 2
beta  <- 1

#res   <- varEstFam(x, fam_group, fam_role, alpha, gtime, delta, lower, upper, beta) 
#res

groupedSurv documentation built on Sept. 29, 2023, 1:06 a.m.