Questions tagged [proc-r-package]

pROC is an R package for ROC curves.

The R pROC package is a set of "Tools for visualizing, smoothing and comparing receiver operating characteristic (ROC curves). (Partial) area under the curve (AUC) can be compared with statistical tests based on U-statistics or bootstrap. Confidence intervals can be computed for (p)AUC or ROC curves."

Repositories

79 questions
7
votes
2 answers

Changing scale of the ROC chart

I am using the following code to plot the ROC curve after having run the logistic regression. fit1 <- glm(formula=GB160M3~Behvscore, data=eflscr,family="binomial", na.action = na.exclude) prob1=predict(fit1, type=c("response")) eflscr$prob1 =…
Manfred
  • 147
  • 2
  • 10
7
votes
2 answers

Get optimal threshold with at least 75% sensitivity with pROC in R

I have a dataframe with two columns : score1 which is numeric and truth1 which is boolean. I want to predict truth1 using score1. To do that, I want a simple linear model, and then ask for a good threshold, i.e., a threshold which gives me 75% of…
sweeeeeet
  • 1,769
  • 4
  • 26
  • 50
6
votes
3 answers

How to deal with multiple class ROC analysis in R (pROC package)?

When I use multiclass.roc function in R (pROC package), for instance, I trained a data set by random forest, here is my code: # randomForest & pROC packages should be installed: # install.packages(c('randomForest',…
zhaoyin.usm
  • 251
  • 1
  • 6
  • 10
5
votes
1 answer

What does coercing the "direction" argument input in roc function (package pROC in R) do exactly?

I want to create a roc object by using the function 'roc' of pROC package in R, and plot the roc object. However, I am uncertain what the 'direction' argument does. the median predictor values of my controls is smaller than the median predictor…
layover
  • 155
  • 2
  • 6
4
votes
1 answer

How to draw multiple roc curves with confidence interval in pROC?

This code can draw a roc curve with confidence interval: ciobj <- ci.se(obj, specificities=seq(0, 1, l=25)) dat.ci <- data.frame(x = as.numeric(rownames(ciobj)), lower = ciobj[, 1], upper = ciobj[,…
teethdiao
  • 43
  • 1
  • 3
4
votes
1 answer

How to get p value after ROC analysis with pRoc package?

After ROC analysis of a set of data, how to calculate p-value? With the same statistics, I saw that the p-value can be output in SPSS. The sample code is as follows: library(pROC) data(aSAH) head(aSAH) # gos6 outcome gender age wfns s100b …
dbcoffee
  • 173
  • 1
  • 8
4
votes
1 answer

Use pROC package with h2o

I'm doing a binary classification with a GBM using the h2o package. I want to assess the predictive power of a certain variable, and if I'm correct I can do so by comparing the AUC of a model with the specific variable and a model without the…
Zuaro
  • 73
  • 5
4
votes
3 answers

ROC function error "Predictor must be numeric or ordered."

I am not able to get ROC function to work, I get the error "Predictor must be numeric or ordered". I've looked through other posts, but nothing solves my problem. Any help is highly appreciated. "Get…
MJ O
  • 111
  • 1
  • 1
  • 8
4
votes
1 answer

R - ROC Curves/AUC Specificity vs 1-Specificity

I have created a few predictive models and I am in the process of evaluating them by looking at the ROC Curve and AUC. Currently, I have Specificity on X axis, however, when I researched ROC Curves, I saw 1 - Specificity on the X axis. What is the…
MhQ-6
  • 328
  • 3
  • 11
4
votes
1 answer

faced_wrap plot with pROC package in R (several variables)

I have three independent variable and a single binary outcome variable. I'm using pROC package for the analysis and would like to present all three ROC plots next to each other, similar to face_wrap functionality. For example, using the following…
Arnold Klein
  • 2,956
  • 10
  • 31
  • 60
4
votes
3 answers

pROC ROC curves remove empty space

I want to draw ROC curves with pRoC. However for some reason there is extra empty space on either side of the x-axis and I cannot remove it with xlim. Some example code: library(pROC) n = c(4, 3, 5) b = c(TRUE, FALSE, TRUE) df = data.frame(n, b)…
Hendrik
  • 135
  • 2
  • 8
3
votes
1 answer

How to add AUC to a multiple ROC graph with pROC's ggroc

I have a list of elements of the class "roc" (l_rocs) which I want to plot with ggroc from the package pROC library("ggplot2") library("pROC") #inside a bigger loop l_rocs[[names[[i]]]] <- roc(predictor=gbm.probs$Yes, …
Patrick
  • 125
  • 1
  • 7
3
votes
2 answers

Error running pROC in R: Response and predictor must be vectors of the same length

I've called a multiple logistic regression as follows: step_1 <- glm(CD3LR ~ alb + surg + ASA_opt + BMI + bil + Hb_cat + MDRD + sex + DM + age + Path + Smoking, na.action = na.exclude, family = binomial) When I want to…
donm79
  • 31
  • 1
  • 3
3
votes
2 answers

Calculating multiple ROC curves in R using a for loop and pROC package. What variable to use in the predictor field?

I am using the pROC package and I want to calculate multiple ROC curve plots using a for loop. My variables are specific column names that are included as string in a vector and I want pROC to read sequentially that vector and use the strings in the…
Garrus
  • 43
  • 4
3
votes
1 answer

ROC curves for Random Forest fit objects using pROC in R, to use positve or negative "votes" as predictor

Obese is a binary response var with 1 indicating obese and 0 not obese. Weight is a continuous predictor. using a RF to classify obese: library(randomFores) rf <- randomForest(factor(obese)~weight) gives us a fit object containing: > summary(rf) …
Forevertrip
  • 33
  • 1
  • 1
  • 4
1
2 3 4 5 6