This file contains 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(fixest) | |
library(marginaleffects) | |
library(modelsummary) | |
ui <- fluidPage( | |
titlePanel("Explore the relationship between development and democracy"), | |
sidebarLayout( | |
sidebarPanel( | |
sliderInput( |
This file contains 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
# packages ---------------------------------------------------------------- | |
library(dataverse) | |
library(tidyverse) | |
library(countrycode) | |
library(maps) | |
library(ggtext) | |
library(gganimate) | |
# note that the following packages must also be installed, but they don't |
This file contains 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
# r code for the animations at | |
# https://twitter.com/ResulUmit/status/1201779741155635200?s=20 | |
# load libraries ---------------------------------------------------------- | |
library(tidyverse) | |
library(lubridate) | |
library(fuzzyjoin) | |
library(rvest) | |
library(magrittr) |
This file contains 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
# a loop-based function in r | |
# that can be used for multiverse analysis | |
# with the feols function from the fixest package | |
feols_multiverse <- function(dep_var, indep_var, cont_var, back_end){ | |
# function to create the powerset | |
power <- function(x){ | |
sets <- lapply(1:(length(x)), function(i) combn(x, i, simplify = F)) |
This file contains 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
# load libraries ------------------------------------------------------- | |
library(tidyverse) | |
library(rvest) | |
library(robotstxt) | |
# get journal names and links from my website ----------------------------- | |
# get names |
This file contains 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
# load the required libraries --------------------------------------------- | |
library(tidyverse) | |
# create the dataset of votes --------------------------------------------- | |
file_ext <- c(1997, 2001, 2005, 2010, 2015, 2017) | |
temp_list <- list() |
This file contains 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
# load the data | |
library(tidyverse) | |
# write functions to calculate confidence intervals | |
lower_ci <- function(mean, se, n, conf_level = 0.95){ | |
lower_ci <- mean - qt(1 - ((1 - conf_level) / 2), n - 1) * se | |
} | |
upper_ci <- function(mean, se, n, conf_level = 0.95){ | |
upper_ci <- mean + qt(1 - ((1 - conf_level) / 2), n - 1) * se |
This file contains 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(dotwhisker) | |
library(tidyverse) | |
shinyApp( | |
ui <- fluidPage( | |
sidebarLayout( |
This file contains 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
# load the data | |
library(tidyverse) | |
# write functions to calculate confidence intervals | |
lower_ci <- function(mean, se, n, conf_level = 0.95){ | |
lower_ci <- mean - qt(1 - ((1 - conf_level) / 2), n - 1) * se | |
} | |
upper_ci <- function(mean, se, n, conf_level = 0.95){ | |
upper_ci <- mean + qt(1 - ((1 - conf_level) / 2), n - 1) * se |
This file contains 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
# r code for the graph at | |
# https://twitter.com/ResulUmit/status/1352218275699154945?s=20 | |
# load the packages ------------------------------------------------------- | |
library(dataverse) | |
library(rio) | |
library(tidyverse) | |
# specify which installation ---------------------------------------------- |
NewerOlder