Skip to content

Instantly share code, notes, and snippets.

View adamlauretig's full-sized avatar
🎶

Adam Lauretig adamlauretig

🎶
View GitHub Profile
@adamlauretig
adamlauretig / create_monthly_mids_panel.R
Created January 31, 2019 16:14
Code to create a monthly panel from the Militarized Interstate Disputes dataset
# Code to create a monthly, directed dyadic panel of
# Militarized Interstate Dispute data, with directional initiation
# uses cshapes to create monthly list of all dyads, then uses data.table
# to transform MIDS to a monthly panel and then merge
# Code by Adam Lauretig, 2019
# website: adamlauretig.github.io
rm(list = ls())
options(stringsAsFactors = FALSE)
---
title: "Using Gensim in R"
author: "Adam Lauretig"
date: "3/17/2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@adamlauretig
adamlauretig / classic_iv.stan
Created October 15, 2017 16:24 — forked from khakieconomics/classic_iv.stan
Classic instrumental variables regression model for Stan
data {
int N;
int PX; // dimension of exogenous covariates
int PN; // dimension of endogenous covariates
int PZ; // dimension of instruments
matrix[N, PX] X_exog; // exogenous covariates
matrix[N, PN] X_endog; // engogenous covariates
matrix[N, PZ] Z; // instruments
vector[N] Y_outcome; // outcome variable
int<lower=0,upper=1> run_estimation; // simulate (0) or estimate (1)