get_estimates {CIEE} | R Documentation |
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.
get_estimates(setting = "GLM", Y = NULL, X = NULL, K = NULL, L = NULL, C = NULL)
setting |
String with value |
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). |
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.
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.
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)