View source: R/make_stancode.R
| make_stancode | R Documentation |
Generate the Stan code corresponding to the model.
This is called internally by fit; use
stancode.PStrataFit to retrieve the code
from a fitted model.
make_stancode(object, filename = NULL, debug = FALSE)
object |
An internal model specification object. |
filename |
(optional) string. If not |
debug |
only for development/testing use. |
A string containing the Stan program.
data(sim_data_normal)
model <- PStrataModel(
S.formula = Z + D ~ 1,
Y.formula = Y ~ 1,
Y.family = gaussian(),
strata = c(n = "00", c = "01", a = "11"),
ER = c("n", "a")
)
ps_fit <- fit(model, data = sim_data_normal, chains = 2, iter = 500)
cat(stancode(ps_fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.