agcParam takes a data frame containing a treatment, outcome, and various covariates to be modeled via an MCMC. The network of observations (rows in the data frame) should be contained in the adjacency matrix (adjmat).

agcParam(data, treatment, outcome, adjmat, B = 25000, R = 10,
  seed = 1, scale.alpha = 0.005, scale.beta = 0.005,
  prior.alpha = 1, prior.beta = 1)

# S4 method for data.frame,character,character
agcParam(data, treatment,
  outcome, adjmat, B = 25000, R = 10, seed = 1,
  scale.alpha = 0.005, scale.beta = 0.005, prior.alpha = 1,
  prior.beta = 1)

Arguments

data

A data.frame containing variables to be considered for the covariate model.

treatment

A string specifying the column in data that is the treatment effect in the underlying model. Must be a binary (0/1) value.

outcome

A string specifying the column in data that is the outcome of interest in the underlying model. Must be a binary (0/1) value.

adjmat

An adjacency matrix (0/1s) specifying the network structure. The number of rows and columns should match the number of rows in the data object.

B

The number of iterations for the MCMC outer loop. Default = 25,000

R

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

seed

An integer value for set.seed. By default, only 1, which runs one chain with a seed of 1.

scale.alpha

A numeric vector of values for the parameters of the covariate model proposal distribution variance. By default, a scalar of .005 is applied to all values. If you wish to replace you can supply another scalar or the appropriate length vector.

scale.beta

A numeric vector of values for the parameters of the outcome model proposal distribution variance. By default, a scalar of .005 is applied to all values. If you wish to replace you can supply another scalar or the appropriate length vector.

prior.alpha

A binary (0/1) indicator for the proposal distribution for the covariate model parameters. If 1, the noninformative prior described in the paper will be used. If 0, an improper prior (i.e. proportional to 1) will be used. Default is 1.

prior.beta

A binary (0/1) indicator for the proposal distribution for the outcome model parameters. If 1, the noninformative prior described in the paper will be used. If 0, an improper prior (i.e. proportional to 1) will be used. Default is 1.

Value

An S3 object of type agcParamClass that contains essential values for the covariate model.

Details

B and R specify the number of iterations to be run for the various Bayesian sampling procedures. Defaults are conservative.

The seed variable requires a vector of integers to run potentially multiple chains.

Examples

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))
#> | | | 0% | |======== | 11% | |================ | 22% | |======================= | 33% | |=============================== | 44% | |======================================= | 56% | |=============================================== | 67% | |====================================================== | 78% | |============================================================== | 89% | |======================================================================| 100%