traditional_regression_functions {CIEE}R Documentation

Traditional regression approaches.

Description

Functions to fit traditional regression approaches for a quantitative normally-distributed primary outcome (setting = "GLM") and a censoredtime-to-event primary outcome (setting = "AFT"). mult_reg fits the multiple regression approach and res_reg computes the regression of residuals approach.

Usage

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

res_reg(Y = NULL, X = NULL, K = NULL, L = NULL)

Arguments

setting

String with value "GLM" or "AFT" indicating whether the approaches are fitted for a normally-distributed primary outcome Y ("GLM") or a censored time-to-event primary outcome Y ("AFT"). Under the "AFT" setting, only mult_reg is available.

Y

Numeric input vector of the primary outcome.

X

Numeric input vector of the exposure variable.

K

Numeric input vector of the intermediate outcome.

L

Numeric input vector of the observed confounding factor.

C

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

Details

In more detail, for a quantitative normally-distributed primary outcome Y, mult_reg fits the model

Y = \alpha_0 + \alpha_1 \cdot K + \alpha_{XY} \cdot X + \alpha_2 \cdot L + \epsilon

and obtains point and standard error estimates for the parameters \alpha_0, \alpha_1, \alpha_{XY}, \alpha_2. res_reg obtains point and standard error estimates for the parameters \alpha_0, \alpha_1, \alpha_2, \alpha_3, \alpha_{XY} by fitting the models

Y = \alpha_0 + \alpha_1 \cdot K + \alpha_2 \cdot L + \epsilon_1

\widehat{\epsilon}_1 = \alpha_3 + \alpha_{XY} \cdot X + \epsilon_2

Both functions use the lm function and also report the provided p-values from t-tests that each parameter equals 0. For the analysis of a censored time-to-event primary outcome Y, only the multiple regression approach is implemented. Here, mult_reg fits the according censored regression model to obtain coefficient and standard error estimates as well as p-values from large-sample Wald-type tests by using the survreg function. See the vignette for more details.

Value

Returns a list with point estimates of the parameters point_estimates, standard error estimates SE_estimates and p-values pvalues.

Examples


dat_GLM <- generate_data(setting = "GLM")
mult_reg(setting = "GLM", Y = dat_GLM$Y, X = dat_GLM$X, K = dat_GLM$K,
         L = dat_GLM$L)
res_reg(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)
mult_reg(setting = "AFT", Y = dat_AFT$Y, X = dat_AFT$X, K = dat_AFT$K,
         L = dat_AFT$L, C = dat_AFT$C)


[Package CIEE version 0.1.1 Index]