Skip to contents

estimate inverse probability weights based on Beesley & Mukhherjee

Usage

ipw(
  stacked_data,
  weight_outcome_var = "WTFA_A",
  samp_var = "samp_WTFA_A",
  external_dataset = "NHIS",
  dataset_name = "MGI",
  id_var = "id",
  cancer_factor = FALSE,
  cancer_factor_var = "cancer",
  covs = c("age_50", "female", "nhw", "hypertension", "diabetes", "cancer", "anxiety",
    "depression", "bmi_cat"),
  chop = TRUE
)

Arguments

stacked_data

data.table of stacked data

weight_outcome_var

variable name of sampling weights in external dataset

samp_var

variable name of sampling weights in internal dataset

external_dataset

name of external dataset

dataset_name

name of internal dataset

id_var

variable name of id

cancer_factor

logical, whether to include cancer factor

cancer_factor_var

variable name of cancer factor

covs

vector of covariates to include in model

chop

logical, whether to chop weights

Value

return table of id and inverse probability weights