Lestur gagna og fyrsta skoðun

HALLÓ. ÞETTA ER SKÝRSLAN MÍN ÚR VERKEFNI 1!

beauty <- read.table('beauty2.txt', row.names = 1)

require(tidyverse); require(knitr)

kable(
    beauty %>%
        gather(value_type, value) %>%
        group_by(value_type) %>%
        summarise(mean = mean(value), 
                  sd = sd(value), 
                  IQR = IQR(value), 
                  '0%' = min(value),
                  '50%' = median(value),
                  '100%' = max(value))
    )
value_type mean sd IQR 0% 50% 100%
beauty 0.0000001 0.8275057 1.284798 -1.538843 -0.1281433 1.881674
eval 3.9127660 0.5937369 0.700000 2.100000 4.0000000 4.900000
female 0.4255319 0.4970745 1.000000 0.000000 0.0000000 1.000000
lower 0.3085106 0.4643552 1.000000 0.000000 0.0000000 1.000000
minority 0.1276596 0.3354997 0.000000 0.000000 0.0000000 1.000000
nonenglish 0.0744681 0.2639388 0.000000 0.000000 0.0000000 1.000000
onecredit 0.0425532 0.2029298 0.000000 0.000000 0.0000000 1.000000
prof 47.5000000 27.2794184 46.500000 1.000000 47.5000000 94.000000
tenuretrack 0.8404255 0.3681746 0.000000 0.000000 1.0000000 1.000000

Myndrit

OG MYNDRIT

require(ggplot2); require(papaja)

beauty %>%
    mutate(Sex = factor(female, levels = c(1, 0), labels = c('Female', 'Male')),
           minority = factor(minority, levels = c(1, 0), labels = c('Minority', 'Non-Minority'))) %>%
    select(eval, beauty, Sex, minority) %>%
    gather(value_type, value, -Sex, -minority) %>%
    ggplot(aes(Sex, value, col = Sex, shape = Sex)) +
    facet_grid(minority ~ value_type) +
    geom_boxplot()+ geom_jitter(height = 0) + xlab('') + ylab('') +
    theme_apa()