rologit: Fit RO-logit model and obtain heuristic residuals

Description Usage Arguments Value References Examples

View source: R/ROlogit.R

Description

Fit RO-logit model and obtain heuristic residuals

Usage

1
2
rologit(yvar, evar, cfdr = NULL, emod = NULL, svar, dat, method = "efron",
  initial.res.par = c(0, 0), plot = TRUE, ...)

Arguments

yvar

string. Name of outcome variable.

evar

string (or vector of strings). Name of exposure(s).

cfdr

string (or vector of strings). Names of confounder(s). Default is NULL.

emod

string (or vector of strings). Name of effect modifier(s). Default is NULL.

svar

string. Name of stratum variable. Use NULL to fit model without stratification.

dat

data.frame. Contains all the variables needed for the analysis.

method

string. Use Efron ("efron") or Breslow ("breslow") method for handling ties in the outcome. The default is "efron". See coxph for details.

initial.res.par

The initial values of the intercept and log(scale), to be passed to the optim function. The default values are set to c(0, 0), yet users are recommended to try a few initial values to make sure global optimum is reached.

plot

logic. To plot the Q-Q plot for the heuristic residuals. Default is TRUE.

...

Other parameters to be passed to the optim function for the second stage analysis.

Value

Returns a list containing obj (the RO-Logit model fitted using coxph), hresid (the vector of heuristic residuals), logscale (log of scale parameter of the heuristic residuals), and coefficients (a data.frame with estimated coefficients before and after scaling).

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Fit an RO-logit model to determine whether the glycaemic control of
# patients differs between medical and surgical wards.
data(inpat_bg)
# Divide patients into strata based on age, gender, duration of monitoring
# episodes, and frequency of daily BG measurements.
inpat_bg$group <- paste(inpat_bg$age_group, inpat_bg$sex, inpat_bg$los_group,
                        inpat_bg$bg_freq_group, sep = "|")
# Fit an RO-logit model with mean BG reading as the outcome and ward as the
# exposure:
obj <- rologit(yvar = "bg_mean", evar = "ward", svar = "group",
               dat = inpat_bg, initial.res.par = c(2, 2))
summary(obj)

ROlogit documentation built on March 19, 2018, 9:03 a.m.