View source: R/weighting_functions.R
ipsw.lg | R Documentation |
This function computes IPSW pseudo-weights using logistic regression to predict propensity scores.
ipsw.lg(psa_dat, wt, rsp_name, formula)
psa_dat |
Dataframe of the combined non-probability and probability sample |
wt |
Name of the weight variable in |
rsp_name |
Name of the non-probability sample membership indicator in |
formula |
Formula of the regression model |
A vector of IPSW pseudo-weights
# IPSW with example data ipsw_w <- ipsw.lg(simu_dat, "wt", "trt", "trt_f ~ x1+x2+x3+x4+x5+x6+x7") # Compute weighted mean of y in non-prob data sum((simu_dat$y[simu_dat$trt == 1]*ipsw_w)/sum(ipsw_w))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.