Skip to content

Instantly share code, notes, and snippets.

View acbass49's full-sized avatar

alex acbass49

  • Data Science Contractor
  • Salt Lake City, UT
View GitHub Profile
@acbass49
acbass49 / 36_social_trust.r
Created June 2, 2026 04:59
GSS Social Trust & Institutional Confidence Analysis for Latter-day Saints (1972-2022)
# 36_social_trust.r — GSS Social Trust Analysis for Latter-day Saints
#
# This script analyzes the General Social Survey (GSS) cumulative dataset (1972-2022)
# to examine social trust and institutional confidence among Latter-day Saints
# compared to other major U.S. religious groups.
#
# It analyzes 7 core variables:
# 1. trust: Can most people be trusted?
# 2. fair: Do people try to be fair or take advantage?
# 3. helpful: Do people try to be helpful or look out for themselves?
@acbass49
acbass49 / 35_who_is_moving.r
Last active May 25, 2026 11:54
Demographic Realignment Among Ex-Mormons (2007-2024)
# Who is Moving? Demographic Realignment Among Ex-Mormons (2007–2024)
# Analyzing Pew RLS 2007, 2014, and 2024 waves to figure out which ex-Mormons
# are driving the Republican shift.
library(tidyverse)
library(haven)
library(ggtext)
library(showtext)
# ── Fonts & Styling ──────────────────────────────────────────────────────────
@acbass49
acbass49 / 34_disaffiliated_politics.r
Created May 20, 2026 02:29
Mormon Metrics post 34 — Where the disaffiliated land politically (Pew RLS 2007/2014/2024)
# Where the Disaffiliated Land Politically — Pew RLS 2024
# Among people who left the religion they were raised in, where do they fall
# on the political spectrum? Comparison across former religions.
library(tidyverse)
library(haven)
library(ggtext)
library(showtext)
font_add("Cairo_bold", "~/Library/Fonts/Cairo-Bold.ttf")
library(tidyverse)
library(haven)
library(showtext)
library(magick)
font_add("Cairo_bold", "~/Library/Fonts/Cairo-Bold.ttf")
font_add("Cairo", "~/Library/Fonts/Cairo-Regular.ttf")
showtext::showtext_auto(enable = TRUE)
showtext::showtext_opts(dpi = 300)
@acbass49
acbass49 / 32_conference_stats_2025.R
Created April 15, 2026 23:40
2025 General Conference Stats Update
library(tidyverse)
library(stringr)
library(scales)
library(ggtext)
library(patchwork)
library(showtext)
font_add("Cairo_bold", "~/Library/Fonts/Cairo-Bold.ttf")
font_add("Cairo", "~/Library/Fonts/Cairo-Regular.ttf")
showtext::showtext_auto(enable = TRUE)
library(tidyverse)
library(haven)
library(car)
library(binom)
library(ggtext)
library(sjlabelled)
library(clipr)
library(showtext)
font_add("Cairo_bold", "~/Library/Fonts/Cairo-Bold.ttf")
library(tidyverse)
library(haven)
library(clipr)
# ── Load data ────────────────────────────────────────────────────────────
cumulative <- readRDS("./data/CES/cumulative_2006-2024.rds")
# Load 2025 individual year data and harmonize to match cumulative columns
# NOTE: verify variable names against data/CES/codebooks/CES25_Common.pdf
library(tidyverse)
library(haven)
library(car)
library(binom)
library(ggtext)
library(sjlabelled)
library(clipr)
# ── Load data ──────────────────────────────────────────────────────────────────
@acbass49
acbass49 / 29_beating_secular_headwinds.r
Last active March 20, 2026 11:03
Are LDS Beating Secular Headwinds
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
library(clipr)
### Starting with CES DATA
@acbass49
acbass49 / 28_sqft_by_state.py
Last active March 6, 2026 05:54
Median Home Square Footage by State (FRED API)
"""
Pull median home square footage by state from FRED (Realtor.com data) and plot a bar chart.
Series: MEDSQUFEE + state postal code (e.g., MEDSQUFEEUT)
Get a free API key at: https://fredaccount.stlouisfed.org/login/secure/
"""
import requests
import pandas as pd
import matplotlib.pyplot as plt