Problem-Set-1
Problem-Set-1
install.packages("haven")
##
## The downloaded binary packages are in
## C:\Users\Pvblo\AppData\Local\Temp\RtmpeIHub2\downloaded_packages
library(haven)
install.packages("ggplot2")
library(ggplot2)
install.packages("dplyr")
##
## The downloaded binary packages are in
## C:\Users\Pvblo\AppData\Local\Temp\RtmpeIHub2\downloaded_packages
library(dplyr)
##
## Attaching package: 'dplyr'
install.packages("viridis")
library(viridis)
id_vivienda folio id_persona region area cod_upm nse estrato hogar expr
<dbl> <dbl> <dbl> <dbl+lbl> <dbl+lbl> <dbl> <dbl+lbl> <dbl> <dbl> <dbl>
str(CASEN_22$esc)
if (!is.numeric(CASEN_22$esc)) {
CASEN_22$esc <- as.numeric(as.character(CASEN_22$esc))
}
str(CASEN_22$esc)
## $`Media yoprcor`
## [1] 626617.8
##
## $`Varianza yoprcor`
## [1] 486008325968
##
## $`Desviación Estándar yoprcor`
## [1] 697143
##
## $`Mediana yoprcor`
## [1] 450000
##
## $`Media esc`
## [1] 11.16742
##
## $`Varianza esc`
## [1] 18.23009
##
## $`Desviación Estándar esc`
## [1] 4.269671
##
## $`Mediana esc`
## [1] 12
## Warning: Removed 119947 rows containing non-finite outside the scale range
## (`stat_bin()`).
## Warning: Removed 36983 rows containing non-finite outside the scale range
## (`stat_bin()`).
## Warning: Removed 119947 rows containing non-finite outside the scale range
## (`stat_ecdf()`).
## Warning: Removed 36983 rows containing non-finite outside the scale range
## (`stat_ecdf()`).
C) Agrupar en 3 Categorías
NA NA 1 Bajo
NA NA 4 Bajo
NA NA NA NA
NA NA 12 Medio
NA NA NA NA
6 rows
##
## Bajo Medio Alto
## Bajo 13034 14904 8154
## Medio 4897 9831 7451
## Alto 1579 5352 16533
Conjunta)
library(plotly)
##
## Attaching package: 'plotly'