Categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

Zuzanna Chmielewska

Actuary

categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

nominale categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

ordinale categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

voorbeeld van nominale categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

voorbeeld van ordinale categorische data

Oefenen met statistiek-vragen voor sollicitaties in R

Factors in R

x1 <- c("AB", "A", "O", "AB", "B", "B")

lvls <- c("A", "B", "AB", "O")
x2 <- factor(x1, levels = lvls)
print(x2)
[1] AB A  O  AB B  B 
Levels: A B AB O
Oefenen met statistiek-vragen voor sollicitaties in R

Factors in R

x1 <- c("M", "L" , "L", "XS", "XL", "S")

lvls <- c("XS", "S", "M", "L", "XL")
x2 <- factor(x1, levels = lvls, ordered = TRUE)
print(x2)
[1] M  L  L  XS XL S 
Levels: XS < S < M < L < XL
Oefenen met statistiek-vragen voor sollicitaties in R

kruistabel in R

Oefenen met statistiek-vragen voor sollicitaties in R

kruistabel in R

Oefenen met statistiek-vragen voor sollicitaties in R

kruistabel in R

Oefenen met statistiek-vragen voor sollicitaties in R

staafdiagram in R

Oefenen met statistiek-vragen voor sollicitaties in R

functie tapply in R

Oefenen met statistiek-vragen voor sollicitaties in R

functie tapply in R

Oefenen met statistiek-vragen voor sollicitaties in R

functie tapply in R

Oefenen met statistiek-vragen voor sollicitaties in R
tapply(df$value, df$level, mean)

functie tapply in R

Oefenen met statistiek-vragen voor sollicitaties in R

Codering van categorische data

  • label encoding
  • one-hot encoding
  • en meer!
Oefenen met statistiek-vragen voor sollicitaties in R

Labelcodering

labelcodering

Oefenen met statistiek-vragen voor sollicitaties in R

Labelcodering

labelcodering

Oefenen met statistiek-vragen voor sollicitaties in R

Labelcodering

labelcodering

Oefenen met statistiek-vragen voor sollicitaties in R

Labelcodering

labelcodering

Oefenen met statistiek-vragen voor sollicitaties in R

Labelcodering

labelcodering

Oefenen met statistiek-vragen voor sollicitaties in R

One-hot encoding

one-hot encoding

Oefenen met statistiek-vragen voor sollicitaties in R

One-hot encoding

one-hot encoding

Oefenen met statistiek-vragen voor sollicitaties in R

One-hot encoding

one-hot encoding

Oefenen met statistiek-vragen voor sollicitaties in R

One-hot encoding

one-hot encoding

Oefenen met statistiek-vragen voor sollicitaties in R

One-hot encoding

one-hot encoding

Oefenen met statistiek-vragen voor sollicitaties in R

Samenvatting

  • typen categorische data
  • factors in R
  • analyse van categorische data
    • table()
    • barplot()
    • tapply()
  • datacodering
    • labelcodering
    • one-hot encoding
Oefenen met statistiek-vragen voor sollicitaties in R

Laten we oefenen!

Oefenen met statistiek-vragen voor sollicitaties in R

Preparing Video For Download...