covarGEE: GEE Covariance Of All Events For Competing Risks

View source: R/DiscSurvEstimationCR.R

covarGEER Documentation

GEE Covariance Of All Events For Competing Risks

Description

Estimates covariance of estimated parameters of all competing events generalized estimation equation models using sandwich approach.

Usage

covarGEE(modelEst, printProgess = FALSE)

Arguments

modelEst

Discrete time competing risks GEE model prediction model (class "dCRGEE").

printProgess

Should progress status be printed during estimation (class "logical")? Default is FALSE.

Value

Returns symmetric matrix of rows and columns dimension "number of competing risks" * "number of regression parameters" ("numeric matrix").

Author(s)

Thomas Welchowski t.welchowski@psychologie.uzh.ch

References

\insertRef

minjungDiscCompdiscSurv

See Also

estCompRisksGEE, dataLongCompRisks, dataLongCompRisksTimeDep, geeglm

Examples


# Example with unemployment data
library(Ecdat)
data(UnempDur)

# Select subsample
SubUnempDur <- UnempDur [1:100, ]

# Estimate GEE models for all events
estGEE <- estCompRisksGEE(dataShort = SubUnempDur, dataTransform = "dataLongCompRisks", 
corstr = "independence", formulaVariable =~ timeInt + age + ui + logwage * ui, 
eventColumns = c("censor1", "censor2"), timeColumn = "spell")

## Not run: 
# Estimate covariance matrix of estimated parameters and competing events
estCovar <- covarGEE(modelEst=estGEE)
estCovar

# Covariances of estimated parameters of one event equal the diagonal blocks
lengthParameters <- length(estGEE[[1]]$coefficients)
noCompEvents <- length(estGEE)
meanAbsError <- rep(NA, noCompEvents)
for( k in 1:noCompEvents ){
  
  relInd <- (1 + (k-1) * lengthParameters) : (k * lengthParameters)
  meanAbsError[k] <- mean(abs(estCovar[relInd, relInd] - estGEE[[k]]$robust.variance))
  
}
mean(meanAbsError) 
# -> Covariance estimates within each event are equal to diagonal blocks in 
# complete covariance matrix with very small differences due to numerical accuracy.

## End(Not run)


discSurv documentation built on April 29, 2026, 9:07 a.m.