library(readxl)
library(latexpdf)
bd_elena <- read_excel("~/Desktop/2024_2025/TFGS/elena/bd_elena.xlsx")
#DATOS SOCIODEMOGRÁFICOS
library(sjPlot)
library(psych)
plot_frq(bd_elena$sexo)
bd_elena$curso<-factor(bd_elena$curso, levels = c("Primero", "Segundo", "Tercero", "Cuarto"))
plot_frq(bd_elena$curso)
plot_frq(bd_elena$cursor)
plot_frq(bd_elena$proce)
plot_frq(bd_elena$procer)
describeBy(bd_elena$edad)
## Warning in describeBy(bd_elena$edad): no grouping variable requested
#DATOS ANTECEDENTES DE ENFERMEDAD Y MEDICACIÓN
plot_frq(bd_elena$antecedentes)
table(bd_elena$ante_enfermedad)
##
## asma Asma
## 1 4
## ASMA Asma instrinseca
## 2 1
## asma por alergia polen Asma y alergia
## 1 1
## asma y alergia al polen y gramineas Asma, alergia
## 1 1
## asma, cancer de pulmon bronquitis
## 1 1
## Cáncer, alergia Silicosis
## 1 1
plot_frq(bd_elena$medicacion)
plot_frq(bd_elena$medicacion_tipo)
plot_frq(bd_elena$clinica)
plot_frq(bd_elena$N1a)
plot_frq(bd_elena$N1b)
plot_frq(bd_elena$N2a)
plot_frq(bd_elena$N2b)
#CONSUMO DE TABACO
plot_frq(bd_elena$N1)
plot_frq(bd_elena$N1R)
sjt.xtab(bd_elena$N1R, bd_elena$sexo, show.cell.prc = T, show.row.prc = T)
| N1R | sexo | Total | |
|---|---|---|---|
| Hombre | Mujer | ||
| Fuma |
4 23.5 % 3.9 % |
13 76.5 % 12.7 % |
17 100 % 16.6 % |
| No fuma |
19 22.4 % 18.6 % |
66 77.6 % 64.7 % |
85 100 % 83.3 % |
| Total |
23 22.5 % 22.5 % |
79 77.5 % 77.5 % |
102 100 % 100 % |
χ2=0.000 · df=1 · &phi=0.010 · Fisher’s p=1.000 |
sjt.xtab(bd_elena$N1R, bd_elena$cursor, show.cell.prc = T, show.row.prc = T)
| N1R | cursor | Total | |
|---|---|---|---|
| primero | segundo | ||
| Fuma |
6 35.3 % 5.9 % |
11 64.7 % 10.8 % |
17 100 % 16.7 % |
| No fuma |
34 40 % 33.3 % |
51 60 % 50 % |
85 100 % 83.3 % |
| Total |
40 39.2 % 39.2 % |
62 60.8 % 60.8 % |
102 100 % 100 % |
χ2=0.008 · df=1 · &phi=0.036 · Fisher’s p=0.791 |
sjt.xtab(bd_elena$N1R, bd_elena$procer, show.cell.prc = T, show.row.prc = T) #DIF
| N1R | procer | Total | |
|---|---|---|---|
| bachiller | no bachiller | ||
| Fuma |
5 29.4 % 4.9 % |
12 70.6 % 11.8 % |
17 100 % 16.7 % |
| No fuma |
59 69.4 % 57.8 % |
26 30.6 % 25.5 % |
85 100 % 83.3 % |
| Total |
64 62.7 % 62.7 % |
38 37.3 % 37.3 % |
102 100 % 100 % |
χ2=8.061 · df=1 · &phi=0.308 · Fisher’s p=0.005 |
sjt.xtab(bd_elena$N1R, bd_elena$antecedentes, show.cell.prc = T, show.row.prc = T)
| N1R | antecedentes | Total | |
|---|---|---|---|
| No | Sí | ||
| Fuma |
13 76.5 % 12.7 % |
4 23.5 % 3.9 % |
17 100 % 16.6 % |
| No fuma |
74 87.1 % 72.5 % |
11 12.9 % 10.8 % |
85 100 % 83.3 % |
| Total |
87 85.3 % 85.3 % |
15 14.7 % 14.7 % |
102 100 % 100 % |
χ2=0.563 · df=1 · &phi=0.111 · Fisher’s p=0.270 |
sjt.xtab(bd_elena$N1R, bd_elena$medicacion, show.cell.prc = T, show.row.prc = T)
| N1R | medicacion | Total | |
|---|---|---|---|
| No | Sí | ||
| Fuma |
14 82.4 % 13.7 % |
3 17.6 % 2.9 % |
17 100 % 16.6 % |
| No fuma |
79 92.9 % 77.5 % |
6 7.1 % 5.9 % |
85 100 % 83.4 % |
| Total |
93 91.2 % 91.2 % |
9 8.8 % 8.8 % |
102 100 % 100 % |
χ2=0.877 · df=1 · &phi=0.139 · Fisher’s p=0.170 |
#FUMADORES
describeBy(bd_elena$N14)
## Warning in describeBy(bd_elena$N14): no grouping variable requested
describeBy(bd_elena$N15)
## Warning in describeBy(bd_elena$N15): no grouping variable requested
plot_frq(bd_elena$N19)
plot_frq(bd_elena$N21)
plot_frq(bd_elena$N22)
## Preguntas del test de Fagerstrom
plot_frq(bd_elena$N23a)
plot_frq(bd_elena$N23b)
plot_frq(bd_elena$N23c)
plot_frq(bd_elena$N23d)
plot_frq(bd_elena$N23e)
plot_frq(bd_elena$N23f)
describeBy(bd_elena$FAG) #PUNTUACIÓN DE FAGERSTROM
## Warning in describeBy(bd_elena$FAG): no grouping variable requested
t.test(FAG~sexo, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: FAG by sexo
## t = 0.14665, df = 5.1016, p-value = 0.889
## alternative hypothesis: true difference in means between group Hombre and group Mujer is not equal to 0
## 95 percent confidence interval:
## -2.526847 2.834539
## sample estimates:
## mean in group Hombre mean in group Mujer
## 6.000000 5.846154
t.test(FAG~cursor, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: FAG by cursor
## t = 0.44675, df = 7.1611, p-value = 0.6683
## alternative hypothesis: true difference in means between group primero and group segundo is not equal to 0
## 95 percent confidence interval:
## -1.921027 2.821027
## sample estimates:
## mean in group primero mean in group segundo
## 6.20 5.75
t.test(FAG~procer, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: FAG by procer
## t = -0.31363, df = 4.9419, p-value = 0.7666
## alternative hypothesis: true difference in means between group bachiller and group no bachiller is not equal to 0
## 95 percent confidence interval:
## -3.690159 2.890159
## sample estimates:
## mean in group bachiller mean in group no bachiller
## 5.6 6.0
t.test(FAG~antecedentes, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: FAG by antecedentes
## t = -0.53893, df = 3.4672, p-value = 0.6226
## alternative hypothesis: true difference in means between group No and group Sí is not equal to 0
## 95 percent confidence interval:
## -3.548278 2.453040
## sample estimates:
## mean in group No mean in group Sí
## 5.785714 6.333333
t.test(FAG~medicacion, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: FAG by medicacion
## t = -0.44531, df = 1.2052, p-value = 0.7228
## alternative hypothesis: true difference in means between group No and group Sí is not equal to 0
## 95 percent confidence interval:
## -14.18562 12.78562
## sample estimates:
## mean in group No mean in group Sí
## 5.8 6.5
## Preguntas del test de Richmond
plot_frq(bd_elena$N24a)
plot_frq(bd_elena$N24b)
plot_frq(bd_elena$N24c)
plot_frq(bd_elena$N24d)
describeBy(bd_elena$RICH) #PUNTUACIÓN TEST DE RICHMOND
## Warning in describeBy(bd_elena$RICH): no grouping variable requested
t.test(RICH~sexo, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: RICH by sexo
## t = 0.9673, df = 14.993, p-value = 0.3487
## alternative hypothesis: true difference in means between group Hombre and group Mujer is not equal to 0
## 95 percent confidence interval:
## -1.273032 3.388417
## sample estimates:
## mean in group Hombre mean in group Mujer
## 6.750000 5.692308
t.test(RICH~cursor, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: RICH by cursor
## t = 0.35514, df = 6.6196, p-value = 0.7335
## alternative hypothesis: true difference in means between group primero and group segundo is not equal to 0
## 95 percent confidence interval:
## -3.728751 5.028751
## sample estimates:
## mean in group primero mean in group segundo
## 6.40 5.75
t.test(RICH~procer, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: RICH by procer
## t = 0.67794, df = 12.723, p-value = 0.51
## alternative hypothesis: true difference in means between group bachiller and group no bachiller is not equal to 0
## 95 percent confidence interval:
## -2.047480 3.914147
## sample estimates:
## mean in group bachiller mean in group no bachiller
## 6.600000 5.666667
t.test(RICH~antecedentes, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: RICH by antecedentes
## t = -0.89948, df = 14.96, p-value = 0.3826
## alternative hypothesis: true difference in means between group No and group Sí is not equal to 0
## 95 percent confidence interval:
## -2.968979 1.207074
## sample estimates:
## mean in group No mean in group Sí
## 5.785714 6.666667
t.test(RICH~medicacion, data=bd_elena)
##
## Welch Two Sample t-test
##
## data: RICH by medicacion
## t = -0.63601, df = 9.6603, p-value = 0.5395
## alternative hypothesis: true difference in means between group No and group Sí is not equal to 0
## 95 percent confidence interval:
## -2.862702 1.596035
## sample estimates:
## mean in group No mean in group Sí
## 5.866667 6.500000