Skip to content

Instantly share code, notes, and snippets.

@soodoku
soodoku / readme.md
Last active September 13, 2025 22:22
Personality Change

Personality Change

Personality psychology reports "moderate stability" of traits across adulthood, but what does this mean for individuals? We simulated how likely someone is to obtain similar Big Five personality test results over a 30-year span, critically accounting for measurement error.

Method: We generated 10,000 individuals with Big Five traits following a multivariate normal distribution with empirical intercorrelations (e.g., Neuroticism with Extraversion: -0.22). We modeled personality at Time 2 using the test-retest formula: New_Score = Old_Score × r + error × √(1-r²), adding measurement error (reliability = 0.82, per Gnambs 2014) at both time points. We defined "meaningful change" as shifts exceeding 0.5 standard deviations. Crucially, we established a baseline scenario with perfect stability (r=1.0) to isolate measurement error effects, finding that 33% appear to change due to measurement error alone. We then examined: Soldz & Vaillant's (1999) 30-year correlations (E: 0.19, N: 0.20, O: 0.3

@soodoku
soodoku / sentiment.py
Last active August 20, 2025 23:37
Ribeiro Style Robustness Checks
# -*- coding: utf-8 -*-
"""sentiment_ribeiro_style_checklist.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1uyBg9-sidauCSSO6dcztl552HVSAgkUJ
"""
"""
@soodoku
soodoku / empirical-logistic.stan
Last active May 14, 2025 05:52
Wasserstein Prior
data {
int<lower=0> N;
int<lower=0> D;
matrix[N, D] x;
array[N] int<lower=0, upper=1> y;
real<lower=0> h;
int<lower=0> B;
array[B] vector[D] beta0;
@soodoku
soodoku / data.py
Created April 24, 2025 04:24
List all dataverse repos.
#!/usr/bin/env python3
import argparse
import json
import requests
import sys
from urllib.parse import quote
def parse_arguments():
"""Parse command line arguments"""
parser = argparse.ArgumentParser(description="List Dataverse datasets owned by a user and convert to JSON")
@soodoku
soodoku / Continuous Hinger.md
Last active April 15, 2025 21:32
Continuous Hinge Function
@soodoku
soodoku / calibration_plot.png
Last active April 13, 2025 21:09
Vanilla Xgboost miscalibration
calibration_plot.png
@soodoku
soodoku / dataverse.py
Created April 3, 2025 18:59
Dataverse Uploaded
#!/usr/bin/env python3
"""
Dataverse File Uploader
A script to upload files to Harvard Dataverse or other Dataverse instances.
"""
import os
import argparse
import requests
@soodoku
soodoku / tariffs.ipynb
Last active April 3, 2025 17:29
Tariffs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@soodoku
soodoku / Readme.md
Last active March 5, 2025 01:05
i4replication scraper

Scraping the abstracts for the discussion papers by i4replication.org.

@soodoku
soodoku / readme.md
Last active May 14, 2025 11:36
RQ Boot Results to Latex Table

RQ Boot to Latex

ModelSummary and Stargazer fail when RQ s.e. calculation fails

stargazer(m_demo_int_qr)
Error in base::backsolve(r, x, k = k, upper.tri = upper.tri, transpose = transpose,  : 
  singular matrix in 'backsolve'. First zero in diagonal [13]