Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given nondifferential misclassification that extends from the logit model but allows there to be a fixed correlation between sentivity and specificity.
fixedCorrOR(
a,
N1,
c,
N0,
prior_list = NULL,
m.lg.se = NULL,
m.lg.sp = NULL,
s.lg.se = NULL,
s.lg.sp = NULL,
lg.se = NULL,
lg.sp = NULL,
rho = NULL,
logitpi0_prior = c(0, 10),
lor_prior = c(0, 2),
chains = 2,
traceplot = FALSE,
inc_warmup = FALSE,
window = NULL,
refresh = 0,
seed = 0,
...
)It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
number of exposed subjects in the case group.
number of total subjects in the case group.
number of exposed subjects in the control group.
number of total subjects in the control group.
list of priors. Can be replaced by the function call to paramEst, or a list of prior parameters
(m.lg.se, s.lg.se, m.lg.sp, s.lg.sp, rho).
If prior_list is specified, the values for the corresponding function parameters will be disregarded.
normal distribution of logit Se with (mean = m.lg.se, sd = s.lg.se). Do not have to specify this if prior_list is given - it will be disregarded.
conditional normal distribution of logit Sp given Se with (m.lg.sp, s.lg.sp). Do not have to specify this if prior_list is given - it will be disregarded.
standard deviation of logit Se. Do not have to specify this if prior_list is given - it will be disregarded.
standard deviation of logit Sp. Do not have to specify this if prior_list is given - it will be disregarded.
used as an initial value for logit Se. Default to m.lg.se
used as an initial value for logit Sp. Default to m.lg.sp
correlation between Se and Sp. Do not have to specify this if prior_list is given - it will be disregarded.
mean and sd of the prior normal distribution of logit(pi0). Default to c(0,10).
mean and sd of the prior normal distribution of corrected log odds ratio. Default to c(0,2).
number of Markov Chains. Default to 2.
Logical, defaulting to FALSE. If TRUE it will draw the traceplot corresponding to one or more Markov chains.
Only evaluated when traceplot = TRUE. TRUE or FALSE, indicating whether or not to include the warmup sample in the
traceplot; defaults to FALSE.
Only evaluated when traceplot = TRUE. A vector of length 2. Iterations between window[1] and window[2] will be shown in the plot.
The default shows all iterations if inc_warmup is TRUE and all iterations from the sampling period only if inc_warmup is FALSE.
If inc_warmup is FALSE the iterations specified in window do not include iterations from the warmup period.
The default number of iterations is 2000 unless otherwise specified in the optional iter argument.
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.
the seed for random number generation. Default to 0. See stan for more details.
optional parameters passed to stan.
# 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}
mod <- nlmeNDiff(bd_meta, lower = 0) # see \code{nlmeNDiff()} for detailed example.
prior_list <- paramEst(mod)
fixedCorrOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list,
chains = 3, iter = 10000)
Run the code above in your browser using DataLab