Description Usage Arguments Details Value Examples

This internal function checks if the data introduced for building the curve is correct or not. It shows if there are some missing marker or response values and whether there are less or more than two levels at the response vector, D. It also splits the data into two groups: controls and cases, depending on the corresponding value in the response vector.

1 |

`X ` |
vector of (bio)marker values. It should be numeric. |

`D ` |
vector of response values. It should contain at least two different levels. |

The code will not run and an error will be showed in these cases:

`X`

or`D`

is missing,`X`

or`D`

is NULL or full of NA's,`X`

is not a numeric vector,`D`

has less than two different values, and/or`X`

and`D`

have different lengths.

If the response vector has more than two different levels, only the two first ones are considered as controls and cases, respectively.

If the user does not agree with the codification, it can be changed modifying the order of the levels using the `factor`

function; for instance, `factor(D, levels=c("1","0"))`

.

If the marker and response vectors are correct a list with the following fields is returned:

`levels ` |
levels in |

`controls ` |
marker values for controls. |

`cases ` |
marker values for cases. |

`n0 ` |
number of controls. |

`n1 ` |
number of cases. |

`X ` |
marker values corresponding to controls and cases (in this order). |

`D ` |
response vector consisting of |

1 2 3 4 5 6 7 8 9 10 | ```
# Basic example with full information
set.seed(123)
X <- c(rnorm(45), rnorm(30,2,1.5))
D <- c(rep(0,45), rep(1,30))
checkROC(X,D)
# Example with some missing values and more than two levels
X <- replace(c(rnorm(25), rnorm(30,2,1.5), rnorm(20,-3,1)), seq(1,75,5), NA)
D <- replace(c(rep(0,25), rep(1,30), rep(2,20)), seq(1,75,11), NA)
checkROC(X,D)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.