This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # "pib trim.xlsx" es el PIB trimestral a precios encadenados de este enlace: | |
| #https://si3.bcentral.cl/Siete/ES/Siete/Cuadro/CAP_CCNN/MN_CCNN76/CCNN2018_P0_V2/637801082315858005?cbFechaInicio=2000&cbFechaTermino=2024&cbFrecuencia=QUARTERLY&cbCalculo=NONE&cbFechaBase= | |
| pibtrim <- readxl::read_excel("pib trim.xlsx",skip = 1) | |
| colnames(pibtrim) <- c("time", "pib") | |
| pibtrim <- pibtrim %>% | |
| mutate(time2 = ymd(str_sub(time, 1, 10))) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(stm) | |
| library(tidytext) | |
| library(ggridges) | |
| n_topicos = 20 | |
| n_nuestras = 100 | |
| # iteración sobre tópicos | |
| lapply(1:n_topicos, function(i){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(haven) | |
| theme_set(theme_bw(base_size = 24)) | |
| dat <- read_dta("http://fmwww.bc.edu/ec-p/data/wooldridge/wage1.dta") | |
| dat %>% | |
| ggplot() + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(foreign) | |
| dat <- read.dta("http://fmwww.bc.edu/ec-p/data/wooldridge/gpa1.dta") | |
| coef(lm(colGPA ~ ACT + hsGPA, data = dat)) | |
| coef(lm(colGPA ~ hsGPA, data = dat)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| generate_regression_table <- function(models, se_type = "HC3") { | |
| require(sandwich) | |
| require(lmtest) | |
| # Initialize lists to store results | |
| results_list <- list() | |
| # Loop over each model | |
| for (i in seq_along(models)) { | |
| model <- models[[i]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| theme_set(theme_bw(base_size = 21)) | |
| options(scipen = 999) | |
| dat <- read.csv("dataregionesChile.csv") | |
| # filtrar el año 2020 | |
| y2020 <- dat %>% filter(year == 2020) | |
| # generar histograma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(directlabels) | |
| theme_set(theme_bw(base_size = 21)) | |
| options(scipen = 999) | |
| dat <- readxl::read_excel("mpd2020.xlsx", sheet = 3) %>% | |
| filter(country %in% c("Argentina", "Chile", "Brazil","Sweden", "United States", | |
| "Norway", "Uruguay", "United Kingdom", "Panama"), | |
| year >= 1870) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(countrycode) | |
| library(gganimate) | |
| library(gifski) | |
| theme_set(theme_classic()) | |
| tiempo <- read.csv("annual-working-hours-per-worker.csv") | |
| colnames(tiempo)[4] <- "tiempo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(XML) | |
| library(RCurl) | |
| library(tm) | |
| library(wordcloud2) | |
| library(stm) | |
| library(pdftools) | |
| library(tidyverse) | |
| library(patchwork) | |
| library(ggwordcloud) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(rvest) | |
| library(RSelenium) | |
| # funciones pa limpiar | |
| limpieza <- function(objtabla){ | |
| objtabla <- objtabla[-which(is.na(objtabla[,1])), ] | |
| objtabla <- objtabla[c(1:(nrow(objtabla)-5)),] | |
NewerOlder