Description Usage Arguments Details Value Examples
View source: R/se_estimates_naive.R
Function to obtain naive standard error estimates for the parameter
estimates of the get_estimates
function, under the GLM or AFT
setting for the analysis of a normally-distributed or censored time-to-event
primary outcome.
1 2 |
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, naive standard error estimates are obtained for the estimates of the parameters α0, α1, α2, α3, α4, αXY in 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),
using the lm
function, without accounting for the
additional variability due to the 2-stage approach.
Under the AFT setting for the analysis of a censored time-to-event primary
outcome, bootstrap standard error estimates are similarly obtained of the
parameter estimates of
α0, α1, α2, α3, α4, αXY
from the output of the survreg
and
lm
functions.
Returns a vector with the naive standard error estimates of the parameter estimates.
1 2 | dat <- generate_data(setting = "GLM")
naive_se(setting = "GLM", Y = dat$Y, X = dat$X, K = dat$K, L = dat$L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.