4

I have fitted a Logistic Regression using a dummy data as below,

set.seed(1)
binary <- sample(c(1,0), 9, replace = T)
outcome <- rnorm(9)
treatment <- rnorm(9)
glm_fit <- glm(binary ~ outcome + treatment, family=binomial())

I wonder if there is any direct function to calculate the Accuracy ratio for above fit.

Many thanks for your insight.

1 Answer 1

4

The accuracy ratio is just a transformation of the area under the ROC curve (page 39 of the document; page 47 of the PDF file). That means that any function that produces such AUC can help you here, for example:

auc <- pROC::roc(response=binary, predictor=predict(glm_fit))$auc
2*auc-1
#> 0.3333333
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.