Siyang Ni

Software

Research software

An R package and a research dashboard, both in use beyond my own work.

The package fits a class of models that previously required proprietary software. The dashboard is still in service at Penn State.

surveymixr fitting a survey-weighted growth mixture model and plotting the classes. Simulated data, for demonstration.

R package

surveymixr

Growth mixture models with complex survey designs

Growth mixture modeling is standard practice in developmental research, and so are complex survey designs with stratification, clustered sampling, and probability weights. Combining the two correctly has effectively required Mplus. surveymixr does it in R, with sandwich standard errors that account for the survey design.

I wrote it because the dissertation needed it: the UK Millennium Cohort Study is a stratified, clustered, weighted sample, and the mixture models in Paper 3 had to account for that.

What it implements

  • Stratification, clustering (PSUs), and probability weights, with sandwich standard errors
  • Bootstrap Likelihood Ratio Test (BLRT) and the Lo–Mendell–Rubin test for class enumeration, plus cross-validation
  • Multiple random starts with convergence tracking and local-maximum detection
  • R3STEP auxiliary-variable analysis with classification-uncertainty correction (BCH, ML, and manual)
  • Continuous, binary, ordinal, and count outcomes; linear, quadratic, nonlinear, and free-basis growth
  • Diagnostics for entropy, class proportions, influence, separation, and residuals
# install.packages("devtools")
devtools::install_github("siyangni/surveymixr")

library(surveymixr)

fit <- gmm_survey(
  data         = mcs_simulated,
  id           = "id",
  time         = "age",
  outcome      = "selfcontrol",
  n_classes    = 3,
  growth_model = "linear",
  strata       = "stratum",
  cluster      = "psu",
  weights      = "weight",
  starts       = 500
)

summary(fit)
plot(fit, type = "trajectories")
diagnose_convergence(fit)

Version 0.2.2·Initial CRAN submission December 2025·User manual

Three estimated class trajectories from a survey-weighted growth mixture model: high and stable (49%), improving (33%), and declining (17%), with faint observed individual series behind each class mean.
Output of plot_trajectories() on simulated data with 4 strata, 80 PSUs, and survey weights. Class means carry 95% survey-adjusted confidence intervals.

Deployed dashboard

American Authorship Database

Built as Data Engineer, Research Support, Office of Digital Pedagogies and Initiatives, Penn State·May–August 2025

Open the dashboard

A modular R Shiny application that lets humanities researchers search and analyze a historical publishing archive: 686 books, 65 authors, and 8.1 million recorded copies sold, published between 1843 and 1918. It is deployed and in ongoing use by the Penn State College of the Liberal Arts, under the Digital Liberal Arts Research Initiative.

Each view is a separate module over a shared data layer:

  • Overview
  • Book explorer
  • Sales trends
  • Author analysis
  • Author networks
  • Royalty analysis
  • Income query
  • Genre analysis

Hosted on Posit Connect Cloud. The first load takes a few seconds while the container starts.

The American Authorship Database dashboard, showing 686 books, 65 authors, 8.1 million copies sold, and an annual book sales time series.
The overview: headline counts, annual sales, and author gender distribution.
The author network analysis view, with controls for network type, minimum books per author, publication year range, and gender, beside a plotted author network.
Author networks: relationships inferred from shared publishers and overlapping publication periods.

Skills

Methods and tools

Methods
  • Longitudinal and dynamic models
  • Structural equation modeling
  • Growth mixture and latent class models
  • Multilevel models
  • Machine learning
Tools
  • R
  • Python
  • PostgreSQL
  • Stata
  • Mplus
  • LaTeX
  • HTML