crudeOR: Model with constant nondifferential misclassification

Description Usage Arguments Value Examples

Description

Generate a stanfit object corresponding to a posterior distribution of corrected odds ratio given nondifferential misclassification with constant Se and Sp.

Usage

1
2
3
crudeOR(a, N1, c, N0, se, sp, name = "Constant Misclassification Model",
  chains = 2, traceplot = FALSE, inc_warmup = FALSE, window = NULL,
  refresh = 0, seed = NA, ...)

Arguments

a

# of exposed subjects in the case group.

N1

# of total subjects in the case group.

c

# of exposed subjects in the control group.

N0

# of total subjects in the control group.

se

sensitivity

sp

specificity

name

a string of the name of the model. Default to "Constant Misclassification Model".

chains

number of Markov Chains. Default to 2.

traceplot

Logical, defaulting to FALSE. If TRUE it will draw the traceplot corresponding to one or more Markov chains.

inc_warmup

Only evaluated when traceplot = TRUE. TRUE or FALSE, indicating whether or not to include the warmup sample in the traceplot; defaults to FALSE.

window

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.

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.

Value

It returns a stanfit object of this model, which inherits stanfit class methods. See here for more details.

Examples

1
2
3
4
5
6
7
8
9
# 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}\

## Not run: 
crudeOR(a = 66, N1 = 11782, c = 243, N0 = 57973, se = 0.744, sp = 0.755, chains = 3, 
iter = 10000, seed = 0)

## End(Not run)
crudeOR(a = 66, N1 = 11782, c = 243, N0 = 57973, se = 0.744, sp = 0.755, traceplot = TRUE)

formidify/BayesSenMC documentation built on May 4, 2019, 6:36 p.m.