Skip to contents

Estimate a constant effect size for matched and weighted data set using parametric models

Usage

estimate_pmetric_erf(formula, family, data, ...)

Arguments

formula

a vector of outcome variable in matched set.

family

a description of the error distribution (see ?gnm)

data

dataset that formula is build upon (Note that there should be a counter_weight column in this data.)

...

Additional parameters for further fine tuning the gnm model.

Value

returns an object of class gnm

Details

This method uses generalized nonlinear model (gnm) from gnm package.

Examples

# \donttest{
m_d <- generate_syn_data(sample_size = 100)
pseudo_pop <- generate_pseudo_pop(m_d[, c("id", "w")],
                                  m_d[, c("id", "cf1","cf2","cf3",
                                          "cf4","cf5","cf6")],
                                  ci_appr = "matching",
                                  sl_lib = c("m_xgboost"),
                                  params = list(xgb_nrounds=c(10,20,30),
                                  xgb_eta=c(0.1,0.2,0.3)),
                                  nthread = 1,
                                  covar_bl_method = "absolute",
                                  covar_bl_trs = 0.1,
                                  covar_bl_trs_type= "mean",
                                  max_attempt = 1,
                                  dist_measure = "l1",
                                  delta_n = 1,
                                  scale = 0.5)
#> mean absolute correlation: 0.190532732398494| Covariate balance threshold: 0.1
#> mean absolute correlation: 0.149674153889077| Covariate balance threshold: 0.1
#> Covariate balance condition has not been met.
#> Best mean absolute correlation: 0.149674153889077| Covariate balance threshold: 0.1
data <- merge(m_d[, c("id", "Y")], pseudo_pop$pseudo_pop, by = "id")
outcome_m <- estimate_pmetric_erf(formula = Y ~ w,
                                  family = gaussian,
                                  data = data)
# }