##  region     population     sex           age        education     income      
##  C :548   Min.   :  3750   F:1250   Min.   :18.00   P :1002   Min.   :  2500  
##  M : 75   1st Qu.: 25000   M:1181   1st Qu.:25.00   PS: 419   1st Qu.:  7500  
##  N :305   Median :175000            Median :36.00   S :1010   Median : 15000  
##  S :655   Mean   :151605            Mean   :38.29             Mean   : 34020  
##  SA:848   3rd Qu.:250000            3rd Qu.:49.00             3rd Qu.: 35000  
##           Max.   :250000            Max.   :70.00             Max.   :200000  
##    statusquo        vote   
##  Min.   :-1.72594   A:177  
##  1st Qu.:-1.00974   N:867  
##  Median :-0.08924   U:551  
##  Mean   :-0.01127   Y:836  
##  3rd Qu.: 0.96969          
##  Max.   : 1.71355

the dataset Chile has 8 variables: region, population, age, education, income, statusquo and vote

region- factor
the mode is SA (city of Santiago), where 960 people reside in
we can also check the frequency table by table(Chile$region)

## 
##   C   M   N   S  SA 
## 548  75 305 655 848

population- integer the mean of the population 151605
the median of the population 175000

sex- factor

library(dplyr)

Chile %>%
  group_by(Chile$sex) %>%
  summarise(count = n()) %>%
  mutate(percentage = count / sum(count) * 100)

the percentage of females to males is 51.41917 to 48.58083
the mode is females with the count of 1250

age- integer
the mean of the age is 38.29
the median of the age is 36

education- factor
the mode of the education is secondary education
we can also check the frequency table by table(Chile$education)

## 
##    P   PS    S 
## 1002  419 1010

income- integer
the median income is 15 000
the mean income is 34 020

statusquo- numeric
the median statusquo is -0.08924
the mean statusquo is -0.01127

vote- factor
the mode of the votes is N with 867
we can also check the frequency table by table(Chile$vote)

## 
##   A   N   U   Y 
## 177 867 551 836