Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_estimates

CIEE parameter point estimates


Description

Function to perform CIEE to obtain point estimates under the GLM or AFT setting for the analysis of a normally-distributed or censored time-to-event primary outcome.

Usage

get_estimates(setting = "GLM", Y = NULL, X = NULL, K = NULL, L = NULL,
  C = NULL)

Arguments

setting

String with value "GLM" or "AFT" indicating whether CIEE point estimates are obtained for a normally-distributed ("GLM") or censored time-to-event ("AFT") primary outcome Y.

Y

Numeric input vector for the primary outcome.

X

Numeric input vector for the exposure variable.

K

Numeric input vector for the intermediate outcome.

L

Numeric input vector for the observed confounding factor.

C

Numeric input vector for the censoring indicator under the AFT setting (must be coded 0 = censored, 1 = uncensored).

Details

Under the GLM setting for the analysis of a normally-distributed primary outcome Y, estimates of the parameters α0, α1, α2, α3, σ1^2, α4, αXY, σ2^2 are obtained by constructing estimating equations for the models

Y = α0 + α1*K + α2*X + α3*L + ε1, ε1 ~ N(0,σ1^2)

Y* = Y - mean(Y) - α1*(K-mean(K))

Y* = α0 + αXY*X + ε2, ε2 ~ N(0,σ2^2).

Under the AFT setting for the analysis of a censored time-to-event primary outcome, estimates of the parameters α0, α1, α2, α3, σ1, α4, αXY, σ2^2 are obtained by constructing similar estimating equations based on a censored regression model and adding an additional computation to estimate the true underlying survival times. In addition to the parameter estimates, the mean of the estimated true survival times is computed and returned in the output. For more details and the underlying model, see the vignette.

For both settings, the point estimates based on estimating equations equal least squares (and maximum likelihood) estimates, and are obtained using the lm and survreg functions for computational purposes.

Value

Returns a list with point estimates of the parameters. Under the AFT setting, the mean of the estimated true survival times is also computed and returned.

Examples

dat_GLM <- generate_data(setting = "GLM")
get_estimates(setting = "GLM", Y = dat_GLM$Y, X = dat_GLM$X, K = dat_GLM$K,
              L = dat_GLM$L)

dat_AFT <- generate_data(setting = "AFT", a = 0.2, b = 4.75)
get_estimates(setting = "AFT", Y = dat_AFT$Y, X = dat_AFT$X, K = dat_AFT$K,
              L = dat_AFT$L, C = dat_AFT$C)

CIEE

Estimating and Testing Direct Effects in Directed Acyclic Graphs using Estimating Equations

v0.1.1
GPL-2
Authors
Stefan Konigorski [aut, cre], Yildiz E. Yilmaz [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.