spec_sens: Calculate specificity and sensitivity on FSPmix simulation...

Description Usage Arguments Value Author(s) Examples

View source: R/spec_sens.r

Description

Compute 2 by 2 confusion matrix as a ratio as well as with numerical values.

Usage

1
spec_sens(real.dat, pred.dat)

Arguments

real.dat

Vector of simulated data which was fed to FSPmix algorithm for a particular feature. Feature classified into groups A or B.

pred.dat

Vector of predictions for a particular feature, classified into either groups A or B.

Value

tot.obs

Total number of observations classified

conf.mat

Sensitivity and specificity values on a 2 x 2 confusion matrix

con.mat.ratio

Sensitivity and specificity percentages, 2 x 2 matrix

Author(s)

Marcela Cespedes

Examples

1
2
3
4
5
6
7
8
9
set.seed(123)

real.data<- data.frame(ppl = 1:100,
                      group = sample(c("A", "B"), size = 100,prob = c(0.5, 0.5), replace=TRUE ))

pred.data<- data.frame(ppl = 1:100,
                       Pred = sample(c("Pred.A", "Pred.B"), size = 100,prob = c(0.5, 0.5), replace=TRUE ))

spec_sens(real.dat = real.data, pred.dat = pred.data)

MarcelaCespedes/FSPmix documentation built on May 12, 2020, 5:49 p.m.