agcEffect: Evaluate the network causal effects from estimated Gibbs...

Description Usage Arguments Value Examples

Description

agcEffect takes a covariate and outcome model fit from agcParam, parameters for an MCMC, and the specified treatment effect and determines the causal estimates (direct and spillover) generated from the network structure.

Usage

 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
agcEffect(
  mod,
  burnin = 1,
  thin = 0.5,
  treatment_allocation = 0.5,
  subset = 0,
  R = 10,
  burnin_R = 10,
  burnin_cov = 10,
  average = TRUE,
  index_override = 0,
  return_effects = 1
)

## S4 method for signature 'list'
agcEffect(
  mod,
  burnin = 1,
  thin = 0.2,
  treatment_allocation = 0.5,
  subset = 0,
  R = 10,
  burnin_R = 10,
  burnin_cov = 10,
  average = TRUE,
  index_override = 0,
  return_effects = 1
)

Arguments

mod

An agcParamClass object from agcParam containing variables to be considered for the covariate model.

burnin

The index to start evaluation as one would normally have for a burnin for a Bayesian computation. Default = 1

thin

The rate at which to evaluate the outcome model. The closer to 1, the more values to compute (supplying 1 will not thin at all).

treatment_allocation

The proportion of the individuals in the network to receive the treatment. Should be a number between 0 and 1. Default = 0.5.

subset

The indices of the individuals, as they appear in the adjacency matrix, to be included in the network causal effects estimates. Default = 0 (include everyone).

R

The number of iterations for the Gibbs inner loop. Default = 10.

burnin_R

The index to start evaluation as one would normally have for a burnin for a Bayesian computation. Default = 10.

burnin_cov

The index to start saving covariates for use in the network causal effect chains. Default = 10.

average

An indicator of whether to evaluate the causal effects as an average of the R iterations. Default = "TRUE".

index_override

The MCMC outer loop iteration numbers to include in the evaluation of the causal effects. This will override the burnin and thin parameters. Default = 0 (all iterations included).

return_effects

An indicator of whether to return direct and spillover effects or just the counterfactual expectations. Use the latter if you wish to construct overall effects or different types of spillover effects. Default = 1.

Value

An S3 object of type agcEffectClass that contains essential values for the outcome model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rdsIn <- readRDS(paste0(system.file('extdata',package='autognet'),"/agc-example.rds"))
adjmat <- rdsIn[[1]]
data <- rdsIn[[2]]
treatment <- "treatment"
outcome <- "outcome"
B = 10
R = 5
seed = 1

mod <- agcParam(data, treatment, outcome, adjmat,
                         B = B, R = R, seed = c(1))
effects <- agcEffect(mod)

isabelfulcher/autognet documentation built on Aug. 23, 2020, 9:42 a.m.