Kincounts is a research project for modeling how fertility distributions shape sibling and broader kin-count distributions.
This repository includes:
- A Quarto website with methods, derivations, and analysis outputs (rendered to docs)
- An interactive Kincounts simulator (React + Vite), deployed on Vercel, with two parts: an empirical Fertility Fit view and a Simulator for kin counts
- A data folder that keeps restricted raw IPUMS extracts separate from shareable processed summaries
- Output folders with generated files
- _quarto.yml: Quarto website configuration
- analysis: analysis pages and supporting files (including the IPUMS preprocessing methods page)
- simulator: React + Vite interactive simulator (deployed to Vercel)
- code: utility scripts, including
generate_empirical_data.R, which syncs the simulator's empirical parameters from the analysis outputs - data: raw and processed data;
data/raw/is local-only, whiledata/processed/contains shareable aggregate summaries - output: generated outputs from analyses/simulations
- docs: rendered site output
- renv-setup.R: helper script to install analysis package dependencies
- R (recommended recent version)
- Quarto CLI installed and available in PATH
- Node.js 20+ (for the simulator)
Run the analysis dependency setup script:
Rscript renv-setup.RThe raw IPUMS USA extract is not committed because IPUMS USA restricts redistribution of its data without permission. If you have IPUMS access, place the extract files in data/raw/. The processed aggregate summaries in data/processed/ are produced by rendering the analysis site (the preprocessing now lives inline in analysis/preprocess.qmd; the earlier code/preprocess_ipums.R script is superseded):
quarto renderThe repository should include only aggregate processed files in data/processed/ so the analyses can be reproduced without redistributing record-level IPUMS data.
Render the full Quarto site:
quarto renderRendering also regenerates the simulator's empirical-parameter module (simulator/src/lib/empiricalData.js) from the fresh model outputs, via code/build_site.R, so the simulator can never drift from the analysis.
Start live preview:
quarto previewRendered output is written to docs.
The interactive simulator lives in simulator and is deployed to Vercel.
Local development:
cd simulator
npm install
npm run devProduction build:
cd simulator
npm run build # outputs to simulator/distVercel is configured with the project Root Directory set to simulator (so it picks up simulator/vercel.json, runs npm install, then npm run build).
Live app: https://kincounts.vercel.app/
- Site navigation and global rendering options are configured in _quarto.yml.
- Analysis pages include both methodological derivations and simulation/model-fitting code.
- The repository may include generated artifacts in docs and output, depending on your workflow.