set.seed(123)
cra =rnorm(80, mean = 2.8, sd = 0.2)
hist(cra, xlim = c(2.2, 3.4), ylim = c(0, 20))
abline(v= mean(cra), col= "orange" , lwd=3)
library(readxl)
## Warning: package 'readxl' was built under R version 4.2.2
datos <- read_excel("datos excel.xlsx")
View(datos)
plot(datos$cra60, datos$cra80,
pch = 16, cex=1.5, xlab = 'CRA60', ylab = 'CRA 80')
#coeficiente de correlación
cor(datos$cra60, datos$cra80)
## [1] 0.9786099
# EJEMPLOS
\[H_0: \mu_{CRA_{60}} = \mu_{CRA_{80}}\]
#PRUEBA 3
# PRUEBA t-studen para dos muestras pareadas
prueba3 = t.test(datos$cra60, datos$cra80, alternative = 't' , # t = two.sided
mu = 0,
paired = TRUE )
ifelse(prueba3 $p.value<0.05, 'rechazo Ho', 'no rechazo Ho')
## [1] "rechazo Ho"
boxplot(datos)