Commit 2516d9b1 authored by Andreas Leha's avatar Andreas Leha
Browse files

new: reference as generated by roxygen2

parent 7e418b43
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{ACCfromConfusion}
\alias{ACCfromConfusion}
\title{Calculate Accurcy Given the Confusion Matrix}
\usage{
ACCfromConfusion(x)
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
}
\value{
numerical. the accuracy
}
\description{
Calculate Accurcy Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
ACCfromConfusion(table(truth, prediction))
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{NPVfromConfusion}
\alias{NPVfromConfusion}
\title{Calculate NPV Given the Confusion Matrix}
\usage{
NPVfromConfusion(x, case = 2, predictionsin = "rows")
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
\item{case}{class label of the cases.}
\item{predictionsin}{character in \code{c("rows", "cols")}.}
}
\value{
numerical. the NPV
}
\description{
Calculate NPV Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
## predictions in columns
NPVfromConfusion(table(truth, prediction), case = "case", predictionsin = "cols")
## predictions in rows
NPVfromConfusion(table(prediction, truth), case = "case", predictionsin = "cols")
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{PERFfromConfusion}
\alias{PERFfromConfusion}
\title{Calculate Performance Given the Confusion Matrix}
\usage{
PERFfromConfusion(x, case = 2, predictionsin = "rows")
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
\item{case}{class label of the cases.}
\item{predictionsin}{character in \code{c("rows", "cols")}.}
}
\value{
data.frame. the accuracy, sensitivity, specificity, PPV, NPV
}
\description{
Calculate Performance Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
## predictions in columns
PERFfromConfusion(table(truth, prediction), case = "case", predictionsin = "cols")
## predictions in rows
PERFfromConfusion(table(prediction, truth), case = "case", predictionsin = "cols")
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{PPVfromConfusion}
\alias{PPVfromConfusion}
\title{Calculate Positive Predictive Value (PPV) Given the Confusion Matrix}
\usage{
PPVfromConfusion(x, case = 2, predictionsin = "rows")
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
\item{case}{class label of the cases.}
\item{predictionsin}{character in \code{c("rows", "cols")}.}
}
\value{
numerical. the PPV
}
\description{
Calculate Positive Predictive Value (PPV) Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
## predictions in columns
PPVfromConfusion(table(truth, prediction), case = "case", predictionsin = "cols")
## predictions in rows
PPVfromConfusion(table(prediction, truth), case = "case", predictionsin = "cols")
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{SENSfromConfusion}
\alias{SENSfromConfusion}
\title{Calculate Sensitivity Given the Confusion Matrix}
\usage{
SENSfromConfusion(x, case = 2, predictionsin = "rows")
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
\item{case}{class label of the cases.}
\item{predictionsin}{character in \code{c("rows", "cols")}.}
}
\value{
numerical. the sensitivity
}
\description{
Calculate Sensitivity Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
## predictions in columns
SENSfromConfusion(table(truth, prediction), case = "case", predictionsin = "cols")
## predictions in rows
SENSfromConfusion(table(prediction, truth), case = "case", predictionsin = "cols")
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{SPECfromConfusion}
\alias{SPECfromConfusion}
\title{Calculate Specificity Given the Confusion Matrix}
\usage{
SPECfromConfusion(x, case = 2, predictionsin = "rows")
}
\arguments{
\item{x}{2x2 matrix or data.frame. Typically the output of \code{link[base]{table}}}
\item{case}{class label of the cases.}
\item{predictionsin}{character in \code{c("rows", "cols")}.}
}
\value{
numerical. the specificity
}
\description{
Calculate Specificity Given the Confusion Matrix
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
## predictions in columns
SPECfromConfusion(table(truth, prediction), case = "case", predictionsin = "cols")
## predictions in rows
SPECfromConfusion(table(prediction, truth), case = "case", predictionsin = "cols")
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pinclaperf-package.R
\docType{package}
\name{binclaperf}
\alias{binclaperf}
\alias{binclaperf-package}
\title{binclaperf}
\description{
binclaperf
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confmat.R
\name{confmat2df}
\alias{confmat2df}
\title{Format Matrix as data.frame}
\usage{
confmat2df(x)
}
\arguments{
\item{x}{2x2 matrix.}
}
\value{
data.frame with proper column and row names
}
\description{
Format Matrix as data.frame
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- sample(c("control", "case"), size = n, replace = TRUE)
## confusion matrix
table(truth, prediction)
confmat2df(table(truth, prediction))
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roc.R
\name{pROCaucdf}
\alias{pROCaucdf}
\title{Extract Youden from pROC Object}
\usage{
pROCaucdf(roc)
}
\arguments{
\item{roc}{roc objcet from \code{\link[pROC]{roc}}}
}
\value{
data.frame with 1 row of columns sensitivities, specificities, thresholds
}
\description{
Extract Youden from pROC Object
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- runif(n = n)
## generate roc object without ci
rocobj <- pROC::roc(truth, prediction)
rocobj
pROCaucdf(rocobj)
## generate roc object with ci
rocobj <- pROC::roc(truth, prediction, ci = TRUE)
rocobj
pROCaucdf(rocobj)
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roc.R
\name{pROCdf}
\alias{pROCdf}
\title{Extract data.frame From pROC Object}
\usage{
pROCdf(roc)
}
\arguments{
\item{roc}{roc objcet from \code{\link[pROC]{roc}}}
}
\value{
data.frame with columns sensitivities, specificities, thresholds
}
\description{
Extract data.frame From pROC Object
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- runif(n = n)
rocobj <- pROC::roc(truth, prediction)
rocobj
pROCdf(rocobj)
}
\author{
Dr. Andreas Leha
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roc.R
\name{pROCyouden}
\alias{pROCyouden}
\title{Extract Youden from pROC Object}
\usage{
pROCyouden(roc)
}
\arguments{
\item{roc}{roc objcet from \code{\link[pROC]{roc}}}
}
\value{
data.frame with 1 row of columns sensitivities, specificities, thresholds
}
\description{
Extract Youden from pROC Object
}
\examples{
## draw data
n <- 50
truth <- sample(c("control", "case"), size = n, replace = TRUE)
prediction <- runif(n = n)
rocobj <- pROC::roc(truth, prediction)
rocobj
pROCyouden(rocobj)
}
\author{
Dr. Andreas Leha
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment