Van los cuadros que serna usados para el articulo
load("~/Dropbox/especialidad_nutricion/datos/BHU/bhu_2011_2013.RData")
tabla1 <- table(bhu_2011_csv$FUMA, bhu_2011_csv$SEXO)
round(prop.table(tabla1, 2) * 100, 1)
##
## F M
## no 83.6 84.1
## si 16.4 15.9
fisher.test(tabla1)
##
## Fisher's Exact Test for Count Data
##
## data: tabla1
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.3483 2.6774
## sample estimates:
## odds ratio
## 0.9658
chisq.test(tabla1)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla1
## X-squared = 0, df = 1, p-value = 1
tabla2 <- table(bhu_2011_csv$PASAFUM, bhu_2011_csv$SEXO)
round(prop.table(tabla2, 2) * 100, 1)
##
## F M
## no 50.9 56.7
## si 49.1 43.3
fisher.test(tabla2)
##
## Fisher's Exact Test for Count Data
##
## data: tabla2
## p-value = 0.5805
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.3588 1.7470
## sample estimates:
## odds ratio
## 0.7936
chisq.test(tabla2)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla2
## X-squared = 0.1957, df = 1, p-value = 0.6582
tabla3 <- table(bhu_2011_csv$BEBIDA, bhu_2011_csv$SEXO)
round(prop.table(tabla3, 2) * 100, 1)
##
## F M
## 50.7 24.6
## cerveza 20.9 20.3
## martini 1.5 0.0
## vino 14.9 27.5
## vodka 3.0 0.0
## whisky 9.0 27.5
chisq.test(tabla3)
## Warning: Chi-squared approximation may be incorrect
##
## Pearson's Chi-squared test
##
## data: tabla3
## X-squared = 18.19, df = 5, p-value = 0.002713
library(car)
## Loading required package: MASS
## Loading required package: nnet
bhu_2011_csv$FRECCONS.rec <- recode(bhu_2011_csv$FRECCONS, "0=0;4:5=1;3=2;1=3;2=3;")
table(bhu_2011_csv$FRECCONS, bhu_2011_csv$FRECCONS.rec)
##
## 0 1 2 3
## 0 11 0 0 0
## 1 0 0 0 3
## 2 0 0 0 5
## 3 0 0 53 0
## 4 0 28 0 0
## 5 0 36 0 0
tabla4 <- table(bhu_2011_csv$FRECCONS.rec, bhu_2011_csv$SEXO)
round(prop.table(tabla4, 2) * 100, 1)
##
## F M
## 0 6.0 10.1
## 1 62.7 31.9
## 2 28.4 49.3
## 3 3.0 8.7
chisq.test(tabla4)
## Warning: Chi-squared approximation may be incorrect
##
## Pearson's Chi-squared test
##
## data: tabla4
## X-squared = 13.29, df = 3, p-value = 0.004055
tabla5 <- table(bhu_2011_csv$IND_FRU_VER, bhu_2011_csv$SEXO)
round(prop.table(tabla5, 2) * 100, 1)
##
## F M
## Con Riesgo 85.1 85.5
## Sin Riesgo 14.9 14.5
chisq.test(tabla5)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla5
## X-squared = 0, df = 1, p-value = 1
fisher.test(tabla5)
##
## Fisher's Exact Test for Count Data
##
## data: tabla5
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.3329 2.8051
## sample estimates:
## odds ratio
## 0.9663
tabla6 <- table(bhu_2011_csv$COMNOPRE, bhu_2011_csv$SEXO)
round(prop.table(tabla6, 2) * 100, 1)
##
## F M
## 0 22.4 20.3
## 1 29.9 36.2
## 2 31.3 20.3
## 3 10.4 2.9
## 4 1.5 4.3
## 5 0.0 8.7
## 6 1.5 1.4
## 7 3.0 5.8
chisq.test(tabla6)
## Warning: Chi-squared approximation may be incorrect
##
## Pearson's Chi-squared test
##
## data: tabla6
## X-squared = 12.41, df = 7, p-value = 0.08792
tabla7 <- table(bhu_2011_csv$IND_BEB, bhu_2011_csv$SEXO)
round(prop.table(tabla7, 2) * 100, 1)
##
## F M
## 0 80.6 63.8
## 1 19.4 36.2
chisq.test(tabla7)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla7
## X-squared = 3.982, df = 1, p-value = 0.04598
fisher.test(tabla7)
##
## Fisher's Exact Test for Count Data
##
## data: tabla7
## p-value = 0.03581
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.017 5.619
## sample estimates:
## odds ratio
## 2.345
tabla8 <- table(bhu_2011_csv$AGREGASA, bhu_2011_csv$SEXO)
round(prop.table(tabla8, 2) * 100, 1)
##
## F M
## no 97.0 89.9
## si 3.0 10.1
chisq.test(tabla8)
## Warning: Chi-squared approximation may be incorrect
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla8
## X-squared = 1.78, df = 1, p-value = 0.1821
fisher.test(tabla8)
##
## Fisher's Exact Test for Count Data
##
## data: tabla8
## p-value = 0.1654
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.6586 37.2384
## sample estimates:
## odds ratio
## 3.638
bhu_2011_csv$Act_Fis_Total.rec <- Act_Fis_Total.sem
tabla9 <- table(bhu_2011_csv$Act_Fis_Total.rec, bhu_2011_csv$SEXO)
round(prop.table(tabla9, 2) * 100, 1)
##
## F M
## 0 49.3 43.5
## 1 20.9 10.1
## 2 29.9 46.4
chisq.test(tabla9)
##
## Pearson's Chi-squared test
##
## data: tabla9
## X-squared = 5.217, df = 2, p-value = 0.07364
tabla10 <- table(bhu_2011_csv$ICC.rec, bhu_2011_csv$SEXO)
round(prop.table(tabla10, 2) * 100, 1)
##
## F M
## CR 47.8 39.1
## SR 52.2 60.9
chisq.test(tabla10)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla10
## X-squared = 0.7095, df = 1, p-value = 0.3996
fisher.test(tabla10)
##
## Fisher's Exact Test for Count Data
##
## data: tabla10
## p-value = 0.3871
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.6814 2.9729
## sample estimates:
## odds ratio
## 1.418
tabla11 <- table(bhu_2011_csv$PREART, bhu_2011_csv$SEXO)
round(prop.table(tabla11, 2) * 100, 1)
##
## F M
## no 74.6 65.2
## si 25.4 34.8
chisq.test(tabla11)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla11
## X-squared = 1.017, df = 1, p-value = 0.3132
fisher.test(tabla11)
##
## Fisher's Exact Test for Count Data
##
## data: tabla11
## p-value = 0.2651
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.7031 3.5358
## sample estimates:
## odds ratio
## 1.563
tabla12 <- table(bhu_2011_csv$COLES, bhu_2011_csv$SEXO)
round(prop.table(tabla12, 2) * 100, 1)
##
## F M
## no 73.1 60.9
## si 26.9 39.1
chisq.test(tabla12)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla12
## X-squared = 1.789, df = 1, p-value = 0.1811
fisher.test(tabla12)
##
## Fisher's Exact Test for Count Data
##
## data: tabla12
## p-value = 0.1474
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.7989 3.8704
## sample estimates:
## odds ratio
## 1.743
tabla13 <- table(bhu_2011_csv$GLICEMIA, bhu_2011_csv$SEXO)
round(prop.table(tabla13, 2) * 100, 1)
##
## F M
## no 86.6 89.9
## si 13.4 10.1
chisq.test(tabla13)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla13
## X-squared = 0.1081, df = 1, p-value = 0.7423
fisher.test(tabla13)
##
## Fisher's Exact Test for Count Data
##
## data: tabla13
## p-value = 0.6029
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.2156 2.3640
## sample estimates:
## odds ratio
## 0.7293
levels(bhu_2011_csv$IMC.rec)
## [1] "NP" "Ob" "SP"
bhu_2011_csv$IMC.rec <- recode(bhu_2011_csv$IMC.rec, "'NP'='1-NP';'Ob'='3-Ob';'1-SP'='2-SP'")
tabla14 <- table(bhu_2011_csv$IMC.rec, bhu_2011_csv$SEXO)
round(prop.table(tabla14, 2) * 100, 1)
##
## F M
## 1-NP 44.8 29.0
## 3-Ob 16.4 18.8
## SP 38.8 52.2
chisq.test(tabla14)
##
## Pearson's Chi-squared test
##
## data: tabla14
## X-squared = 3.751, df = 2, p-value = 0.1533
tabla15 <- table(bhu_2011_csv$IMC.rec, bhu_2011_csv$PREART)
round(prop.table(tabla15, 2) * 100, 1)
##
## no si
## 1-NP 42.1 24.4
## 3-Ob 13.7 26.8
## SP 44.2 48.8
round(prop.table(tabla15, 1) * 100, 1)
##
## no si
## 1-NP 80.0 20.0
## 3-Ob 54.2 45.8
## SP 67.7 32.3
chisq.test(tabla15)
##
## Pearson's Chi-squared test
##
## data: tabla15
## X-squared = 5.38, df = 2, p-value = 0.06788
tabla16 <- table(bhu_2011_csv$IMC.rec, bhu_2011_csv$COLES)
round(prop.table(tabla16, 2) * 100, 1)
##
## no si
## 1-NP 36.3 37.8
## 3-Ob 16.5 20.0
## SP 47.3 42.2
round(prop.table(tabla16, 1) * 100, 1)
##
## no si
## 1-NP 66.0 34.0
## 3-Ob 62.5 37.5
## SP 69.4 30.6
chisq.test(tabla16)
##
## Pearson's Chi-squared test
##
## data: tabla16
## X-squared = 0.3969, df = 2, p-value = 0.82
tabla17 <- table(bhu_2011_csv$IMC.rec, bhu_2011_csv$GLICEMIA)
round(prop.table(tabla17, 2) * 100, 1)
##
## no si
## 1-NP 40.0 12.5
## 3-Ob 15.8 31.2
## SP 44.2 56.2
round(prop.table(tabla17, 1) * 100, 1)
##
## no si
## 1-NP 96.0 4.0
## 3-Ob 79.2 20.8
## SP 85.5 14.5
chisq.test(tabla17)
## Warning: Chi-squared approximation may be incorrect
##
## Pearson's Chi-squared test
##
## data: tabla17
## X-squared = 5.258, df = 2, p-value = 0.07217
tabla18 <- table(bhu_2011_csv$ICC.rec, bhu_2011_csv$PREART)
round(prop.table(tabla18, 2) * 100, 1)
##
## no si
## CR 36.8 58.5
## SR 63.2 41.5
round(prop.table(tabla18, 1) * 100, 1)
##
## no si
## CR 59.3 40.7
## SR 77.9 22.1
chisq.test(tabla18)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla18
## X-squared = 4.64, df = 1, p-value = 0.03123
fisher.test(tabla18)
##
## Fisher's Exact Test for Count Data
##
## data: tabla18
## p-value = 0.02396
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.1820 0.9315
## sample estimates:
## odds ratio
## 0.416
tabla19 <- table(bhu_2011_csv$ICC.rec, bhu_2011_csv$COLES)
round(prop.table(tabla19, 2) * 100, 1)
##
## no si
## CR 40.7 48.9
## SR 59.3 51.1
round(prop.table(tabla19, 1) * 100, 1)
##
## no si
## CR 62.7 37.3
## SR 70.1 29.9
chisq.test(tabla19)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla19
## X-squared = 0.529, df = 1, p-value = 0.467
fisher.test(tabla19)
##
## Fisher's Exact Test for Count Data
##
## data: tabla19
## p-value = 0.4623
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.3284 1.5674
## sample estimates:
## odds ratio
## 0.7181
tabla20 <- table(bhu_2011_csv$ICC.rec, bhu_2011_csv$GLICEMIA)
round(prop.table(tabla20, 2) * 100, 1)
##
## no si
## CR 38.3 81.2
## SR 61.7 18.8
round(prop.table(tabla20, 1) * 100, 1)
##
## no si
## CR 78.0 22.0
## SR 96.1 3.9
chisq.test(tabla18)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tabla18
## X-squared = 4.64, df = 1, p-value = 0.03123
fisher.test(tabla18)
##
## Fisher's Exact Test for Count Data
##
## data: tabla18
## p-value = 0.02396
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.1820 0.9315
## sample estimates:
## odds ratio
## 0.416