Skip to contents

Helper: function to run a weighted binary analysis using svyglm unless there's a separation concern, then run weighted logsitf

Usage

weighted_analysis(
  data,
  design,
  outcome,
  exposure,
  covariates,
  method = "svyglm",
  logistf_pl = FALSE,
  weight_var = NULL
)

Arguments

data

data frame

design

survey design object

outcome

name of outcome variable

exposure

name of exposure variable

covariates

vector of covariate names

method

method to use for analysis

logistf_pl

whether to use profile likelihood in logistf

weight_var

name of weight variable

Value

list of results from model for the exposure