sample_outcome_model: Sample Outcome Model

Description Usage Arguments Author(s) See Also Examples

View source: R/functions_outcome_model.R

Description

Samples from the posterior distribution of outcome model parameters, using STAN

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sample_outcome_model(
  standata,
  B = 1000,
  warmup = B,
  chains = 4,
  control = list(adapt_delta = 0.9, max_treedepth = 12),
  multiple_exposure_curves = FALSE,
  restrictBeta = FALSE,
  ...
)

Arguments

standata

An object of class 'standata_outcome', typically created from create_standata_outcome.

B

Number of post-warmup iterations.

warmup

Number of warmup iterations.

chains

Number of chains to sample.

control

List provided as the control argument of sampling

multiple_exposure_curves

Logical indicating whether exposure response curves should be estimated separately by study.

restrictBeta

Logical indicating that model should be fit that forces a positive value for the exposure spline coefficients.

...

Additional arguments passed to sampling.

Author(s)

Joshua Keller

See Also

create_standata_outcome, outsim_sample_observations

Examples

1
2
3
4
5
6
data(casedataA)
outcome_dataA <- create_standata_outcome(data=casedataA)
outcome_dataA <- add_priors(outcome_dataA,
                            sigmaI=c(0, 0.1))
outcome_mod_fit1 <- sample_outcome_model(outcome_dataA)
print(outcome_mod_fit1, pars=c("reI_raw", "reI","mui"), include=FALSE)

jpkeller/bercs documentation built on March 24, 2021, 5:36 a.m.