Bases de datos, para este ejercicio se encuentran en G-Drive
datos <- read.table("clipboard", h=T,
stringsAsFactors = TRUE)
names(datos)
## [1] "growth" "coat"
head(datos); tail(datos)
## # A tibble: 6 x 2
## growth coat
## <dbl> <fct>
## 1 8.3 dark
## 2 8.7 dark
## 3 8.1 dark
## 4 8.5 dark
## 5 9.1 dark
## 6 9 dark
## # A tibble: 6 x 2
## growth coat
## <dbl> <fct>
## 1 6.6 light
## 2 7.2 light
## 3 6.9 light
## 4 8.3 light
## 5 7.9 light
## 6 9.2 light
summary(datos)
## growth coat
## Min. :6.600 dark :6
## 1st Qu.:7.725 light:6
## Median :8.300
## Mean :8.150
## 3rd Qu.:8.775
## Max. :9.200
datos$growth ~ datos$coat
plot(datos$growth ~ datos$coat, pch=20)
t.test(datos$growth ~ datos$coat, alternative="greater")
##
## Welch Two Sample t-test
##
## data: datos$growth by datos$coat
## t = 2.1765, df = 6.5768, p-value = 0.03423
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 0.112961 Inf
## sample estimates:
## mean in group dark mean in group light
## 8.616667 7.683333