estimates: Estimate exposure-specific causal effects.

Description Usage Arguments Details Value Functions References Examples

View source: R/estimates.R

Description

Estimate exposure-specific causal effects and their variance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
estimates(
  obs_exposure,
  obs_outcome,
  obs_prob_exposure,
  n_var_permutations = 10,
  effect_estimators = c("hajek", "horvitz-thompson"),
  variance_estimators = c("hajek", "horvitz-thompson"),
  control_condition = NULL,
  treated_conditions = NULL
)

estimators_full_neighborhood(
  obs_exposure,
  obs_outcome,
  obs_prob_exposure,
  n_var_permutations = 10
)

Arguments

obs_exposure

an N* K named numeric matrix of indicators for whether units N are in exposure condition k, where K is the total number of exposure conditions and names correspond to the exposure conditions. Such matrix is returned by function make_exposure_map_AS.

obs_outcome

a vector length N of outcome data.

obs_prob_exposure

a list of 3 lists containing exposure probabilities:

I_exposure:

A list of K N * R numeric matrices of indicators for whether units N are in exposure condition k over each of the possible R treatment assignment vectors. The number of numeric matrices K corresponds to the number of exposure conditions.

prob_exposure_k_k:

A list of K symmetric N * N numeric matrices each containing individual exposure probabilities to condition k on the diagonal, and joint exposure probabilities to condition k on the off-diagonals.

prob_exposure_k_l:

A list of permutation(K,2) nonsymmetric N * N numeric matrices each containing joint probabilities across exposure conditions k and l on the off-diagonal, and zeroes on the diagonal. When K = 4, the number of numeric matrices is 12; permutation(4,2).

Such list is returned by function make_exposure_prob.

n_var_permutations

if 'constant_effect' (derived in Aronow (2013)) is one of the variance estimators specified, the number of treatment permutations used to estimate this estimator. Default is 10, but must be smaller or equal to R, the number of permutations to compute exposure probabilities. Recommended is 1000, when R > 1000.

effect_estimators

string vector with names of estimators to be estimated among 'hajek', 'horvitz-thompson'. Default is both.

variance_estimators

string vector with names of variance estimators to be estimated among 'hajek', 'horvitz-thompson', 'constant_effect', 'max_ht_const'. Default includes the first two. Estimating 'constant_effect' or 'max_ht_const' signficantly increases the running time.

control_condition

string specifying the name of the single condition to be considered the pure control condition (present in names(obs_prob_exposure$I_exposure). For the Aronow-Samii exposure mappings returned by make_exposure_map_AS, the control condition is 'no'.

treated_conditions

string vector specifying the names of the conditions (present in names(obs_prob_exposure$I_exposure)) which are not the pure control condition. Default is NULL; in which case all of the conditions in names(obs_prob_exposure$I_exposure) other than control_condition are considered treated.

Details

estimates produces values for the estimator of the average unit-level causal effect of exposure k versus l and its variance estimator for the exposure mappings returned by function make_exposure_map_AS, using a Horvitz-Thompson and a Hajek estimator. It also computes Horvitz-Thompson and Hajek estimators of the total of potential outcomes, which are inputs in the computation of average unit-level causal effect of exposure k versus l.

Value

A list of 13 lists:

yT_ht:

A named numeric vector which contains the values of the Horvitz-Thompson estimator of the total of potential outcomes under each exposure condition as derived in Equation 1 of Aronow and Samii (2017).

yT_h:

A named numeric vector which contains the values of the Hajek estimator of the total of potential outcomes under each exposure condition as derived in Equation 15 of Aronow and Samii (2017).

var_yT_ht:

A named numeric K * 1 matrix which contains the values of the variance estimator of the Horvitz-Thompson estimator of the total of potential outcomes under each exposure condition as derived in Equation 7 and Proposition 5.1 of Aronow and Samii (2017).

var_yT_h:

A named numeric K * 1 matrix which contains the values of the variance estimator of the Hajek estimator of the total of potential outcomes under each exposure condition as explained in the first paragraph of page 1929 of Aronow and Samii (2017).

cov_yT_ht:

A named numeric permutation(K,2) * 1 matrix which contains the values of the covariance estimator of the Horvitz-Thompson estimator of the total of potential outcomes across exposures conditions k and l as derived in Equation 10 of Aronow and Samii (2017). When the number of exposure conditions K = 4, then the number of rows of this matrix is 12; permutation(4,2).

cov_yT_h:

A named numeric permutation(K,2) * 1 matrix which contains the values of the covariance estimator of the Hajek estimator of the total of potential outcomes across exposures conditions k and l as explained in the first paragraph of page 1929 of Aronow and Samii (2017). When the number of exposure conditions K = 4, then the number of rows of this matrix is 12; permutation(4,2).

tau_ht:

A named numeric vector which contains the values of the Horvitz-Thompson estimator of the average unit-level causal effect of exposure k versus exposure l as derived in Equation 3 of Aronow and Samii (2017). Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

tau_h:

A named numeric vector which contains the values of the Hajek estimator of the average unit-level causal effect of exposure k versus exposure l. Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

tau_dsm:

A named numeric vector which contains the values of the difference in sample means estimator of the total observed outcomes across exposures k and l. Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

var_tau_ht:

A named numeric vector which contains the values of the conservative variance estimator of the variance of the Horvitz-Thompson estimator of the average unit-level causal effect of exposure k versus exposure l as derived in Equation 11 of Aronow and Samii (2017). Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

var_tau_h:

A named numeric vector which contains the values of the linearized variance estimator of the variance of the Hajek estimator of the average unit-level causal effect of exposure k versus exposure l as derived in Equation 11 of Aronow and Samii (2017) and further explained in the first paragraph of page 1929. Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

var_tau_ht_const_eff:

A named numeric vector which contains the values of the constant effects variance estimator of the variance of the Horvitz-Thompson estimator of the average unit-level causal effect of exposure k versus exposure l as derived in Equation 2.15 of Aronow (2013). Here exposure l is fixed to the No Exposure condition (i.e. no direct or indirect exposure).

var_tau_ht_max:

A named numeric vector which contains the maximum between var_tau_h and var_tau_ht_const_eff.

Functions

References

Aronow, P. M. (2013). Model assisted causal inference. PhD thesis, Department of Political Science, Yale University, New Haven, CT.

Aronow, P.M. & Samii, C. (2017). Estimating average causal effects under general interference, with application to a social network experiment. The Annals of Applied Statistics, 11(4), 1912–1947.

Aronow, P.M. et al. (2020). Spillover effects in experimental data. arXiv preprint, arXiv:2001.05444.

Examples

 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Create adjacency matrix and treatment assignment vector
# to produce observed exposure conditions:

adj_matrix <- make_adj_matrix(N = 9, model = 'sq_lattice')

tr_vector <- make_tr_vec_permutation(N = 9, p = 0.2,
                                     R = 1, seed = 357)

obs_exposure <- make_exposure_map_AS(adj_matrix, tr_vector,
                                     hop = 1)

# Simulate a vector of outcome data:

potential_outcome <- make_dilated_out(adj_matrix, make_corr_out,
                                      seed = 357, hop = 1)

obs_outcome <- rowSums(obs_exposure*t(potential_outcome))

# Create exposure probabilities:

potential_tr_vector <- make_tr_vec_permutation(N = 9, p = 0.2,
                                               R = 36,
                                               seed = 357)

obs_prob_exposure <- make_exposure_prob(potential_tr_vector,
                                        adj_matrix,
                                        make_exposure_map_AS,
                                        list(hop=1))

# Estimate exposure-specific causal effects and their variance:

estimates(obs_exposure, obs_outcome, obs_prob_exposure,
                                     n_var_permutations = 30,
                                     control_condition = 'no')
# Create adjacency matrix and treatment vector to
# produce observed exposure conditions according to the
# "full neighborhood" exposure mapping:

adj_matrix <- make_adj_matrix(N = 81, model = 'sq_lattice')

tr_vector <- make_tr_vec_permutation(N = 81, p = 0.5,
                                     R = 1, seed = 357)

obs_exposure_full_nei <- make_exposure_map_full_neighborhood(adj_matrix,
                                                    tr_vector)
# Simulate a vector of outcome data:

potential_outcome_full_nei <-
  make_dilated_out_full_neighborhood(adj_matrix, make_corr_out,
                                     seed = 357)

obs_outcome_full_nei <-
  rowSums(obs_exposure_full_nei*t(potential_outcome_full_nei))

# Create exposure probabilities:

potential_tr_vector <- make_tr_vec_permutation(N = 81, p = 0.5,
                                               R = 36,
                                               seed = 357)
obs_prob_exposure_full_nei <- make_exposure_prob(potential_tr_vector,
                                        adj_matrix,
                                        make_exposure_map_full_neighborhood)

# Estimate exposure-specific causal effects and their variance:

estimators_full_neighborhood(obs_exposure_full_nei, obs_outcome_full_nei,
          obs_prob_exposure_full_nei,
          n_var_permutations = 30)

szonszein/interference documentation built on Jan. 10, 2022, 6:35 p.m.