## [1] "Proyecto_Final.R"

PROYECTO FINAL DE ESTADÍSTICA

1. ESTADÍSTICA DESCRIPTIVA UNIVARIANTE

Para las variables cuantitativas:

Peso-Estatura-Promedio-Horas de sueño-Número de comidas-Tiempo de actividad física-Consumo promedio de agua

Peso

## [1] 150.042
## [1] 814.1391
## [1] 28.53312
## [1] 0.3655157
## [1] 0.1436051
## Median 
##  145.5
## 1st Qu.  Median 3rd Qu.    Max. 
##  130.00  145.50  170.75  230.00
##   Class limits  f   rf rf(%) cf cf(%)
##     [89.1,107)  4 0.05  5.19  4  5.19
##    [107,124.9) 11 0.14 14.29 15 19.48
##  [124.9,142.8) 15 0.19 19.48 30 38.96
##  [142.8,160.7) 18 0.23 23.38 48 62.34
##  [160.7,178.6) 17 0.22 22.08 65 84.42
##  [178.6,196.5)  5 0.06  6.49 70 90.91
##  [196.5,214.4)  2 0.03  2.60 72 93.51
##  [214.4,232.3)  2 0.03  2.60 74 96.10

Estatura

## [1] 1.678831
## [1] 0.008076247
## [1] 0.08986794
## [1] 0.1591616
## [1] -0.2014048
## Median 
##   1.68
## 1st Qu.  Median 3rd Qu.    Max. 
##    1.61    1.68    1.72    1.90
##   Class limits  f   rf rf(%) cf  cf(%)
##  [1.485,1.539)  4 0.05  5.19  4   5.19
##  [1.539,1.594)  8 0.10 10.39 12  15.58
##  [1.594,1.648) 13 0.17 16.88 25  32.47
##  [1.648,1.702) 27 0.35 35.06 52  67.53
##  [1.702,1.756) 11 0.14 14.29 63  81.82
##   [1.756,1.81)  9 0.12 11.69 72  93.51
##   [1.81,1.865)  3 0.04  3.90 75  97.40
##  [1.865,1.919)  2 0.03  2.60 77 100.00

Promedio

## [1] 7.746494
## [1] 0.1508099
## [1] 0.3883425
## [1] 0.3446106
## [1] 0.2051788
## Median 
##   7.71
## 1st Qu.  Median 3rd Qu.    Max. 
##    7.48    7.71    7.93    8.87
##   Class limits  f   rf rf(%) cf  cf(%)
##  [6.831,7.097)  3 0.04  3.90  3   3.90
##  [7.097,7.363)  5 0.06  6.49  8  10.39
##  [7.363,7.629) 26 0.34 33.77 34  44.16
##  [7.629,7.895) 19 0.25 24.68 53  68.83
##  [7.895,8.161) 10 0.13 12.99 63  81.82
##  [8.161,8.427) 11 0.14 14.29 74  96.10
##  [8.427,8.693)  2 0.03  2.60 76  98.70
##  [8.693,8.959)  1 0.01  1.30 77 100.00

Horas de sueño

## [1] 6.181818
## [1] 0.861244
## [1] 0.9280323
## [1] 0.03100946
## [1] 1.131801
## Median 
##      6
## 1st Qu.  Median 3rd Qu.    Max. 
##       6       6       7       9
##   Class limits  f   rf rf(%) cf  cf(%)
##   [3.96,4.601)  4 0.05  5.19  4   5.19
##  [4.601,5.242)  8 0.10 10.39 12  15.58
##  [5.242,5.884)  0 0.00  0.00 12  15.58
##  [5.884,6.525) 41 0.53 53.25 53  68.83
##  [6.525,7.166) 19 0.25 24.68 72  93.51
##  [7.166,7.808)  0 0.00  0.00 72  93.51
##  [7.808,8.449)  4 0.05  5.19 76  98.70
##   [8.449,9.09)  1 0.01  1.30 77 100.00

Número de comidas

## [1] 3.207792
## [1] 0.3773069
## [1] 0.6142531
## [1] 0.5498606
## [1] 0.9373438
## Median 
##      3
## 1st Qu.  Median 3rd Qu.    Max. 
##       3       3       4       5
##   Class limits  f   rf rf(%) cf  cf(%)
##   [1.98,2.364)  6 0.08  7.79  6   7.79
##  [2.364,2.748)  0 0.00  0.00  6   7.79
##  [2.748,3.131) 51 0.66 66.23 57  74.03
##  [3.131,3.515)  0 0.00  0.00 57  74.03
##  [3.515,3.899)  0 0.00  0.00 57  74.03
##  [3.899,4.282) 18 0.23 23.38 75  97.40
##  [4.282,4.666)  0 0.00  0.00 75  97.40
##   [4.666,5.05)  2 0.03  2.60 77 100.00

Tiempo de actividad física

## [1] 134.974
## [1] 32190.39
## [1] 179.4168
## [1] 3.944663
## [1] 20.71411
## Median 
##    120
## 1st Qu.  Median 3rd Qu.    Max. 
##      50     120     120    1260
##      Class limits  f   rf rf(%) cf  cf(%)
##       [0,159.075) 58 0.75 75.32 58  75.32
##  [159.075,318.15) 12 0.16 15.58 70  90.91
##  [318.15,477.225)  2 0.03  2.60 72  93.51
##   [477.225,636.3)  4 0.05  5.19 76  98.70
##   [636.3,795.375)  0 0.00  0.00 76  98.70
##  [795.375,954.45)  0 0.00  0.00 76  98.70
##  [954.45,1113.52)  0 0.00  0.00 76  98.70
##  [1113.52,1272.6)  1 0.01  1.30 77 100.00

Consumo promedio de agua

## [1] 14.95325
## [1] 60.77226
## [1] 7.795656
## [1] 0.4287464
## [1] -0.3587846
## Median 
##     15
## 1st Qu.  Median 3rd Qu.    Max. 
##       8      15      20      35
##     Class limits  f   rf rf(%) cf  cf(%)
##   [1.485,5.7181)  9 0.12 11.69  9  11.69
##  [5.7181,9.9512) 14 0.18 18.18 23  29.87
##  [9.9512,14.184) 15 0.19 19.48 38  49.35
##  [14.184,18.418) 12 0.16 15.58 50  64.94
##  [18.418,22.651) 14 0.18 18.18 64  83.12
##  [22.651,26.884)  8 0.10 10.39 72  93.51
##  [26.884,31.117)  3 0.04  3.90 75  97.40
##   [31.117,35.35)  2 0.03  2.60 77 100.00

Para las variables cualitativos:

Sexo

Frequency Percent
F 24 31.16883
M 53 68.83117
Total 77 100.00000

Frecuencia de actividad física - Univariante

Frequency Percent
1 19 24.675325
2 21 27.272727
3 22 28.571429
4 14 18.181818
5 1 1.298701
Total 77 100.000000

Técnicas de estudio - Univariante

Frequency Percent
0 3 3.896104
1 32 41.558442
2 42 54.545454
Total 77 100.000000

Realiza ejercicio - Univariante

Frequency Percent
1 55 71.428571
2 18 23.376623
4 4 5.194805
Total 77 100.000000

Intensidad de la actividad física - Univariante

Frequency Percent Valid.Percent
1 27 35.064935 41.538461
2 30 38.961039 46.153846
3 7 9.090909 10.769231
60 1 1.298701 1.538461
NA’s 12 15.584416 NA
Total 77 100.000000 100.000000

2. ESTADÍSTICA DESCRIPTIVA BIVARIANTE O MULTIVARIANTE

Para las variables cualitativas:

Sexo-Técnicas de estudio-Realiza ejercicio-Técnicas de estudio-Frecuencia de actividad física

Diagrama de cajas segmentado por la variable cualitativa Sexo

Para las variables cuantitativas:

Matriz de correlación

Covarianza

Peso Altura Promedio Horas.de.sueño Número.de.comidas Tiempo.actividad.física Consumo.promedio.de.agua
Peso 814.1390684 1.4601901 -0.3396047 0.1956387 3.6357756 223.2728934 41.8440581
Altura 1.4601901 0.0081416 -0.0015925 0.0064272 0.0036875 -0.9764809 0.2671696
Promedio -0.3396047 -0.0015925 0.1436645 -0.0022214 0.0298334 0.8218271 -0.1035935
Horas.de.sueño 0.1956387 0.0064272 -0.0022214 0.8952240 0.0596076 11.6782673 1.0657904
Número.de.comidas 3.6357756 0.0036875 0.0298334 0.0596076 0.3746760 28.4590892 0.7438726
Tiempo.actividad.física 223.2728934 -0.9764809 0.8218271 11.6782673 28.4590892 33428.1045909 575.4825620
Consumo.promedio.de.agua 41.8440581 0.2671696 -0.1035935 1.0657904 0.7438726 575.4825620 62.8058275

Matriz de diagrama de dispersión

Intervalos de confianza del 95%

## mean of x 
##  7.746494
## [1] 7.658351 7.834636
## attr(,"conf.level")
## [1] 0.95
## mean of x 
##  7.746494
## [1] 7.658351 7.834636
## attr(,"conf.level")
## [1] 0.95
## mean of x 
##  7.746494
## [1] 7.658351 7.834636
## attr(,"conf.level")
## [1] 0.95
## mean of x 
##  7.746494
## [1] 7.658351 7.834636
## attr(,"conf.level")
## [1] 0.95
## mean of x 
##  7.746494
## [1] 7.658351 7.834636
## attr(,"conf.level")
## [1] 0.95

Prueba de hipótesis

###Datos independientes por sexo

Prueba de hipótesis - Tiempo semanal promedio de actividad física

## 
##  Paired t-test
## 
## data:  masculino$Tiempo_semanal_promedio_actividad_fisica and masculino$Promedio
## t = 4.974, df = 52, p-value = 0.000003772
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
##  93.50249      Inf
## sample estimates:
## mean of the differences 
##                140.9636
## [1] 148.6415
## [1] 7.677925
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  femenino$Tiempo_semanal_promedio_actividad_fisica and femenino$Promedio
## V = 290, p-value = 0.00003361
## alternative hypothesis: true location shift is greater than 0
## [1] 105
## [1] 7.79

Prueba de hipótesis - Horas promedio diarias de sueño

## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  masculino$Horas_promedio_diarias_sueño and masculino$Horas_promedio_diarias_sueño
## V = 0, p-value = 1
## alternative hypothesis: true location shift is greater than 0
## [1] 148.6415
## [1] 6.207547
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  femenino$Tiempo_semanal_promedio_actividad_fisica and femenino$Horas_promedio_diarias_sueño
## V = 290, p-value = 0.00003194
## alternative hypothesis: true location shift is greater than 0
## [1] 105
## [1] 6

Prueba de hipótesis - Tiempo promedio por semana de actividad física

## 
##  Paired t-test
## 
## data:  masculino$Tiempo_semanal_promedio_actividad_fisica and masculino$Promedio
## t = 4.974, df = 52, p-value = 0.000003772
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
##  93.50249      Inf
## sample estimates:
## mean of the differences 
##                140.9636
## [1] 148.6415
## [1] 7.677925
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  femenino$Tiempo_semanal_promedio_actividad_fisica and femenino$Promedio
## V = 290, p-value = 0.00003361
## alternative hypothesis: true location shift is greater than 0
## [1] 105
## [1] 7.79

Prueba de hipótesis - Número de comidas diarias

## 
##  Paired t-test
## 
## data:  masculino$Numero_comidas_diarias and masculino$Promedio
## t = -52.546, df = 52, p-value = 1
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
##  -4.671261       Inf
## sample estimates:
## mean of the differences 
##               -4.526981
## [1] 3.150943
## [1] 7.677925
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  femenino$Numero_comidas_diarias and femenino$Promedio
## V = 0, p-value = 1
## alternative hypothesis: true location shift is greater than 0
## [1] 3
## [1] 7.79

Prueba de hipótesis - Consumo promedio semanal de agua

## 
##  Paired t-test
## 
## data:  masculino$Consumo_promedio_semanal_agua and masculino$Promedio
## t = 7.9743, df = 52, p-value = 0.00000000006988
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
##  7.176541      Inf
## sample estimates:
## mean of the differences 
##                 9.08434
## [1] 16.76226
## [1] 7.677925
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  femenino$Consumo_promedio_semanal_agua and femenino$Promedio
## V = 247, p-value = 0.002914
## alternative hypothesis: true location shift is greater than 0
## [1] 10
## [1] 7.79

Regresion lineal

##                                  Peso      Altura     Promedio Horas.de.sueño
## Peso                      1.000000000  0.56715966 -0.031401447    0.007246687
## Altura                    0.567159661  1.00000000 -0.046564043    0.075284317
## Promedio                 -0.031401447 -0.04656404  1.000000000   -0.006194212
## Horas.de.sueño            0.007246687  0.07528432 -0.006194212    1.000000000
## Número.de.comidas         0.208170801  0.06676549  0.128587858    0.102921823
## Tiempo.actividad.física   0.042798725 -0.05919065  0.011859048    0.067508223
## Consumo.promedio.de.agua  0.185048056  0.37362184 -0.034487182    0.142136624
##                          Número.de.comidas Tiempo.actividad.física
## Peso                            0.20817080              0.04279872
## Altura                          0.06676549             -0.05919065
## Promedio                        0.12858786              0.01185905
## Horas.de.sueño                  0.10292182              0.06750822
## Número.de.comidas               1.00000000              0.25429461
## Tiempo.actividad.física         0.25429461              1.00000000
## Consumo.promedio.de.agua        0.15334536              0.39716989
##                          Consumo.promedio.de.agua
## Peso                                   0.18504806
## Altura                                 0.37362184
## Promedio                              -0.03448718
## Horas.de.sueño                         0.14213662
## Número.de.comidas                      0.15334536
## Tiempo.actividad.física                0.39716989
## Consumo.promedio.de.agua               1.00000000

## 
## Call:
## lm(formula = Peso ~ Promedio, data = cuantitativas)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -59.244 -20.290  -4.063  21.595  80.425 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  168.320     68.646   2.452   0.0166 *
## Promedio      -2.364      8.867  -0.267   0.7906  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 28.72 on 72 degrees of freedom
## Multiple R-squared:  0.0009861,  Adjusted R-squared:  -0.01289 
## F-statistic: 0.07107 on 1 and 72 DF,  p-value: 0.7906

## 
## Call:
## lm(formula = Número.de.comidas ~ Promedio, data = cuantitativas)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.21571 -0.22973 -0.16483 -0.01999  1.84867 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)   1.5835     1.4611   1.084    0.282
## Promedio      0.2077     0.1887   1.100    0.275
## 
## Residual standard error: 0.6112 on 72 degrees of freedom
## Multiple R-squared:  0.01653,    Adjusted R-squared:  0.002876 
## F-statistic: 1.211 on 1 and 72 DF,  p-value: 0.2749

## 
## Call:
## lm(formula = Horas.de.sueño ~ Promedio, data = cuantitativas)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.1943 -0.1931 -0.1867  0.8064  2.8199 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  6.30875    2.27740   2.770  0.00712 **
## Promedio    -0.01546    0.29418  -0.053  0.95823   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9527 on 72 degrees of freedom
## Multiple R-squared:  3.837e-05,  Adjusted R-squared:  -0.01385 
## F-statistic: 0.002763 on 1 and 72 DF,  p-value: 0.9582

## 
## Call:
## lm(formula = Tiempo.actividad.física ~ Promedio, data = cuantitativas)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -139.75  -90.86  -17.95    9.50 1123.96 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)    92.16     440.06   0.209    0.835
## Promedio        5.72      56.84   0.101    0.920
## 
## Residual standard error: 184.1 on 72 degrees of freedom
## Multiple R-squared:  0.0001406,  Adjusted R-squared:  -0.01375 
## F-statistic: 0.01013 on 1 and 72 DF,  p-value: 0.9201

## 
## Call:
## lm(formula = Consumo.promedio.de.agua ~ Promedio, data = cuantitativas)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.646  -6.803  -0.188   4.977  20.114 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)  20.5540    19.0644   1.078    0.285
## Promedio     -0.7211     2.4626  -0.293    0.771
## 
## Residual standard error: 7.975 on 72 degrees of freedom
## Multiple R-squared:  0.001189,   Adjusted R-squared:  -0.01268 
## F-statistic: 0.08574 on 1 and 72 DF,  p-value: 0.7705