Importar librerias

library (ggplot2)
library ("easypackages")

Lectura del Data Frame

clean_calcium = read.csv ("clean_calcium.csv")
str (clean_calcium)
## 'data.frame':    178 obs. of  8 variables:
##  $ Observacion: int  1 2 3 4 5 6 7 8 9 10 ...
##  $ Age        : int  78 72 72 73 73 73 65 68 89 84 ...
##  $ Sex        : chr  "Female" "Female" "Female" "Female" ...
##  $ ALP        : num  83 117 132 102 114 ...
##  $ Lab        : chr  "CB Rouche" "CB Rouche" "CB Rouche" "CB Rouche" ...
##  $ CaMol      : num  2.53 2.5 2.43 2.48 2.33 2.13 2.55 2.45 2.25 2.43 ...
##  $ PhoMol     : num  1.07 1.16 1.13 0.81 1.13 0.84 1.26 1.23 0.65 0.84 ...
##  $ AgeG       : chr  "75 - 79 years" "70 - 74 years" "70 - 74 years" "70 - 74 years" ...

Punto 1

Distribución de los pacientes por edad, laboratorio y Sexo

Distruibución de los pacientes por Edad

boxplot (clean_calcium $ Age, main = "Distruibución de los pacientes por Edad", col = "blue", ylab = "Edad")

Distruibución de los pacientes por Laboratorio

barplot (table (clean_calcium $ Lab), main = "Distruibución de los pacientes por Laboratorio", col = c ("blue", "red", "green"), xlab = "Laboratorio", ylab = "Cantidad")

Distruibución de los pacientes por Sexo

barplot (table (clean_calcium $ Sex), main = "Distruibución de los pacientes por Sexo", col = c ("blue", "red"), xlab = "Sexo", ylab = "Cantidad")

Punto 2

Diferencias de las variables clínicas: ALP, CaMol, PhoMol entre los grupos de edad (AgeG), Sexo (Sex) y Laboratorio (Lab)

Variable clinica ALP

Variable clinica ALP entre el grupo Edad (AgeG)

boxplot (clean_calcium $ ALP ~ clean_calcium $ AgeG, main = "Distruibución de la Variable clinica ALP entre el grupo Edad", cex.names = 0.8, col = rep (c ("blue")), ylab = "ALP", xlab = "Edad (AgeG)")

Variable clinica ALP entre el grupo Sexo (Sex)

boxplot (clean_calcium $ ALP ~ clean_calcium $ Sex, main = "Distruibución de la Variable clinica ALP entre el grupo Sexo", cex.names = 0.8, col = rep (c ("blue")), ylab = "ALP", xlab = "Sexo (Sex)")

Variable clinica ALP entre el grupo Laboratorio (Lab)

boxplot (clean_calcium $ ALP ~ clean_calcium $ Lab, main = "Distruibución de la Variable clinica ALP entre el grupo Laboratorio", cex.names = 0.8, col = rep (c ("blue")), ylab = "ALP", xlab = "Laboratorio (Lab)")

Variable clinica CaMol

Variable clinica CaMol entre el grupo Edad (AgeG)

boxplot (clean_calcium $ CaMol ~ clean_calcium $ AgeG, main = "Distruibución de la Variable clinica CaMol entre el grupo Edad", cex.names = 0.8, col = rep (c ("blue")), ylab = "CaMol", xlab = "Edad (AgeG)")

Variable clinica CaMol entre el grupo Sexo (Sex)

boxplot (clean_calcium $ CaMol ~ clean_calcium $ Sex, main = "Distruibución de la Variable clinica CaMol entre el grupo Sexo", cex.names = 0.8, col = rep (c ("blue")), ylab = "CaMol", xlab = "Sexo (Sex)")

Variable clinica CaMol entre el grupo Laboratorio (Lab)

boxplot (clean_calcium $ CaMol ~ clean_calcium $ Lab, main = "Distruibución de la Variable clinica CaMol entre el grupo Laboratorio", cex.names = 0.8, col = rep (c ("blue")), ylab = "CaMol", xlab = "Laboratorio (Lab)")

Variable clinica PhoMol

Variable clinica PhoMol entre el grupo Edad (AgeG)

boxplot (clean_calcium $ PhoMol ~ clean_calcium $ AgeG, main = "Distruibución de la Variable clinica PhoMol entre el grupo Edad", cex.names = 0.8, col = rep (c ("blue")), ylab = "PhoMol", xlab = "Edad (AgeG)")

Variable clinica PhoMol entre el grupo Sexo (Sex)

boxplot (clean_calcium $ PhoMol ~ clean_calcium $ Sex, main = "Distruibución de la Variable clinica PhoMol entre el grupo Sexo", cex.names = 0.8, col = rep (c ("blue")), ylab = "PhoMol", xlab = "Sexo (Sex)")

Variable clinica PhoMol entre el grupo Laboratorio (Lab)

boxplot (clean_calcium $ PhoMol ~ clean_calcium $ Lab, main = "Distruibución de la Variable clinica PhoMol entre el grupo Laboratorio", cex.names = 0.8, col = rep (c ("blue")), ylab = "PhoMol", xlab = "Laboratorio (Lab)")

Punto 3

La estructura de correlación entre las variables cuantitativas: Age, ALP, CaMol, PhoMol

Visualización de la matriz de correlación

clean_calcium.cor = cor (clean_calcium [, c (2, 4, 6, 7)], method = "pearson")
corrplot :: corrplot (clean_calcium.cor , method = "ellipse", addCoef.col = "black", type = "upper")

Visualización del diagrama de dispersión de pares

pairs (clean_calcium [, c (2, 4, 6, 7)], lower.panel = panel.smooth, pch = 15)