📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊
##[POR ROIVER TAPIA GARCIA]
🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯
📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀 ## (i)Datos
library(readxl) X00_DATOS202460ULTIMOS25 <- read_excel(“00. DATOS202460ULTIMOS25.xlsx”) View(X00_DATOS202460ULTIMOS25)
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 4. =========->
##
## Femenino Masculino
## 42 32
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 5.=========->
pie_1<-pie(table_sexo, col=c("lightblue","pink"),
main="Estudio de Pastel.\n Distribución por sexos Roiver alejo.", labels = table_sexo)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 6. =========->
barp<-barplot(table_sexo, col = rainbow(5), border = "darkred",main = "Gráfico de Barras-Roiver alejo",sub = "UTB",xlab = "SEXO", ylab = "Conteo")
text(barp, table_sexo-30, labels = table_sexo)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 7. =========->
##
## Femenino Masculino
## 57 43
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 8. =========->
barp2<-barplot(table_sexo2, col = rainbow(5), border = "darkred",main = "Gráfico de Barras-Roiver alejo",sub = "UTB",xlab = "SEXO", ylab = "Porcentaje")
text(barp2, table_sexo2-30, labels = table_sexo2)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 9. =========->
pie_1<-pie(table_sexo2, col=c("lightblue","pink"),
main="Estudio de Pastel.\n Distribución por sexos.", labels = table_sexo2)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 10. =========->
##
## ESTADISTICAI PROBABILIDAD
## Femenino 16 26
## Masculino 10 22
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 11. =========->
barp3<-barplot(table_3,
main = "Gráfico de barras CURSO vs SEXO",
xlab = "CURSO", ylab = "Frecuencia",
col = c("pink", "blue"),
legend.text = rownames(table_3),
beside = TRUE) # Barras agrupadas
text(barp3, table_3-5, labels = table_3)
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 12. =========->
##
## ESTADISTICAI PROBABILIDAD
## Femenino 22 35
## Masculino 14 30
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 13. =========->
barp4<-barplot(table_4,
main = "Gráfico de barras CURSO vs SEXO en porcentajes",
xlab = "CURSO", ylab = "Frecuencia",
col = c("pink", "blue"),
legend.text = rownames(table_4),
beside = TRUE) # Barras agrupadas
text(barp4, table_4-5, labels = table_4)
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 14. =========->
##
## ESTADISTICAI PROBABILIDAD
## I 5 10
## II 7 18
## III 9 9
## IV 5 5
## V 0 5
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 15. =========->
barp3<-barplot(table_5,
main = "Gráfico de barras CURSO vs ESTRATO",
xlab = "CURSO", ylab = "Frecuencia",
col = rainbow(5),
legend.text = rownames(table_5),
beside = TRUE) # Barras agrupadas
text(barp3, table_5-1, labels = table_3)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 16. =========->
##
## Femenino Masculino
## I 8 7
## II 17 8
## III 10 8
## IV 4 6
## V 3 2
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 17. =========->
barp3<-barplot(table_6,
main = "Gráfico de barras CURSO vs ESTRATO",
xlab = "CURSO", ylab = "Frecuencia",
col = rainbow(5),
legend.text = rownames(table_6),
beside = TRUE) # Barras agrupadas
text(barp3, table_6-1, labels = table_6)🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##<-========== PASO 18. =========->
## [1] 20 18 19 18 19 20 18 19 18 22 18 19 17 17 19 20 20 19 19 21 18 19 19 19 18
## [26] 19 20 17 22 18 19 18 18 17 17 18 21 18 18 18 18 19 18 17 18 19 18 21 18 19
## [51] 18 21 18 19 17 18 19 18 19 18 18 20 18 18 18 19 19 18 22 18 18 20 19 18
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 19. =========->
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 17.0 18.0 18.0 18.7 19.0 22.0
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 20. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 21. =========->
## Warning in (function (z, notch = FALSE, width = NULL, varwidth = FALSE, : some
## notches went outside hinges ('box'): maybe set notch=FALSE
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠
##<-========== PASO 22. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 23. =========->
library(readxl)
x = DATOS2026$EDAD
z = DATOS2026$ESTRATO
boxplot(x~z, horizontal = TRUE, col = rainbow(3))
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 24. =========->
library(ggplot2)
ggplot(data= DATOS2026,mapping= aes(y=EDAD,x = ESTRATO, fill=SEXO))+geom_boxplot()+
scale_y_continuous(name = "EDAD") +
scale_x_discrete(labels = abbreviate, name = "ESTRATO")
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 25. =========->
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 153.0 163.0 168.0 168.4 174.0 192.0
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 26. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 27. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 28. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 29. =========->
library(ggplot2)
ggplot(data= DATOS2026,mapping= aes(y=ESTATURA,x = ESTRATO, fill=SEXO))+geom_boxplot()+
scale_y_continuous(name = "ESTATURA") +
scale_x_discrete(labels = abbreviate, name = "ESTRATO")🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 31. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 33. =========->
## [1] 7 32 21 0 7 4 0 3
## [1] 74
## [1] 9.459459 43.243243 28.378378 0.000000 9.459459 5.405405 0.000000
## [8] 4.054054
## [1] 7 39 60 60 67 71 71 74
## [1] 0.09459459 0.52702703 0.81081081 0.81081081 0.90540541 0.95945946 0.95945946
## [8] 1.00000000
## [1] 9.459459 52.702703 81.081081 81.081081 90.540541 95.945946 95.945946
## [8] 100.000000
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
##<-========== PASO 36. =========->
🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
####<-========== AQUI FINALIZA EL LABORATORIO 7. =========-> 🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈🌈🧪🌟💻✨🧠📈🔬⚗️📚💻🌈🧪🌟💻✨🧠📈
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
##
## ESTADISTICAI PROBABILIDAD
## Femenino 16 26
## Masculino 10 22
🌈🧪🌟💻✨🧠📈
barp_bv1 <- barplot(table_bv1,
main = "Gráfico de barras CURSO vs SEXO ROIVER GARCIA",
xlab = "CURSO", ylab = "Frecuencia",
col = c("pink", "blue"),
ylim = c(0, max(table_bv1) * 1.15),
legend.text = rownames(table_bv1),
args.legend = list(x = "topright"),
beside = TRUE) # Barras agrupadas
# Etiquetas encima de cada barra
text(barp_bv1, table_bv1, labels = table_bv1, pos = 3, cex = 0.8)🌈🧪🌟💻✨🧠📈
##
## ESTADISTICAI PROBABILIDAD
## I 5 10
## II 7 18
## III 9 9
## IV 5 5
## V 0 5
🌈🧪🌟💻✨🧠📈
barp_bv2 <- barplot(table_bv2,
main = "Gráfico de barras CURSO vs ESTRATO ROIVER GARCIA",
xlab = "CURSO", ylab = "Frecuencia",
col = rainbow(nrow(table_bv2)),
ylim = c(0, max(table_bv2) * 1.15),
legend.text = rownames(table_bv2),
args.legend = list(x = "topright"),
beside = TRUE) # Barras agrupadas
text(barp_bv2, table_bv2, labels = table_bv2, pos = 3, cex = 0.8)🌈🧪🌟💻✨🧠📈
boxplot(EDAD ~ SEXO, data = DATOS2026, horizontal = TRUE,
xlab = "EDAD", ylab = "SEXO ROIVER GARCIA",
col = rainbow(nlevels(factor(DATOS2026$SEXO))))🌈🧪🌟💻✨🧠📈
boxplot(EDAD ~ factor(ESTRATO), data = DATOS2026, horizontal = TRUE,
xlab = "EDAD", ylab = "ESTRATO ROIVER TAPIA",
col = rainbow(nlevels(factor(DATOS2026$ESTRATO))))🌈🧪🌟💻✨🧠📈
boxplot(ESTATURA ~ SEXO, data = DATOS2026, horizontal = TRUE,
xlab = "ESTATURA", ylab = "SEXO ROIVER TAPIA",
col = rainbow(nlevels(factor(DATOS2026$SEXO))))🌈🧪🌟💻✨🧠📈
x <- DATOS2026$ESTATURA
y <- DATOS2026$PESO
plot(x, y, xlab = "ESTATURA", ylab = "PESO", pch = 19, col = "tomato")
# Líneas punteadas en los valores medios
abline(v = mean(x, na.rm = TRUE), lwd = 3, lty = 2)
abline(h = mean(y, na.rm = TRUE), lwd = 3, lty = 2)Medias:
## [1] 168.3919
## [1] 63.32432
🌈🧪🌟💻✨🧠📈
##
## Call:
## lm(formula = PESO ~ ESTATURA, data = DATOS2026)
##
## Coefficients:
## (Intercept) ESTATURA
## -84.1267 0.8756
🌈🧪🌟💻✨🧠📈
##
## Call:
## lm(formula = ESTATURA ~ PESO, data = DATOS2026)
##
## Coefficients:
## (Intercept) PESO
## 137.0763 0.4945
🌈🧪🌟💻✨🧠📈
summary##
## Call:
## lm(formula = ESTATURA ~ PESO, data = DATOS2026)
##
## Residuals:
## Min 1Q Median 3Q Max
## -13.7479 -4.6462 -0.2041 4.1066 16.1973
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 137.07631 4.28941 31.957 < 2e-16 ***
## PESO 0.49453 0.06669 7.416 1.88e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.47 on 72 degrees of freedom
## Multiple R-squared: 0.433, Adjusted R-squared: 0.4252
## F-statistic: 54.99 on 1 and 72 DF, p-value: 1.881e-10
🌈🧪🌟💻✨🧠📈
Los coeficientes y el coeficiente de correlación se calculan automáticamente (no hace falta copiarlos a mano).
r <- cor(DATOS2026$ESTATURA, DATOS2026$PESO, use = "complete.obs")
a1 <- coef(regresion1)[1] # Intercepto
b1 <- coef(regresion1)[2] # Pendiente
plot(DATOS2026$ESTATURA, DATOS2026$PESO,
xlab = "ESTATURA", ylab = "PESO", pch = 19, col = "tomato",
main = sprintf("y_ajus = a + bx = %.4f + %.4f x, r = %.4f", a1, b1, r))
abline(v = mean(DATOS2026$ESTATURA, na.rm = TRUE), lwd = 3, lty = 2)
abline(h = mean(DATOS2026$PESO, na.rm = TRUE), lwd = 3, lty = 2)
abline(regresion1, col = "steelblue", lwd = 2)🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯
En la siguiente base de datos se encuentran los pesos y estaturas de 25 estudiantes seleccionados al azar de un grupo de Estadística I de la UTB. Complete el siguiente formulario de preguntas.
taller_rl <- data.frame(
peso = c(88, 77, 68, 80, 68, 55, 89, 61, 72, 72, 79, 75, 68,
65, 70, 52, 78, 55, 96, 75, 44, 57, 60, 50, 93),
estatura = c(175, 183, 158, 165, 175, 160, 160, 156, 174, 171, 160, 184, 163,
176, 167, 172, 168, 167, 181, 175, 153, 154, 169, 168, 187)
)
nrow(taller_rl) # número de estudiantes## [1] 25
🧪🌟💻✨🧠📈
plot(taller_rl$peso, taller_rl$estatura,
xlab = "PESO", ylab = "ESTATURA", pch = 19, col = "tomato")
abline(v = mean(taller_rl$peso), lwd = 3, lty = 2)
abline(h = mean(taller_rl$estatura), lwd = 3, lty = 2)Medias:
## [1] 69.88
## [1] 168.84
🧪🌟💻✨🧠📈
## [1] 0.5133798
Como r = 0.5134, se concluye que existe una relación lineal positiva y moderada entre el peso y la estatura.
🧪🌟💻✨🧠📈
##
## Call:
## lm(formula = estatura ~ peso, data = taller_rl)
##
## Coefficients:
## (Intercept) peso
## 143.9296 0.3565
summary##
## Call:
## lm(formula = estatura ~ peso, data = taller_rl)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15.656 -6.614 1.404 6.247 13.335
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 143.9296 8.8404 16.281 4.06e-14 ***
## peso 0.3565 0.1242 2.869 0.00867 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.315 on 23 degrees of freedom
## Multiple R-squared: 0.2636, Adjusted R-squared: 0.2315
## F-statistic: 8.231 on 1 and 23 DF, p-value: 0.008673
Diagrama de dispersión con la recta ajustada:
plot(taller_rl$peso, taller_rl$estatura,
xlab = "PESO", ylab = "ESTATURA", pch = 19, col = "tomato",
main = sprintf("estatura = %.4f + %.4f peso",
coef(regresion3)[1], coef(regresion3)[2]))
abline(v = mean(taller_rl$peso), lwd = 3, lty = 2)
abline(h = mean(taller_rl$estatura), lwd = 3, lty = 2)
abline(regresion3, col = "steelblue", lwd = 2)🧪🌟💻✨🧠📈
Los datos del fichero EdadPesoGrasas.txt corresponden a
tres variables medidas en 25 individuos: edad, peso y cantidad de grasas
en sangre.
grasas <- read.table("http://verso.mat.uam.es/~joser.berrendero/datos/EdadPesoGrasas.txt",
header = TRUE)
names(grasas)## [1] "peso" "edad" "grasas"
Si la URL ya no está disponible, descargue el archivo y use
read.table("EdadPesoGrasas.txt", header = TRUE).
🧪🌟💻✨🧠📈
## peso edad grasas
## peso 1.0000000 0.2400133 0.2652935
## edad 0.2400133 1.0000000 0.8373534
## grasas 0.2652935 0.8373534 1.0000000
🧪🌟💻✨🧠📈
##
## Call:
## lm(formula = grasas ~ edad, data = grasas)
##
## Residuals:
## Min 1Q Median 3Q Max
## -63.478 -26.816 -3.854 28.315 90.881
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 102.5751 29.6376 3.461 0.00212 **
## edad 5.3207 0.7243 7.346 1.79e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 43.46 on 23 degrees of freedom
## Multiple R-squared: 0.7012, Adjusted R-squared: 0.6882
## F-statistic: 53.96 on 1 and 23 DF, p-value: 1.794e-07
plot(grasas$edad, grasas$grasas, xlab = "Edad", ylab = "Grasas", pch = 19)
abline(regresion, col = "steelblue", lwd = 2)🧪🌟💻✨🧠📈
nuevas.edades <- data.frame(edad = seq(30, 50))
predicciones <- predict(regresion, nuevas.edades)
data.frame(edad = nuevas.edades$edad, grasas_predichas = round(predicciones, 2))Nota: las edades fuera del rango observado en los datos son extrapolaciones y deben interpretarse con cautela.
AQUÍ FINALIZA EL LABORATORIO 8
🧪