DEV Community

Ali Haider
Ali Haider

Posted on

I Built 32 Free Statistics Calculators for Thesis Students: How I Verified the Maths

Every semester, thousands of students reach the same wall in their thesis: the statistics chapter. They need a sample size, a reliability check for their questionnaire, the right test, and a results paragraph in APA style, and the usual options are an SPSS licence, a steep R learning curve, or online calculators that print a number without explaining it.

So I built SolveGrid: a set of free, browser-based statistics calculators that cover the whole research workflow, from planning the sample to writing up the result. Here is how it is put together and, more importantly, how I made sure the numbers are right.

What it covers

The site follows the order a student actually works in:

  1. Plan the study: a statistical test chooser, Slovin and Cochran sample size, and an a priori power analysis for t-tests, ANOVA, correlation and chi-square.
  2. Check the questionnaire: Cronbach's alpha, Likert weighted means, Cohen's kappa and ICC.
  3. Run the test: t-tests, one-way ANOVA with Tukey HSD, chi-square, correlation, multiple regression, and the non-parametric family (Mann-Whitney, Wilcoxon, Kruskal-Wallis, Friedman, McNemar), plus Shapiro-Wilk for normality.
  4. Report it: every calculator writes an APA-style sentence, and there are guides such as how to report regression in APA style.

The stack

It is a Next.js App Router site where every calculator page is statically pre-rendered. The calculators themselves are small client components; all of the statistics live in one plain TypeScript module of pure functions, so they can be tested outside React. Nothing is sent to a server: the data a student pastes in never leaves the browser.

The hard parts

Most of the formulas are textbook, but a few distributions needed real numerical work:

  • Exact p-values for t, F and chi-square use the regularised incomplete beta and gamma functions (continued fractions and series expansions).
  • Tukey HSD needs the studentized range distribution. I compute its CDF with a double numerical integral (Simpson's rule over the range of normals, then over the chi distribution of the denominator), and invert it by bisection for the critical value.
  • Power analysis needs noncentral t, F and chi-square distributions. The noncentral F and chi-square use Poisson mixtures of central distributions; the noncentral t uses a single integral over the chi distribution.
  • Shapiro-Wilk uses Royston's 1995 approximation, and the Mann-Whitney and Wilcoxon tests switch to exact distributions for small samples without ties.

How I verified it

Every function was checked against SciPy before it shipped. For each test I wrote a small script that runs the same sample data through my TypeScript and through scipy.stats, and compares the statistic, degrees of freedom, p-value and confidence interval. Examples that had to match:

  • Welch's t-test: t = 4.0548, df = 18.30, p = .00072
  • One-way ANOVA with Tukey: F(2, 21) = 38.85, all three pairwise p-values and intervals
  • Multiple regression: coefficients, standard errors, VIF, Durbin-Watson and Cook's distance
  • Power analysis: 64 per group for d = 0.5 at alpha = .05 and 80% power, the same as G*Power

Where I use an approximation (for example the Fisher z method for correlation power, which can differ from G*Power's exact method by one participant), the page says so.

What I learned

Building statistics tools is mostly an exercise in being honest about edge cases: ties, tiny samples, perfect collinearity, a column with no variance. Each one needed a clear error message rather than a silent NaN.

If you teach research methods, supervise theses, or are writing one yourself, I would love feedback. The site is free, needs no sign-up, and is at solvegrid.online.

Top comments (0)