Stanford's new Interactive Online IO seminar, aka (IO)^2.
When: Tuesdays and Fridays, 12:00 - 13:00 ET
// Plot stacked missing and non-missing values over time (or some other discrete variable) | |
// Syntax: plotmissing var timevar | |
program define plotmissing | |
tempvar has hasnt | |
gen `has' = (!mi(`1')) | |
gen `hasnt' = (mi(`1')) | |
graph hbar (sum) `has' `hasnt', /// | |
over(`2', label(labsize(vsmall))) /// | |
stack legend(order(1 "Non-missing" 2 "Missing")) /// | |
subtitle(Relative frequency of non-missing '`1'') |
"builder_settings" : { | |
// General settings: | |
// See README or third-party documentation | |
// (built-ins): true shows the log of each command in the output panel | |
"display_log" : false, | |
"options": ["--shell-escape"], | |
// Platform-specific settings: |
<?xml version="1.0" encoding="UTF-8"?> | |
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> | |
<mime-type type="application/x-stata-dta"> | |
<comment>Stata data file</comment> | |
<glob pattern="*.dta"/> | |
<icon name="application-x-stata-dta"/> | |
</mime-type> | |
<mime-type type="application/x-stata-do"> | |
<comment>Stata do file</comment> | |
<glob pattern="*.do"/> |
# Curl | |
sudo apt -y install curl | |
# Atom | |
curl -L https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add - | |
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list' | |
sudo apt update | |
sudo apt -y install atom |
#!/bin/bash | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
downloadsPath=$(xdg-user-dir DOWNLOAD) | |
juliaVersion="julia-1.1.0" | |
# echo "${bold}1/3 Downloading" |
#%% Load libraries | |
using DataFrames, CSV | |
using Statistics | |
using Plots, LaTeXStrings | |
#%% Read and prepare data | |
cd("/home/alvaro/Dropbox/Princeton/2020-Spring/542-IO/PS1") | |
df = CSV.read("data/Pset1_2020Data.csv"); | |
# Add dummy columns for number of active firms in each market |
#%% Load libraries | |
using CSV, DataFrames, DataFramesMeta | |
using LinearAlgebra | |
using Optim # GMM() optimization | |
# using FixedEffectModels | |
# using RegressionTables | |
using StatsBase # sample() for bootstrap sample | |
using ProgressMeter | |
using Latexify |
// Working directory | |
if "`c(username)'"=="alvaro" { | |
cd "~/Dropbox/Princeton/2020-Spring/524-PF/PS3/" | |
} | |
else di as error "DUMMY U HAVE TO CHANGE THE PATH" | |
// Color scheme (from SSC) | |
set scheme plotplain | |
// Political data |
year | tot_inc | dpad | tot_ded | tot_cred | tot_ded_no_dpad | |
---|---|---|---|---|---|---|
2008 | 8775331143 | 18402344 | 8326939127 | 110593038 | 8308536783 | |
2009 | 7886561418 | 14208754 | 7499810538 | 103929098 | 7485601784 | |
2010 | 8144430285 | 24366835 | 7424856017 | 131342301 | 7400489182 | |
2011 | 8389697631 | 27353624 | 7691212916 | 125526604 | 7663859292 | |
2012 | 8661354506 | 31962519 | 7690545497 | 130747914 | 7658582978 | |
2013 | 8784239695 | 33873987 | 7722842521 | 143929211 | 7688968534 | |
2014 | 13729702329 | 36762355 | 11667987910 | 131633981 | 11631225555 | |
2015 | 13981086321 | 36543133 | 12027815329 | 124023841 | 11991272196 |
Stanford's new Interactive Online IO seminar, aka (IO)^2.
When: Tuesdays and Fridays, 12:00 - 13:00 ET