randCorrOR {BayesSenMC} | R Documentation |

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 = 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. |

`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(2 |

`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. |

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)
```

[Package *BayesSenMC* version 0.1.5 Index]