Description Usage Arguments Value Examples
Make an N of 1 object containing data, priors, and a jags model file for individual analysis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | nof1.data(
Y,
Treat,
ord.baseline.Treat = NULL,
ord.model = NULL,
response = NULL,
ncat = NULL,
bs.trend = F,
y.time = NULL,
knots.bt.block = NULL,
block.no = NULL,
bs.df = NULL,
corr.y = F,
alpha.prior = NULL,
beta.prior = NULL,
eta.prior = NULL,
dc.prior = NULL,
c1.prior = NULL,
rho.prior = NULL,
hy.prior = NULL,
...
)
|
Y |
Outcome of the study. This should be a vector with |
Treat |
Treatment indicator vector with same length as the outcome. Can be character or numeric. |
ord.baseline.Treat |
Used for ordinal outcome to define a reference treatment level. |
ord.model |
Used for ordinal outcome to pick the model. Can be "cumulative" for proportional odds model or "acat" for restricted adjacent category model. |
response |
Type of outcome. Can be "normal" for continuous outcome, "binomial" for binary outcome, "poisson" for count outcome, or "ordinal" for ordinal or nominal outcome. |
ncat |
Number of categories. Used in ordinal models. |
bs.trend |
Indicator for whether the model should adjust for trend using splines. The default
is |
y.time |
Parameter used for modeling splines. Time when the outcome is measured. |
knots.bt.block |
parameter used for modeling splines. Indicator for whether or not knots should be set
at the end of each block except for the last block. If |
block.no |
Block number used for modeling splines for the setting where the knots are set at the end of each block. Block number with the same length as the outcome. |
bs.df |
Degrees of freedom for modeling splines when knots are not set at the end of each block. |
corr.y |
Indicator for whether the correlation among measurements shoule be modeled. The default is
|
alpha.prior |
Prior for the intercept of the model. Not needed now since we are using treatment-specific intercept model. |
beta.prior |
Prior for the treatment-specific intercept. |
eta.prior |
Prior for modelling spline terms. |
dc.prior |
Prior for the length between cutpoints. Used only for ordinal logistic models. |
c1.prior |
Prior for the first cutpoint. Used only for ordinal logistic models. |
rho.prior |
Prior for the correlated error model. |
hy.prior |
Prior for the heterogeneity parameter. Supports uniform, gamma, and half normal for normal and binomial response and wishart for multinomial response. It should be a list of length 3, where first element should be the distribution (one of dunif, dgamma, dhnorm, dwish) and the next two are the parameters associated with the distribution. For example, list("dunif", 0, 5) give uniform prior with lower bound 0 and upper bound 5 for the heterogeneity parameter. For wishart distribution, the last two parameter would be the scale matrix and the degrees of freedom. |
... |
Arguments to be passed to |
An object of class "nof1.data" that is used to run the model using nof1.run
is a list
containing
Y |
Outcome |
Treat |
Treatment |
ncat |
Number of categories for ordinal response |
nobs |
Total number of observations in a study |
Treat.name |
Treatment name |
response |
Type of outcome |
Treat_Treat.name |
Vector in the model matrix for Treat.name |
bs.trend |
Indicator for whether the model should adjust for trend using splines |
corr.y |
Indicator for whether the correlation among measurements shoule be modeled |
priors |
Priors that the code will be using. Default priors are used if prior was not specified |
code |
Rjags model file code that is generated using information provided by the user. To view model file inside R, use |
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.