Klassifikation: Klassifikation

Description Usage Arguments Value Examples

View source: R/xtable-classification.R

Description

Classification Table classification_table Richtige und falsche Klassifikationen Bei 2x2 Tabellen der Kappa Test

Sensitivity = A/(A+C)

Specificity = D/(B+D)

Prevalence = (A+C)/(A+B+C+D)

PPV = (sensitivity * prevalence)/((sensitivity*prevalence) + ((1-specificity)*(1-prevalence)))

NPV = (specificity * (1-prevalence))/(((1-sensitivity)*prevalence) + ((specificity)*(1-prevalence)))

Detection Rate = A/(A+B+C+D)

Detection Prevalence = (A+B)/(A+B+C+D)

Balanced Accuracy = (sensitivity+specificity)/2

Precision = A/(A+B)

Recall = A/(A+C)

F1 = (1+beta^2)*precision*recall/((beta^2 * precision)+recall)

Klassifikation fuer Binominal-GLM und zeigt die ...

Klassifikation.glm

xtabs-Objekt

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
Klassifikation(x, ...)

Klassifikation2(
  x,
  ...,
  caption = "",
  include.xtab = TRUE,
  include.statistics = TRUE
)

## S3 method for class 'glm'
Klassifikation(x, thresh = 0.5, caption = "Klassifikation", ...)

## S3 method for class 'xtabs'
Klassifikation(
  x,
  lvs = c("positiv", "negativ"),
  digits = 2,
  prevalence = NULL,
  ...
)

Arguments

x

glm oder xtab Objekt

...

weitere Objekte nicht benutzt

caption

an Output

thresh

Klassifikation auf Basis der Vorhersage Schwelle bei P=0.5

Value

A data.frame Objekt.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
##https://www.hranalytics101.com/how-to-assess-model-accuracy-the-basics/



Kappa2(x<-xtabs(~gruppe+lai, hkarz))
head(hkarz)

fit1<- glm(gruppe~lai, hkarz, family = binomial)
#thkarz <- as.data.frame(xtabs(~gruppe+lai, hkarz))
#fit2<- glm(Freq ~ gruppe*lai, thkarz, family = poisson())

tab <- Klassifikation(x)$statistic[c(1,7,8),]
x2 <- Klassifikation(fit1)
tab$fit <- x2$statistic[c(1,7,8), 2]
tab

require(pROC)
roc_curve   <- roc(x2$response, x2$predictor)
windows(8,8)
plot(roc_curve, print.thres = "best",
     print.auc=TRUE)
abline(v = 1, lty = 2)
abline(h = 1, lty = 2)
#text(.90, .97, labels = "Ideal Model")
#points(1,1, pch = "O", cex = 0.5)
#fit1<- glm(gruppe~lai, hkarz, family = binomial)
#thkarz <- as.data.frame(xtabs(~gruppe+lai, hkarz))
#fit2<- glm(Freq ~ gruppe*lai, thkarz, family = poisson())

hkarz$LAI<- factor(hkarz$lai, 0:1, c("pos", "neg"))
APA2(xtabs(~gruppe+LAI, hkarz), test=TRUE, type="fischer")

stp4/stp25stat documentation built on Sept. 17, 2021, 2:03 p.m.