compute_sim_result: compute_sim_result

Description Usage Arguments Value

View source: R/compute_sim_result.R

Description

Takes in functions to generate simulation data, and computes simulation results for our method vs. Mahalanobis and propensity score matching.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
compute_sim_result(
  x_generator = default_x_generator,
  treat_prob_generator,
  mean_generator,
  error_generator = default_error_generator,
  n_sink_gen = n_sink_generator(),
  match_method = "with_replacement",
  n_rows = 500L,
  n_cols = 5L,
  num_weight_vectors = 100L,
  silent = !interactive()
)

Arguments

x_generator

Function that takes number of rows and columns and produces a data matrix of that dimension.

treat_prob_generator

Function that takes a matrix and produces treatment probabilities.

mean_generator

Function that takes a matrix and produces an expected value for each row.

error_generator

Function that accepts a number of rows and generates an error vector (e.g. normal noise).

n_sink_gen

Default n_sink_generator. This argument should be a function that accepts a treat_vec and produces a vector of sink numbers.

match_method

"with_replacement", "optimal", or "greedy"

n_rows

How many rows to generate.

n_cols

How many columns to use.

num_weight_vectors

How many weight vectors to generate.

silent

Whether to suppress messages as it's running.. Default !interactive().

Value

Returns a named list:

naive_est

Mean difference between all treated units and all control

propensity_results

List of lists: each with n_sinks and the est

mahal_results

Same as above

weighted_results

List of lists: each with n_sinks, the raw brier score, the permutation brier score, and the est


rzgross/uRbanmatching documentation built on Dec. 22, 2021, 8:20 p.m.