Learn R Programming

CopulaREMADA (version 1.7.3)

rCopulaREMADA: Simulation from copula mixed models for diagnostic test accuaracy studies

Description

To simulate the data we have used the following steps:

1. Simulate the study size \(n\) from a shifted gamma distribution with parameters \(\alpha=1.2,\beta=0.01,lag=30\) and round off to the nearest integer.

2. Simulate \((u_1,u_2)\) from a parametric family of copulas 'cop'.

3. Convert to beta realizations or normal realizations.

4. Draw the number of diseased \(n_1\) from a \(B(n,0.43)\) distribution.

5. Set \(n_2=n-n_1, y_j=n_jx_j\) and then round \(y_j\) for \(j=1,2\).

Usage

rCopulaREMADA.norm(N,p,si,tau,rcop,tau2par)
rCopulaREMADA.beta(N,p,g,tau,rcop,tau2par)

Value

A list containing the following simulated components:

TP

the number of true positives

FN

the number of false negatives

FP

the number of false positives

TN

the number of true negatives

Arguments

N

sample size

p

Pair \((\pi_1,\pi_2)\) of sensitivity/specificity

si

Pair \((\sigma_1,\sigma_2)\) of variability; normal margins

g

Pair \((\gamma_1,\gamma_2)\) of variability; beta margins

tau

Kendall's tau value

rcop

function for copula generation

tau2par

function for mapping from Kendall's tau to copula parameter

References

Nikoloulopoulos, A.K. (2015) A mixed effect model for bivariate meta-analysis of diagnostic test accuracy studies using a copula representation of the random effects distribution. Statistics in Medicine, 34, 3842--3865. tools:::Rd_expr_doi("10.1002/sim.6595").

See Also

CopulaREMADA rcop

Examples

Run this code
nq=15
gl=gauss.quad.prob(nq,"uniform")
mgrid<- meshgrid(gl$n,gl$n)

N=20
tau=-0.5
p=c(0.7,0.9)
g=c(0.2,0.1)
simDat=rCopulaREMADA.beta(N,p,g,tau,rcln270,tau2par.cln270)
TP=simDat$TP
TN=simDat$TN
FP=simDat$FP
FN=simDat$FN
c270est.b=CopulaREMADA.beta(TP,FN,FP,TN,gl,mgrid,qcondcln270,tau2par.cln270)

si=c(2,1)
tau=0.5
simDat=rCopulaREMADA.norm(N,p,si,tau,rcln,tau2par.cln)
TP=simDat$TP
TN=simDat$TN
FP=simDat$FP
FN=simDat$FN
cest.n=CopulaREMADA.norm(TP,FN,FP,TN,gl,mgrid,qcondcln,tau2par.cln)

Run the code above in your browser using DataLab