Skip to content

Instantly share code, notes, and snippets.

View sternj's full-sized avatar

sternj

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sternj on github.
  • I am jstern (https://keybase.io/jstern) on keybase.
  • I have a public key ASDoOmflFpN00Yu74FR_bghXxvf6eEm2Xr_jpBv486EgdAo

To claim this, I am signing this object:

@sternj
sternj / mergeSPSSDatasets.py
Created August 14, 2017 17:29
A script to perform a case- and variable-merge of two SPSS datasets
import sys
import copy
import spss
#This program takes two sets and appends the second to the first, including ALL cases and variables.
#It does this by adding the number of cases in the second set to the first set, cross-referencing and rectifying all
#value labels, and then finally populating the newly-constructed cases in the first dataset with the data from
#the second.
#For running outside of spss-- this gets the two datasets.
@sternj
sternj / Stern_Jonathan_Part1.R
Created February 13, 2017 16:18
Jonathan Stern part 1 AI
# Jane Smith project analysis.
rm(list = ls())
# Read in data ----
wd <- "~/"
rand_data <- read.csv(paste0(wd, "data/smith_rand.csv"), stringsAsFactors = F)
covar_data <- read.csv(paste0(wd, "data/smith_covariates.csv"), stringsAsFactors = F)
outcome_data <- read.csv(paste0(wd, "data/smith_outcomes.csv"), stringsAsFactors = F)
# Combine randomization, covariate, and survey outcome data