Description Usage Arguments Value Note Examples
View source: R/compile_pseudo_pop.R
Compiles pseudo population based on the original population and estimated GPS value.
1 2 3 4 5 6 7 8 9 10 | compile_pseudo_pop(
dataset,
ci_appr,
gps_model = "parametric",
bin_seq = NULL,
nthread = 1,
trim_quantiles,
optimized_compile,
...
)
|
dataset |
List of size 6 including the following:
|
ci_appr |
Causal inference approach. |
gps_model |
Model type which is used for estimating GPS value, including parametric and non-parametric. |
bin_seq |
Sequence of w (treatment) to generate pseudo population. If
NULL is passed the default value will be used, which is
|
nthread |
An integer value that represents the number of threads to be used by internal packages. |
trim_quantiles |
A numerical vector of two. Represents the trim quantile level. Both numbers should be in the range of [0,1] and in increasing order (default: c(0.01,0.99)). |
optimized_compile |
If TRUE, uses counts to keep track of number of replicated pseudo population. |
... |
Additional parameters. |
compile_pseudo_pop
returns the pseudo population data that is compiled based
on the selected causal inference approach.
The input data set should be output of estimate_gps function with internal_use flag activated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | m_d <- generate_syn_data(sample_size = 100)
data_with_gps <- estimate_gps(m_d$Y,
m_d$treat,
m_d[c("cf1","cf2","cf3","cf4","cf5","cf6")],
pred_model = "sl",
gps_model = "parametric",
internal_use = TRUE,
params = list(xgb_max_depth = c(3,4,5),
xgb_nrounds=c(10,20,30,40,50,60)),
nthread = 1,
sl_lib = c("m_xgboost")
)
pd <- compile_pseudo_pop(dataset = data_with_gps,
ci_appr = "matching",
gps_model = "parametric",
bin_seq = NULL,
nthread = 1,
trim_quantiles = c(0.01, 0.99),
optimized_compile=TRUE,
matching_fun = "matching_l1",
covar_bl_method = 'absolute',
covar_bl_trs = 0.1,
covar_bl_trs_type= "mean",
delta_n = 0.5,
scale = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.