diffOR {BayesSenMC} | R Documentation |
Model with differential misclassification
Description
Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given a four-variate differential misclassification.
Usage
diffOR(
a,
N1,
c,
N0,
mu,
s.lg.se0,
s.lg.se1,
s.lg.sp0,
s.lg.sp1,
corr.sesp0,
corr.sesp1,
corr.group = 0,
z = NULL,
logitpi0_prior = c(0, 10),
lor_prior = c(0, 2),
chains = 2,
traceplot = FALSE,
inc_warmup = FALSE,
window = NULL,
refresh = 0,
seed = 0,
...
)
Arguments
a |
number of exposed subjects in the case group. |
N1 |
number of total subjects in the case group. |
c |
number of exposed subjects in the control group. |
N0 |
number of total subjects in the control group. |
mu |
vector of length 4; multivariate normal distribution of |
s.lg.se0 |
standard deviation of logit Se in the control group. |
s.lg.se1 |
standard deviation of logit Se in the case group. |
s.lg.sp0 |
standard deviation of logit Sp in the control group. |
s.lg.sp1 |
standard deviation of logit Sp in the case group. |
corr.sesp0 |
correlation between Se_0 and Sp_0. |
corr.sesp1 |
correlation between Se_1 and Sp_1. |
corr.group |
correlation between Se_0 and Se_1, Sp_0 and Sp_1. Default to 0. |
z |
vector of length 4; used as an initial value for |
logitpi0_prior |
mean and sd of the prior normal distribution of |
lor_prior |
mean and sd of the prior normal distribution of corrected log odds ratio. Default to |
chains |
number of Markov Chains. Default to 2. |
traceplot |
Logical, defaulting to |
inc_warmup |
Only evaluated when |
window |
Only evaluated when |
refresh |
an integer value used to control how often the progress of sampling is reported. By default, the progress indicator is turned off, thus refresh <= 0. If on, refresh = max(iter/10, 1) is generally recommended. |
seed |
the seed for random number generation. Default to 0. See stan for more details. |
... |
optional parameters passed to stan. |
Value
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
Examples
# Case-control study data of Bipolar Disorder with rheumatoid arthritis (Farhi et al. 2016)
# Data from \url{https://www.sciencedirect.com/science/article/pii/S0165032715303864#bib13}
diffOR(a = 66, N1 = 11782, c = 243, N0 = 57973, mu = c(1.069, 1.069, 1.126, 1.126),
s.lg.se0 = 0.712, s.lg.se1 = 0.712, s.lg.sp0 = 0.893, s.lg.sp1 = 0.893, corr.sesp0 = -0.377,
corr.sesp1 = -0.377, corr.group = 0, chains = 3, iter = 10000)