Package 'correctedAUC'

Title: Correcting AUC for Measurement Error
Description: Correcting area under ROC (AUC) for measurement error based on probit-shift model.
Authors: Bernard Rosner, Shelley Tworoger, Weiliang Qiu
Maintainer: Weiliang Qiu <[email protected]>
License: GPL (>= 2)
Version: 0.0.3
Built: 2024-09-16 03:30:39 UTC
Source: https://github.com/cran/correctedAUC

Help Index


Calculate AUC corrected for measurement error based on Reiser's (2000) method

Description

Calculate AUC corrected for measurement error based on Reiser's (2000) method.

Usage

AUCest.Reiser(
  datFrame, 
  sidVar = "subjID", 
  obsVar = "y", 
  grpVar = "grp", 
  repVar = "myrep", 
  alpha = 0.05)

Arguments

datFrame

a data frame with at least the following columns: y: numerical vector of observations; subjID: vector of subject ids; grp: group indicator: 1 means case; and 0 means conrol; myrep: integer vector indicating replication. should be consecutive positive integer starting from 1.

sidVar

character. variable name for subject id in the data frame datFrame.

obsVar

character. variable name for observations in the data frame datFrame.

grpVar

character. variable name for group indictor in the data frame datFrame.

repVar

character. variable name for replication indictor in the data frame datFrame.

alpha

confidence interval level 100(1α100(1-\alpha%

Value

A list of 4 elements

AUC.c

AUC corrected for measurement error based on Reiser's (2000) method.

sd.AUC.c

standard error of the estimated AUC corrected for measurement error based on Reiser's (2000) method.

AUC.c.low

lower bound of the AUC.c.

AUC.c.upp

upper bound of the AUC.c.

Author(s)

Bernard Rosner <[email protected]>, Shelley Tworoger <[email protected]>, Weiliang Qiu <[email protected]>

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

set.seed(1234567)
  tt=genSimDataReiser(
       nX = 100, 
       nY = 100, 
       sigma.X2 = 1, 
       mu.X = 0.25, 
       sigma.Y2 = 1, 
       mu.Y = 0, 
       sigma.epsilon2 = 0.5, 
       sigma.eta2 = 0.5) 

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

  res = AUCest.Reiser(
    datFrame = tt$datFrame, 
    sidVar = "subjID",
    obsVar = "y",
    grpVar = "grp",
    repVar = "myrep",
    alpha = 0.05)
  print(res)

Calculate AUC.c for measurement error based on probit-shift model

Description

Calculate AUC.c for measurement error based on probit-shift model.

Usage

AUCest.Rosner(
  datFrame, 
  sidVar = "subjID", 
  obsVar = "y", 
  grpVar = "grp", 
  repVar = "myrep", 
  alpha = 0.05)

Arguments

datFrame

a data frame with at least the following columns: y: numerical vector of observations; subjID: vector of subject ids; grp: group indicator: 1 means case; and 0 means conrol; myrep: integer vector indicating replication. should be consecutive positive integer starting from 1.

sidVar

character. variable name for subject id in the data frame datFrame.

obsVar

character. variable name for observations in the data frame datFrame.

grpVar

character. variable name for group indictor in the data frame datFrame.

repVar

character. variable name for replication indictor in the data frame datFrame.

alpha

confidence interval level 100(1α100(1-\alpha%

Value

A list of 9 elements:

AUC.obs

AUC estimated based on the Mann-Whitney statistic.

AUC.c

AUC corrected for measurement error based on the probit-shift model.

ICC.x

intra-class correlation for cases.

ICC.y

intra-class correlation for controls

mu.mle

maximum likelihood estimate of μ\mu (i.e., the shift between the case distribution and the control distribution after probit transformation)

AUC.obs.low

lower bound of the AUC.obs.

AUC.obs.upp

upper bound of the AUC.obs.

AUC.c.low

lower bound of the AUC.c.

AUC.c.upp

upper bound of the AUC.c.

Author(s)

Bernard Rosner <[email protected]>, Shelley Tworoger <[email protected]>, Weiliang Qiu <[email protected]>

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

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)

  res = AUCest.Rosner(
    datFrame = tt$datFrame, 
    sidVar = "subjID",
    obsVar = "y",
    grpVar = "grp",
    repVar = "myrep",
    alpha = 0.05)
  print(res)

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

Description

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

Usage

genSimDataModelII(
  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.

Details

The Model II in Rosner et al.'s (2005) manuscript:

Xik,obs=Xi,true+ϵik,log(Xi,true)N(λ+μ,σX2),ϵikN(0,σϵ2),i=1,,nX,k=1,2X_{ik, obs}=X_{i,true}+\epsilon_{ik},\\ \log\left(X_{i, true}\right) \sim N\left(\lambda+\mu, \sigma_X^2\right),\\ \epsilon_{ik} \sim N\left(0, \sigma_{\epsilon}^2\right),\\ i=1,\ldots, n_X, k=1, 2

Yjl,obs=Yj,true+ξjl,log(Yj,true)N(λ,σY2),ξjlN(0,ση2),j=1,,nY,l=1,2Y_{jl, obs}=Y_{j,true}+\xi_{jl},\\ \log\left(Y_{j, true}\right) \sim N\left(\lambda, \sigma_Y^2\right),\\ \xi_{jl} \sim N(0, \sigma_{\eta}^2),\\ j=1,\ldots, n_Y, l=1, 2

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

Author(s)

Bernard Rosner <[email protected]>, Shelley Tworoger <[email protected]>, Weiliang Qiu <[email protected]>

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

set.seed(1234567)
  tt=genSimDataModelII(
    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)

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.

Details

The Model III in Rosner et al.'s (2005) manuscript:

Xik,obs=Xi,true+ϵik,log(Xi,true)N(λ+μ,σX2),log(ϵik)N(0,σϵ2),i=1,,nX,k=1,2X_{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

Yjl,obs=Yj,true+ξjl,log(Yj,true)N(λ,σY2),log(ξjl)N(0,ση2),j=1,,nY,l=1,2Y_{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

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

Author(s)

Bernard Rosner <[email protected]>, Shelley Tworoger <[email protected]>, Weiliang Qiu <[email protected]>

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

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)

Generate one simulated data set based on Reiser's (2000) model

Description

Generate one simulated data set based on Reiser's (2000) model. The true AUC will also be calculated.

Usage

genSimDataReiser(
  nX = 100, 
  nY = 100, 
  sigma.X2 = 1, 
  mu.X = 0.25, 
  sigma.Y2 = 1, 
  mu.Y = 0, 
  sigma.epsilon2 = 0.5, 
  sigma.eta2 = 0.5)

Arguments

nX

integer. number of cases.

nY

integer. number of controls.

sigma.X2

variance of the true value for cases.

mu.X

mean of the true value for cases.

sigma.Y2

variance of the true value for controls.

mu.Y

mean of the true value for controls.

sigma.epsilon2

variance of the random error term for cases.

sigma.eta2

variance of the random error term for controls.

Details

Reiser's (2000) measurement error model is:

Xik,obs=Xi,true+ϵik,Xi,trueN(μX,σX2),ϵikN(0,σϵ2),i=1,,nX,k=1,2X_{ik, obs}=X_{i,true}+\epsilon_{ik},\\ X_{i, true} \sim N\left(\mu_X, \sigma_X^2\right),\\ \epsilon_{ik} \sim N\left(0, \sigma_{\epsilon}^2\right),\\ i=1,\ldots, n_X, k=1, 2

Yjl,obs=Yj,true+ξjl,Yj,trueN(μY,σY2),ξjlN(0,ση2),j=1,,nY,l=1,2Y_{jl, obs}=Y_{j,true}+\xi_{jl},\\ Y_{j, true} \sim N\left(\mu_Y, \sigma_Y^2\right),\\ \xi_{jl} \sim N(0, \sigma_{\eta}^2),\\ j=1,\ldots, n_Y, l=1, 2

Value

A list of 4 elements:

datFrame

A data frame with 4 elements: y: observations; subjID: subject ID; grp: group indicator; myrep: replication indicator.

theta2

(sigma.epsilon2+sigma.eta2)/(sigma.X2+sigma.Y2)(sigma.epsilon2 + sigma.eta2)/(sigma.X2 + sigma.Y2)

mu.true

mu.Xmu.Ymu.X-mu.Y

AUC.true

true AUC value

Author(s)

Bernard Rosner <[email protected]>, Shelley Tworoger <[email protected]>, Weiliang Qiu <[email protected]>

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

set.seed(1234567)
  tt=genSimDataReiser(
       nX = 100, 
       nY = 100, 
       sigma.X2 = 1, 
       mu.X = 0.25, 
       sigma.Y2 = 1, 
       mu.Y = 0, 
       sigma.epsilon2 = 0.5, 
       sigma.eta2 = 0.5) 

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