Francis Galton

Análisis Exploratorio

Francis Galton fue un polímata, antropólogo, geógrafo, explorador, inventor, meteorólogo, estadístico, psicólogo y eugenista británico con un amplio espectro de intereses.​​ Galton produjo más de 340 artículos y libros. Creó el concepto estadístico de correlación y regresión hacia la media, altamente promovido.

La gráfica muestra una correlacion de Pearson entre: ” Padre vs Madre: 0.7 ” Padre vs Hijo: 0.28 ” Madre vs Hijo: 0.20 ”

colnames(Galton)<-c("Familia","Padre","Madre","Genero","Estatura","Hijos")
names(Galton)
## [1] "Familia"  "Padre"    "Madre"    "Genero"   "Estatura" "Hijos"
head(Galton,n=10)
## # A tibble: 10 × 6
##    Familia Padre Madre Genero Estatura Hijos
##      <dbl> <dbl> <dbl> <chr>     <dbl> <dbl>
##  1       1  78.5  67   M          73.2     4
##  2       1  78.5  67   F          69.2     4
##  3       1  78.5  67   F          69       4
##  4       1  78.5  67   F          69       4
##  5       2  75.5  66.5 M          73.5     4
##  6       2  75.5  66.5 M          72.5     4
##  7       2  75.5  66.5 F          65.5     4
##  8       2  75.5  66.5 F          65.5     4
##  9       3  75    64   M          71       2
## 10       3  75    64   F          68       2
Galton01<-Galton %>%
  dplyr::select(Padre,Madre,Estatura) %>%
  group_by(Padre)
pairs.panels(Galton01)

Explicación La tabla muestra la relación entre el promedio de la estatura del padre y la madre.

Galton_cm<-mutate(Galton01,Pcm=Padre*2.54,Mcm=Madre*2.54,Hcm=Estatura*2.54, round(1))
head(Galton_cm,n=10)
## # A tibble: 10 × 7
## # Groups:   Padre [3]
##    Padre Madre Estatura   Pcm   Mcm   Hcm `round(1)`
##    <dbl> <dbl>    <dbl> <dbl> <dbl> <dbl>      <dbl>
##  1  78.5  67       73.2  199.  170.  186.          1
##  2  78.5  67       69.2  199.  170.  176.          1
##  3  78.5  67       69    199.  170.  175.          1
##  4  78.5  67       69    199.  170.  175.          1
##  5  75.5  66.5     73.5  192.  169.  187.          1
##  6  75.5  66.5     72.5  192.  169.  184.          1
##  7  75.5  66.5     65.5  192.  169.  166.          1
##  8  75.5  66.5     65.5  192.  169.  166.          1
##  9  75    64       71    190.  163.  180.          1
## 10  75    64       68    190.  163.  173.          1
cm<-Galton_cm %>%
  dplyr::select(Pcm,Mcm,Hcm) %>%
  group_by(Pcm)
## Adding missing grouping variables: `Padre`
summary(cm)
##      Padre            Pcm             Mcm             Hcm       
##  Min.   :62.00   Min.   :157.5   Min.   :147.3   Min.   :142.2  
##  1st Qu.:68.00   1st Qu.:172.7   1st Qu.:160.0   1st Qu.:162.6  
##  Median :69.00   Median :175.3   Median :162.6   Median :168.9  
##  Mean   :69.24   Mean   :175.9   Mean   :162.8   Mean   :169.6  
##  3rd Qu.:71.00   3rd Qu.:180.3   3rd Qu.:166.4   3rd Qu.:177.0  
##  Max.   :78.50   Max.   :199.4   Max.   :179.1   Max.   :200.7

Explicación La tabla explica como es el promedio de las estaturas de la madre y el padre en los hijos.

par(mfrow=c(1,3))
hist(Galton_cm$Pcm,xlab = "Padre",ylab = "Frecuencia", main="Estatura del Padre en cm")
hist(Galton_cm$Mcm,xlab = "Madre",ylab = "Frecuencia", main="Estatura de la Madre en cm")
hist(Galton_cm$Hcm,xlab = "Hijos",ylab = "Frecuencia", main="Estatura de los Hijos en cm")

Explicación Las tablas muestran las estaturas del padre, la madre y los hijos de manera gráfica.

ggplot(data=Galton,aes(x=Padre,y=Estatura,color=Genero, size=Estatura))+geom_point()+geom_smooth()+ggtitle("Estatura: Padre vs Hij@")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation: size
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

ggplot(data=Galton,aes(x=Madre,y=Estatura,color=Genero, size=Estatura))+geom_point()+geom_smooth()+ggtitle("Estatura: Madre vs Hij@")
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation: size
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

Explicación En las siguientes tablas podemos ver una relación entre las estaturas de Padre vs Hijo, y Madre vs Hijo

v<-ggplot(data=Galton, aes (x=Estatura,fill=Genero))+geom_histogram(binwidth = 1,color="black")
v+ggtitle("Histograma")

Explicación La gráfica explica la relacion entre la influencia de las estaturas según el genero, es decir, hombres y mujeres.

v<-ggplot(data=Galton, aes (x=Estatura,fill=Genero))+geom_histogram(color="black")
v+ggtitle("Histograma con datos de clase")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Explicación El genero femenino aporta mas a la estutatura de los hijos que el padre.

ggplot(data=GaltonMayo23_1_,aes(x=Padre,y=Estatura,color=Genero, size=Estatura))+geom_point()+geom_smooth()+ggtitle("Estatura: Padre vs Hij@")
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation: size
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

Explicación La tabla muestra la estatura Padre vs Hijo en Gto.

ggplot(data=GaltonMayo23_1_,aes(x=Madre,y=Estatura,color=Genero, size=Estatura))+geom_point()+geom_smooth()+ggtitle("Estatura: Madre vs Hij@")
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation: size
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

Explicación, la tabla muestra la estatura Madre vs Hijo en Gto.

v<-ggplot(data=GaltonMayo23_1_, aes (x=Estatura,fill=Genero))+geom_histogram(color="black")
v+ggtitle("Histograma con datos de clase")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

La tabla muestra un conjunto de datos de estaturas entre hombres y mujeres recavados en clase.

altos<-filter(GaltonMayo23_1_,Padre>1.8)
altos
## # A tibble: 103 × 6
##    Familia Padre Madre Genero Estatura Hijos
##      <dbl> <dbl> <dbl> <chr>     <dbl> <dbl>
##  1       5  1.96  1.76 H          1.9      4
##  2       5  1.96  1.76 H          1.53     4
##  3       5  1.96  1.76 H          1.46     4
##  4       5  1.96  1.76 M          1.78     4
##  5      11  1.86  1.7  H          1.8      3
##  6      11  1.86  1.7  H          1.75     3
##  7      11  1.86  1.7  H          1.7      3
##  8      14  1.82  1.64 M          1.54     3
##  9      14  1.82  1.64 M          1.58     3
## 10      14  1.82  1.64 M          1.71     3
## # ℹ 93 more rows
boxplot(altos$Padre,altos$Madre,altos$Estatura)

bajos<-filter(GaltonMayo23_1_,Padre<1.65)
bajos
## # A tibble: 16 × 6
##    Familia Padre Madre Genero Estatura Hijos
##      <dbl> <dbl> <dbl> <chr>     <dbl> <dbl>
##  1      53  1.6   1.72 H          1.8      4
##  2      53  1.6   1.72 H          1.67     4
##  3      53  1.6   1.72 M          1.69     4
##  4      53  1.6   1.72 H          1.78     4
##  5     112  1.62  1.55 M          1.64     2
##  6     112  1.62  1.55 M          1.56     2
##  7     113  1.6   1.56 M          1.55     2
##  8     113  1.6   1.56 M          1.54     2
##  9     120  1.64  1.6  M          1.67     1
## 10     135  1.59  1.65 M          1.6      2
## 11     135  1.59  1.65 M          1.68     2
## 12     140  1.6   1.65 H          1.72     4
## 13     140  1.6   1.65 M          1.7      4
## 14     140  1.6   1.65 M          1.67     4
## 15     140  1.6   1.65 M          1.7      4
## 16     141  1.63  1.68 H          1.67     1
boxplot(bajos$Padre,bajos$Madre,bajos$Estatura)

Muestra una relacion entre las estaturas de padres, madres e hijos en Gto.

Conslusiones: la conclusion del trabajo realizado es que generalmente los hombres, es decir, los padres influyen mas en la estatura de los hijos, pero en Guanajuato es al reves, las mujeres, es decir, las mamás influyen mas en las estaturas de Gto.

Referencias

Galton, Francis. 1886 “Regression Towards Mediocrity in Hereditary Stature” The journal of the Anthropological Institute of Great Britain and Ireland 15:246. https://doi.org/10.2307/2841583.