Learn R Programming

correctedAUC (version 0.0.3)

genSimDataModelIII: Generate one simulated data set based on Model III in Rosner et al's (2015) manuscript

Description

Generate one simulated data set based on Model III in Rosner et al's (2015) manuscript.

Usage

genSimDataModelIII( nX, nY, mu, lambda, sigma.X2, sigma.Y2, sigma.e.X, sigma.e.Y)

Arguments

nX
integer. number of cases.
nY
integer. number of controls.
mu
difference of means between the case distribution and control distribution.
lambda
mean for controls.
sigma.X2
variance of the true value for cases.
sigma.Y2
variance of the true value for controls.
sigma.e.X
variance of the random error term for cases.
sigma.e.Y
variance of the random error term for controls.

Value

A list of 2 elements:
datFrame
A data frame with 4 elements: y: observations; subjID: subject ID; grp: group indicator; myrep: replication indicator.
AUC.true
true AUC value

Details

The Model III in Rosner et al.'s (2005) manuscript: $$ X_{ik, obs}=X_{i,true}+\epsilon_{ik},\\ \log\left(X_{i, true}\right) \sim N\left(\lambda+\mu, \sigma_X^2\right),\\ \log\left(\epsilon_{ik}\right) \sim N\left(0, \sigma_{\epsilon}^2\right),\\ i=1,\ldots, n_X, k=1, 2 $$ $$ Y_{jl, obs}=Y_{j,true}+\xi_{jl},\\ \log\left(Y_{j, true}\right) \sim N\left(\lambda, \sigma_Y^2\right),\\ \log\left(\xi_{jl}\right) \sim N(0, \sigma_{\eta}^2),\\ j=1,\ldots, n_Y, l=1, 2 $$

References

Rosner B, Tworoger S, Qiu W (2015) Correcting AUC for Measurement Error. J Biom Biostat 6:270. doi:10.4172/2155-6180.1000270

Examples

Run this code
  set.seed(1234567)
  tt=genSimDataModelIII(
    nX = 100, 
    nY = 100, 
    mu = 0.25,
    lambda = 0,
    sigma.X2 = 1, 
    sigma.Y2 = 1, 
    sigma.e.X = 1, 
    sigma.e.Y = 1) 

  print(dim(tt$datFrame))
  print(tt$datFrame[1:2,1:3])
  print(tt$AUC.true)

Run the code above in your browser using DataLab