hypothesize: My R Package for Hypothesis Testing is Now on CRAN
A consistent API for hypothesis testing in R, including Likelihood Ratio and Wald tests.
Research engineer and computer scientist working at the intersection of machine learning, statistical computing, and cryptography. Currently pursuing my PhD in Computer Science at Southern Illinois University Edwardsville, where I also earned dual master's degrees in Computer Science and Mathematics/Statistics. I believe in the power of open source to accelerate scientific progress. My work focuses on building tools that are both theoretically sound and practically useful—whether it's compositional approaches to language modeling, encrypted search systems that preserve privacy, or statistical methods for reliability analysis with censored data. I maintain 50+ open source repositories with libraries published to PyPI and other package registries. I care deeply about API design, documentation, and developer experience—making complex algorithms accessible to practitioners. As a cancer survivor, I bring a unique perspective on resilience and determination to my work, approaching challenges with both theoretical depth and practical engineering expertise.
I'm pleased to announce that hypothesize is now available on CRAN, the official R package repository.
What is hypothesize?
hypothesize provides a consistent API for hypothesis testing in R. It defines generic methods that any hypothesis test can implement:
pval()- Extract the p-valuetest_stat()- Get the test statisticdof()- Retrieve degrees of freedomis_significant_at()- Check significance at a given level
The package includes implementations for two common tests:
- Likelihood Ratio Test (LRT) - For comparing nested models
- Wald Test - For testing parameter estimates
Why a Consistent API?
When building statistical libraries, I found myself repeatedly implementing ad-hoc hypothesis test structures. hypothesize standardizes this: any package can wrap its tests in a consistent interface, making it easier to compose statistical workflows.
Installation
Now that it's on CRAN, installation is simple:
install.packages("hypothesize")
Quick Example
library(hypothesize)
# Likelihood Ratio Test
result <- lrt(null_loglik = -100, alt_loglik = -96, dof = 3)
print(result)
# Check significance
is_significant_at(result, 0.05)
# Extract components
pval(result)
test_stat(result)
What's Next
I have several other R packages in the pipeline for CRAN submission, including packages for likelihood-based inference and reliability analysis.
Links
- CRAN: CRAN.R-project.org/package=hypothesize
- GitHub: github.com/queelius/hypothesize
- Documentation: queelius.github.io/hypothesize
Originally published at metafunctor.com