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 / 24_death_fear.r
Created December 5, 2025 03:14
24 fear of death
library(tidyverse)
library(haven)
library(stringr)
library(data.table)
library(binom)
svys <- c(
"./data/fears_surveys/w2015.sav",
"./data/fears_surveys/w2017.sav",
"./data/fears_surveys/w2019.sav",
@acbass49
acbass49 / 23_trend_investigation.r
Created November 14, 2025 01:40
23 devout decline investigation
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Load the dataset
data <- readRDS("./data/CES/cumulative_2006-2024.rds")
@acbass49
acbass49 / 22_mormon_hispanics.r
Created November 4, 2025 06:08
22 Mormon Hispanics
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Load the dataset
data <- readRDS("./data/CES/cumulative_2006-2024.rds")
@acbass49
acbass49 / 21_leadership_demographics.py
Created October 28, 2025 19:19
21 Leadership Demographics
from google import genai
import httpx
import io
from helium import *
import datetime
import pandas as pd
import numpy as np
import time
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
@acbass49
acbass49 / example.py
Created October 24, 2025 20:51
CES data
import survey_tools as st
import pandas as pd
from scipy.stats import norm
import math
ces_data = pd.read_csv("../data/CES/CES24_Common.csv")
# crosstabs for career choice
ces_data['industry_rc'] = st.recode(ces_data, "industry", "10=NaN")
st.tabs(ces_data.query("religpew == 3"), "industry_rc", wts="commonweight", display="column")
@acbass49
acbass49 / 20_missionary_bump.r
Created October 9, 2025 19:56
20 Missionary Bump
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Load the dataset
data <- readRDS("./data/CES/cumulative_2006-2024.rds")
@acbass49
acbass49 / 19_onlineness.r
Last active October 3, 2025 05:27
19 Mormon Onlineness
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
library(clipr)
# Load PRLS
typology_data <- read.csv("./data/rls/mormon_typology.csv")
@acbass49
acbass49 / 18_utah_mormon.r
Created September 23, 2025 15:28
18 Utah Mormons
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Load the dataset
data <- readRDS("./data/CES/cumulative_2006-2024.rds")
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Here is the sheet I used to merge in the gun control variable:
# https://docs.google.com/spreadsheets/d/13Fo6SEF_B9nTSmnt3kLFt_EaVaNIvWl_iTwXUUoB3-Y/edit?usp=sharing
@acbass49
acbass49 / 16_cluster_confirmation.r
Last active September 11, 2025 18:51
16 Cluster Confirmation
library(tidyverse)
library(binom)
library(haven)
library(car)
library(ggtext)
library(sjlabelled)
# Load the dataset
data <- readRDS("./data/CES/cumulative_2006-2024.rds")