agcParam: Estimate parameters from the covariate and outcome model via...

Description Usage Arguments Details Value Examples

Description

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).

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
29
30
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,
  additional_nu = FALSE
)

## S4 method for signature '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,
  additional_nu = FALSE
)

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.

additional_nu

An integer (0/1) specifying whether neighbor cross terms will be evaluated (i.e. non zero)

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.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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))

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