Title: | Different Models of Posterior Distributions of Adjusted Odds Ratio |
---|---|
Description: | Generates different posterior distributions of adjusted odds ratio under different priors of sensitivity and specificity, and plots the models for comparison. It also provides estimations for the specifications of the models using diagnostics of exposure status with a non-linear mixed effects model. It implements the methods that are first proposed in <doi:10.1016/j.annepidem.2006.04.001> and <doi:10.1177/0272989X09353452>. |
Authors: | Jinhui Yang, Haitao Chu, and Lifeng Lin |
Maintainer: | Jinhui Yang <[email protected]> |
License: | GPL-2 |
Version: | 0.1.3 |
Built: | 2025-02-23 05:03:09 UTC |
Source: | https://github.com/formidify/bayessenmc |
This package generates different posterior distributions of adjusted odds ratio under different priors of sensitivity and specificity, and plots the models for comparison. It also provides estimations for the specifications of the models using diagnostics of exposure status with a non-linear mixed effects model.
Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org
Records the true positive, true negative, false positive and false negative of each diagnosis accuracy study. Also includes the type of screening instruments (Bipolar Spectrum diagnostic scale / HCL-21 / Mood disorder questionnaire), the cut-off value for diagnostics, and the percentage of bipolar cases that were of bipolar disorder type II or not specified.
data(bd_meta)
data(bd_meta)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 55 rows and 8 columns.
https://www.sciencedirect.com/science/article/pii/S0165032714006466
Carvalho et al. (2015) "Screening for bipolar spectrum disorders: A comprehensive meta-analysis of accuracy studies". Journal of Affective Disorders 172: 337 - 346. (ScienceDirect)
data(bd_meta)
data(bd_meta)
Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given nondifferential misclassification with Se and Sp (i.e., both are constant and at least one of Se or Sp is lower than 1).
correctedOR( a, N1, c, N0, prior_list = NULL, se = NULL, sp = NULL, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
correctedOR( a, N1, c, N0, prior_list = NULL, se = NULL, sp = NULL, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
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. |
prior_list |
list of priors. Can be replaced by the function call to |
se |
sensitivity. Do not have to specify this if |
sp |
specificity. Do not have to specify this if |
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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) correctedOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)
# 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) correctedOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)
Generate a stanfit object corresponding to a posterior distribution of uncorrected odds ratio given no misclassification.
crudeOR( a, N1, c, N0, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
crudeOR( a, N1, c, N0, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
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. |
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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} # 3 MCMC chains with 10000 iterations each crudeOR(a = 66, N1 = 11782, c = 243, N0 = 57973, chains = 3, iter = 10000)
# 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} # 3 MCMC chains with 10000 iterations each crudeOR(a = 66, N1 = 11782, c = 243, N0 = 57973, chains = 3, iter = 10000)
Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given a four-variate differential misclassification.
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, ... )
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, ... )
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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)
# 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)
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 = NA, ... )
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 = NA, ... )
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. |
prior_list |
list of priors. Can be replaced by the function call to |
m.lg.se |
normal distribution of logit Se with (mean = m.lg.se, sd = s.lg.se). Do not have to specify this if |
m.lg.sp |
conditional normal distribution of logit Sp given Se with (m.lg.sp, s.lg.sp). Do not have to specify this if |
s.lg.se |
standard deviation of logit Se. Do not have to specify this if |
s.lg.sp |
standard deviation of logit Sp. Do not have to specify this if |
lg.se |
used as an initial value for logit Se. Default to |
lg.sp |
used as an initial value for logit Sp. Default to |
rho |
correlation between Se and Sp. Do not have to specify this if |
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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)
# 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)
Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given nondifferential misclassification under a logit-transformed scaled bivariate normal distribution.
logitOR( 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, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
logitOR( 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, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
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. |
prior_list |
list of priors. Can be replaced by the function call to |
m.lg.se |
normal distribution of logit Se with (mean = m.lg.se, sd = s.lg.se). Do not have to specify this if |
m.lg.sp |
normal distribution of logit Sp with (m.lg.sp, s.lg.sp). Do not have to specify this if |
s.lg.se |
standard deviation of logit Se. Do not have to specify this if |
s.lg.sp |
standard deviation of logit Sp. Do not have to specify this if |
lg.se |
used as an initial value for logit Se. Default to |
lg.sp |
used as an initial value for logit Sp. Default to |
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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) logitOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)
# 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) logitOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)
Fit a bivariate generalized linear mixed-effects model (GLMM) for non-differential sensitivity and specificity using the glmer
function in lme4
.
Lower and upper bounds for Se and Sp can be specified according to the assumptions of the study.
nlmeNDiff(data, lower = 0.5, upper = 1, id = FALSE, ...)
nlmeNDiff(data, lower = 0.5, upper = 1, id = FALSE, ...)
data |
a data frame containing the 2 by 2 data of the diagnostics table of exposure status for every study in a meta-analysis.
It contains at least 4 columns in the data named as following: |
lower |
an optional argument specifying the lower bound assumption of Se and Sp. Default to 0.5 (or the lowest Se/Sp of all studies, whichever is lower), which provides the mild assumption that Se and Sp are better than chance. |
upper |
an optional argument specifying the upper bound assumption of Se and Sp. Default to 1. |
id |
a TRUE of FALSE argument indicating if the supplied data has a |
... |
optional parameters passed to glmer. |
It returns an object of class merMod.
Besides generic class methods, paramEst()
is implemented in BayesSenMC
to get the parameter estimates used in the Bayesian misclassification model functions.
data(bd_meta) mod <- nlmeNDiff(bd_meta, lower = 0)
data(bd_meta) mod <- nlmeNDiff(bd_meta, lower = 0)
Get parameter estimates of the GLMM model to plug into modeling functions in BayesSenMC
for Bayesian inference of adjusted odds ratio.
paramEst(model, lower = 0.5, upper = 1)
paramEst(model, lower = 0.5, upper = 1)
model |
a GLMM model built with the |
lower |
an optional argument matching the lower bound assumption of Se and Sp of the input |
upper |
an optional argument matching the upper bound assumption of Se and Sp. Default to 1 as in |
It returns a list of parameter estimates which can be input into the Bayesian model functions in
BayesSenMC
. (m.lg.se, s.lg.se)
and (m.lg.sp, s.lg.sp)
are the logit prior distributions for Se and Sp.
se
and sp
are the corresponding mean values given the logit prior means. rho
is the correlation estimate between Se and
Sp. m.fisher
is the Fisher's mean of the correlation assume a Fisher's distribution.
data(bd_meta) mod <- nlmeNDiff(bd_meta, lower = 0) # see \code{nlmeNDiff()} for detailed example. prior_list <- paramEst(mod)
data(bd_meta) mod <- nlmeNDiff(bd_meta, lower = 0) # see \code{nlmeNDiff()} for detailed example. prior_list <- paramEst(mod)
Plot the posterior distribution of adjusted odds ratio given the stanfit object. It also plots the density lines of crude/uncorrected odds ratio and corrected odds ratio with constant misclassification, assuming log-normality is true. If both Se and Sp are set to 1 (i.e., no misclassification), then only the density line of crude OR will be plotted.
plotOR( model, a, N1, c, N0, se = 1, sp = 1, x.min = 0, x.max = NULL, y.max = NULL, binwidth = 0.25, fill = "gray", ... )
plotOR( model, a, N1, c, N0, se = 1, sp = 1, x.min = 0, x.max = NULL, y.max = NULL, binwidth = 0.25, fill = "gray", ... )
model |
A stanfit object. |
a |
number of exposed subjects in the case group. Along with N1, c, N0, se and sp, they are used to plot probability density with no misclassification and constant misclassification as a comparison. |
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. |
se |
sensitivity. Default to 1. If no other values are specified for either se or sp, then only the density curve of corrected model will be drawn. |
sp |
specificity. Default to 1. |
x.min |
shows only samples with corrected odds ratio larger or equal to |
x.max |
shows only samples with corrected odds ratio smaller or equal to |
y.max |
shows only samples or density line within the range of (0, |
binwidth |
default to |
fill |
default to |
... |
optional additional arguments passed to |
It returns a ggplot that can be further customized using the ggplot2 package.
# 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} library(ggplot2) my.mod <- randCorrOR(a = 66, N1 = 11782, c = 243, N0 = 57973, m.lg.se = 1.069, m.lg.sp = 1.126, s.lg.se = 0.893, s.lg.sp = 0.712, m.z = -0.399, s.z = 0.139, seed = 0) my.plot <- plotOR(my.mod, a = 66, N1 = 11782, c = 243, N0 = 57973, se = 0.744, sp = 0.755, x.max = 3, y.max = 5, binwidth = 0.1) + ggtitle("Model with random correlation") # the user can also directly extract the data from a stanfit object using the following my.data <- as.data.frame(my.mod)
# 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} library(ggplot2) my.mod <- randCorrOR(a = 66, N1 = 11782, c = 243, N0 = 57973, m.lg.se = 1.069, m.lg.sp = 1.126, s.lg.se = 0.893, s.lg.sp = 0.712, m.z = -0.399, s.z = 0.139, seed = 0) my.plot <- plotOR(my.mod, a = 66, N1 = 11782, c = 243, N0 = 57973, se = 0.744, sp = 0.755, x.max = 3, y.max = 5, binwidth = 0.1) + ggtitle("Model with random correlation") # the user can also directly extract the data from a stanfit object using the following my.data <- as.data.frame(my.mod)
Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given nondifferential misclassification that extends from the logit model but allows a random correlation between Sensitivity and Specificity.
randCorrOR( 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, m.z = NULL, s.z = NULL, z = NULL, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
randCorrOR( 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, m.z = NULL, s.z = NULL, z = NULL, logitpi0_prior = c(0, 10), lor_prior = c(0, 2), chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL, refresh = 0, seed = NA, ... )
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. |
prior_list |
list of priors. Can be replaced by the function call to |
m.lg.se |
normal distribution of logit Se with (mean = m.lg.se, sd = s.lg.se). Do not have to specify this if |
m.lg.sp |
conditional normal distribution of logit Sp given Se with (m.lg.sp, s.lg.sp). Do not have to specify this if |
s.lg.se |
standard deviation of logit Se. Do not have to specify this if |
s.lg.sp |
standard deviation of logit Sp. Do not have to specify this if |
lg.se |
used as an initial value for logit Se. Default to m.lg.se. Do not have to specify this if |
lg.sp |
used as an initial value for logit Sp. Default to m.lg.sp. Do not have to specify this if |
m.z |
normal distribution of Z with (mean = m.z, sd = s.z). Do not have to specify this if |
s.z |
normal distribution of Z with (mean = m.z, sd = s.z). Do not have to specify this if |
z |
used as an initial value of Fisher's Z transformed of rho, where correlation rho = (exp(2z)-1)/(1+exp(2z))). Do not have to specify this if |
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. See stan for more details. |
... |
optional parameters passed to stan. |
It returns a stanfit object of this model, which inherits stanfit class methods. See rstan for more details.
# 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) randCorrOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)
# 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) randCorrOR(a = 66, N1 = 11782, c = 243, N0 = 57973, prior_list = prior_list, chains = 3, iter = 10000)