Alteracion gastrica vs sexo
library(survey)
##
## Attaching package: 'survey'
##
## The following object(s) are masked from 'package:graphics':
##
## dotchart
options(OutDec = ",")
library(car)
## Loading required package: MASS
## Loading required package: nnet
load("~/Dropbox/odontologia/maestria licet/octubre 2013/datos_licet_10112013.RData")
summary(diseniopost1$variables[, c(432, 447)])
## Sexo.rec AlterGastrica.rec
## 1-F:603 1-No :1062
## 2-M:551 2-Yes: 63
## NA's : 29
tabla.alter1 <- svyby(~AlterGastrica.rec, ~Sexo.rec, diseniopost1, svymean,
na.rm = TRUE)
round(ftable(tabla.alter1) * 100, 1)
## AlterGastrica.rec1-No AlterGastrica.rec2-Yes
## Sexo.rec
## 1-F svymean 95,5 4,5
## SE 0,8 0,8
## 2-M svymean 93,4 6,6
## SE 1,3 1,3
round(confint(tabla.alter1) * 100, 1)
## 2,5 % 97,5 %
## 1-F:AlterGastrica.rec1-No 93,9 97,2
## 2-M:AlterGastrica.rec1-No 90,8 96,0
## 1-F:AlterGastrica.rec2-Yes 2,8 6,1
## 2-M:AlterGastrica.rec2-Yes 4,0 9,2
svyby(~AlterGastrica.rec, ~Sexo.rec, diseniopost1, svytotal, na.rm = TRUE)
## Sexo.rec AlterGastrica.rec1-No AlterGastrica.rec2-Yes
## 1-F 1-F 12789 599,1
## 2-M 2-M 13418 947,3
## se.AlterGastrica.rec1-No se.AlterGastrica.rec2-Yes
## 1-F 140,3 112,3
## 2-M 237,9 189,2
svychisq(~AlterGastrica.rec + Sexo.rec, diseniopost1, statistic = "adjWald")
##
## Design-based Wald test of association
##
## data: svychisq(~AlterGastrica.rec + Sexo.rec, diseniopost1, statistic = "adjWald")
## F = 1,718, ndf = 1, ddf = 39, p-value = 0,1976
summary(svyglm(AlterGastrica.rec ~ Sexo.rec, diseniopost1, family = quasibinomial()))
##
## Call:
## svyglm(formula = AlterGastrica.rec ~ Sexo.rec, diseniopost1,
## family = quasibinomial())
##
## Survey design:
## postStratify(disenio1, ~categor.rec + Sexo, tabla.pob)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3,061 0,197 -15,57 <2e-16 ***
## Sexo.rec2-M 0,410 0,301 1,36 0,18
## ---
## Signif. codes: 0 '***' 0,001 '**' 0,01 '*' 0,05 '.' 0,1 ' ' 1
##
## (Dispersion parameter for quasibinomial family taken to be 0,9845)
##
## Number of Fisher Scoring iterations: 5
tabla.alter2 <- (svytable(~AlterGastrica.rec + Sexo.rec, diseniopost1, round = TRUE))
tabla.alter2
## Sexo.rec
## AlterGastrica.rec 1-F 2-M
## 1-No 12789 13418
## 2-Yes 599 947
fourfoldplot(svytable(~AlterGastrica.rec + Sexo.rec, diseniopost1, round = TRUE),
conf.level = 0.99, main = "Asociación entre Alteracion gastrica y sexo",
col = c(2, 4))
tabla.alter3 <- svytable(~Erosinbord + Sexo.rec + AlterGastrica.rec, diseniopost1,
round = TRUE)
ftable(tabla.alter3)
## AlterGastrica.rec 1-No 2-Yes
## Erosinbord Sexo.rec
## 0 1-F 12292 599
## 2-M 12231 887
## 1 1-F 314 0
## 2-M 892 0
fourfoldplot(tabla.alter3, conf.level = 0.99, main = "Asociación entre Erosion, Alteracion gastrica y sexo",
col = c(2, 4))