<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>web-app | Dhafer Malouche</title><link>https://dhafermalouche.net/tag/web-app/</link><atom:link href="https://dhafermalouche.net/tag/web-app/index.xml" rel="self" type="application/rss+xml"/><description>web-app</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>Dhafer Malouche © 2026</copyright><lastBuildDate>Sat, 02 May 2026 00:00:00 +0000</lastBuildDate><image><url>https://dhafermalouche.net/media/icon_hu294da7f24af66942b94b8e240e33fe59_2153342_512x512_fill_lanczos_center_3.png</url><title>web-app</title><link>https://dhafermalouche.net/tag/web-app/</link></image><item><title>StatANOVA — One-way ANOVA &amp; Tukey HSD Workbench</title><link>https://dhafermalouche.net/apps/statanova/</link><pubDate>Sat, 02 May 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statanova/</guid><description>&lt;p>An interactive web application that fits a one-way analysis of variance and its standard post-hoc decomposition entirely in the student&amp;rsquo;s browser. &lt;strong>StatANOVA&lt;/strong> extends the small family of teaching tools designed for undergraduate statistics at Qatar University: where &lt;strong>StatTests&lt;/strong> answers &lt;em>which test do I run on these two groups&lt;/em> and &lt;strong>StatRegress&lt;/strong> asks &lt;em>given these data, what is the model&lt;/em>, &lt;strong>StatANOVA&lt;/strong> asks &lt;em>do these $k$ groups differ on average — and if so, which ones?&lt;/em>&lt;/p>
&lt;h2 id="why-an-anova-workbench">Why an ANOVA workbench?&lt;/h2>
&lt;p>The pedagogical gap StatANOVA targets is the step from the global $F$-test to a defensible per-pair conclusion. In a typical lecture, students are taught the $F$-statistic for the equality-of-means hypothesis $H_{0}: \mu_{1} = \cdots = \mu_{k}$, but the natural next question — &lt;em>which groups are responsible for the rejection?&lt;/em> — is usually answered with a quick remark about Tukey&amp;rsquo;s honestly significant difference. StatANOVA closes that loop interactively: the student uploads a real dataset, reads the ANOVA decomposition, and immediately sees the Tukey HSD intervals, the family-wise adjusted $p$-values, and the resulting compact-letter-display (CLD) groupings on the same screen.&lt;/p>
&lt;h2 id="what-the-app-does">What the app does&lt;/h2>
&lt;p>&lt;strong>Input.&lt;/strong> Upload a CSV (UTF-8, header row, comma-separated, dot decimal, $\le 10$ MB and $\le 50{,}000$ rows after dropping NAs). The app inspects the columns and proposes:&lt;/p>
&lt;ul>
&lt;li>a &lt;strong>factor variable&lt;/strong> — any column with between 2 and 6 distinct values, with at least 3 observations per level after listwise deletion;&lt;/li>
&lt;li>one or more &lt;strong>continuous response variables&lt;/strong> — numeric columns selectable in a checklist, capped at 50 active responses.&lt;/li>
&lt;/ul>
&lt;p>The student then chooses the significance level $\alpha$ and the post-hoc method (Tukey HSD by default).&lt;/p>
&lt;p>&lt;strong>Inferential output.&lt;/strong> For each selected response, the app reports:&lt;/p>
&lt;ul>
&lt;li>the &lt;strong>ANOVA summary table&lt;/strong> (sums of squares, degrees of freedom, mean squares, the $F$-statistic, and the corresponding $p$-value);&lt;/li>
&lt;li>the &lt;strong>compact-letter-display (CLD) table&lt;/strong>: each group is annotated with letters such that two groups share at least one letter if and only if their means are not significantly different at level $\alpha$ under the chosen multiple-comparison correction;&lt;/li>
&lt;li>a &lt;strong>forest plot of pairwise mean differences&lt;/strong> with simultaneous confidence intervals, ordered for readability, with intervals that exclude zero highlighted.&lt;/li>
&lt;/ul>
&lt;p>Because the workflow runs across many response variables in a single pass, StatANOVA is well suited to the kind of multivariate teaching dataset (Qatar Biobank-style, biomedical, or biodiversity) where a single grouping factor is to be screened against several outcomes.&lt;/p>
&lt;h2 id="classroom-workflow">Classroom workflow&lt;/h2>
&lt;p>In lectures, the instructor mirrors the app on the projector while writing the model on the board: the algebraic decomposition $\mathrm{SS}&lt;em>{\text{total}} = \mathrm{SS}&lt;/em>{\text{between}} + \mathrm{SS}_{\text{within}}$ is read off the same table the students see. In practice sessions, students upload their assigned CSV, copy the ANOVA table, the CLD summary, and the forest plot into their report, and explain in one paragraph (i) whether the global $F$-test rejects, (ii) which pairs of groups differ once the family-wise error is controlled, and (iii) how the CLD letters and the forest plot tell the same story in two complementary forms.&lt;/p>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application: all computation runs in the browser, with no server round-trip and no data leaving the device. The ANOVA decomposition is computed directly from the group means and pooled variance estimator; Tukey HSD intervals use the studentised-range distribution at the chosen family-wise level; the CLD is constructed by the standard insert-and-absorb algorithm on the matrix of adjusted $p$-values. The static bundle is deployed on Netlify; like its siblings, it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatPCA — Principal Component Analysis Workbench</title><link>https://dhafermalouche.net/apps/statpca/</link><pubDate>Thu, 30 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statpca/</guid><description>&lt;p>A browser-only teaching workbench for the most-used dimension-reduction technique in applied multivariate statistics: &lt;strong>Principal Component Analysis&lt;/strong>. &lt;strong>StatPCA&lt;/strong> completes the family of teaching tools developed for undergraduate and graduate statistics at Qatar University, alongside &lt;strong>StatTables&lt;/strong>, &lt;strong>StatTests&lt;/strong>, &lt;strong>StatRegress&lt;/strong>, &lt;strong>StatCI&lt;/strong>, &lt;strong>StatPower&lt;/strong>, and &lt;strong>StatCorr&lt;/strong>.&lt;/p>
&lt;h2 id="why-a-pca-workbench">Why a PCA workbench?&lt;/h2>
&lt;p>Principal Component Analysis is often presented as a one-line recipe — &amp;ldquo;decompose the correlation matrix and keep the first few eigenvectors&amp;rdquo; — and the geometric, algebraic, and inferential layers of the method are collapsed into a single black-box call. &lt;strong>StatPCA&lt;/strong> keeps the layers separate and visible: the &lt;em>data&lt;/em> panel makes the centering and scaling step explicit, the &lt;em>eigen-decomposition&lt;/em> panel reports eigenvalues and eigenvectors of the chosen matrix, the &lt;em>variance&lt;/em> panel reports the scree plot and the cumulative proportion of variance explained, and the &lt;em>projection&lt;/em> panel renders the score plot, the loading plot, and the biplot on coordinated axes.&lt;/p>
&lt;h2 id="what-the-app-does">What the app does&lt;/h2>
&lt;p>&lt;strong>Input.&lt;/strong> Paste a CSV with $p \geq 2$ numeric variables, load one of the bundled teaching datasets (e.g., the classical decathlon, USArrests, or iris), or generate synthetic correlated data with a user-specified covariance structure. Categorical or grouping variables are kept aside and used only to colour the score plot.&lt;/p>
&lt;p>&lt;strong>Pre-processing options.&lt;/strong> Mean-centering is applied by default; the user toggles between PCA on the &lt;strong>correlation matrix&lt;/strong> (each variable scaled to unit variance) and PCA on the &lt;strong>covariance matrix&lt;/strong> (variables left on their original scale). Missing values are handled by listwise deletion or by mean-imputation, with both options reported next to the result.&lt;/p>
&lt;p>&lt;strong>Quantities reported.&lt;/strong> For every fit the app returns:&lt;/p>
&lt;ul>
&lt;li>the &lt;strong>eigenvalues&lt;/strong> $\lambda_{1} \geq \lambda_{2} \geq \cdots \geq \lambda_{p} \geq 0$ of the chosen matrix, with their proportion $\lambda_{k}/\sum_{j}\lambda_{j}$ and cumulative proportion;&lt;/li>
&lt;li>the &lt;strong>loadings matrix&lt;/strong> $\mathbf{V} = (v_{jk})$ with columns equal to the eigenvectors of the chosen matrix; loadings are reported on the unit-norm scale and on the &lt;strong>correlation-with-component&lt;/strong> scale $v_{jk}\sqrt{\lambda_{k}}$, so that the user can read off the linear association between each original variable and each component;&lt;/li>
&lt;li>the &lt;strong>scores&lt;/strong> $z_{ik} = \sum_{j} v_{jk},(x_{ij}-\bar x_{j})/s_{j}$ of each observation on each component;&lt;/li>
&lt;li>the &lt;strong>communalities&lt;/strong> and the &lt;strong>squared cosines&lt;/strong> $\cos^{2}_{ik}$, which quantify how well each observation is represented in the chosen low-dimensional subspace.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Visual output.&lt;/strong> The app renders three coordinated plots:&lt;/p>
&lt;ol>
&lt;li>the &lt;strong>scree plot&lt;/strong> with the broken-stick and Kaiser ($\lambda &amp;gt; 1$) reference lines superimposed, so that the choice of the number of retained components is grounded in an explicit rule rather than visual judgement alone;&lt;/li>
&lt;li>the &lt;strong>score plot&lt;/strong> of observations on $(\text{PC}&lt;em>{k}, \text{PC}&lt;/em>{\ell})$, with optional colouring by a grouping variable and confidence ellipses per group;&lt;/li>
&lt;li>the &lt;strong>biplot&lt;/strong>, which overlays the loading vectors on the score plot using the standard scaling so that the cosine of the angle between two arrows approximates the correlation between the corresponding variables.&lt;/li>
&lt;/ol>
&lt;h2 id="pedagogical-use">Pedagogical use&lt;/h2>
&lt;p>StatPCA is designed for the lecture in which PCA is introduced and for the practical that follows it. Three exercises map naturally to the app:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Standardisation matters.&lt;/strong> Run PCA on the covariance matrix of a dataset whose variables are on incompatible scales (e.g., heights in cm and weights in kg), then re-run on the correlation matrix and watch the dominant component swap. Discuss when each choice is appropriate.&lt;/li>
&lt;li>&lt;strong>How many components?&lt;/strong> Compare the Kaiser rule, the broken-stick rule, and the elbow-on-the-scree-plot rule on the same data. Show that they need not agree, and connect the disagreement to the eigenvalue spectrum.&lt;/li>
&lt;li>&lt;strong>Interpreting the axes.&lt;/strong> Use the loadings (on the correlation-with-component scale) to label the principal axes in substantive terms; use the squared cosines to flag observations that the two-dimensional summary represents poorly.&lt;/li>
&lt;/ol>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React + Vite&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip and no data leaving the device. The eigen-decomposition is performed by a numerically stable QR-based routine on the symmetric correlation/covariance matrix; for the score plot the app uses the singular value decomposition of the centered (and optionally scaled) data matrix, which avoids forming and squaring the cross-product matrix when the number of variables is large. The static bundle is deployed on Netlify; like its siblings it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatCorr — Correlation Workbench</title><link>https://dhafermalouche.net/apps/statcorr/</link><pubDate>Wed, 29 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statcorr/</guid><description>&lt;p>A browser-only teaching workbench for the most-used dependence summary in applied statistics: the &lt;strong>correlation coefficient&lt;/strong>. &lt;strong>StatCorr&lt;/strong> completes the small family of teaching tools developed for undergraduate statistics at Qatar University, alongside &lt;strong>StatTables&lt;/strong>, &lt;strong>StatTests&lt;/strong>, &lt;strong>StatRegress&lt;/strong>, &lt;strong>StatCI&lt;/strong>, and &lt;strong>StatPower&lt;/strong>.&lt;/p>
&lt;h2 id="why-a-correlation-workbench">Why a correlation workbench?&lt;/h2>
&lt;p>In introductory courses the Pearson coefficient $r$ is often introduced as a single number and then immediately overloaded with interpretations — &lt;em>strength&lt;/em>, &lt;em>direction&lt;/em>, &lt;em>linearity&lt;/em>, &lt;em>predictive value&lt;/em>, &lt;em>dependence&lt;/em>. Students leave the lecture confusing the four. &lt;strong>StatCorr&lt;/strong> keeps the four interpretations visually separate: the scatter plot makes the &lt;em>geometry&lt;/em> of the association explicit, the coefficient panel reports its &lt;em>magnitude&lt;/em>, the inference panel reports the &lt;em>evidence&lt;/em> against $H_{0}: \rho = 0$, and the rank-based panel shows when the linear summary is misleading.&lt;/p>
&lt;h2 id="what-the-app-does">What the app does&lt;/h2>
&lt;p>&lt;strong>Input.&lt;/strong> Paste a CSV with two numeric variables, load one of the bundled teaching datasets, or use the simulator to draw $n$ observations from a chosen joint distribution (bivariate normal with prescribed $\rho$, monotone-but-non-linear, or contaminated with outliers).&lt;/p>
&lt;p>&lt;strong>Coefficients reported.&lt;/strong> For every dataset the app reports three coefficients side by side:&lt;/p>
&lt;ul>
&lt;li>the &lt;strong>Pearson&lt;/strong> correlation $r = \dfrac{\sum (x_{i}-\bar x)(y_{i}-\bar y)}{\sqrt{\sum (x_{i}-\bar x)^{2}\sum (y_{i}-\bar y)^{2}}}$, with the Fisher-$z$ confidence interval $\tanh!\big(\operatorname{atanh}(r) \pm z_{1-\alpha/2}/\sqrt{n-3}\big)$ and the $t$-test for $H_{0}: \rho = 0$;&lt;/li>
&lt;li>the &lt;strong>Spearman&lt;/strong> rank correlation $\rho_{s}$ — robust to monotone transformations and to outliers — with its asymptotic test;&lt;/li>
&lt;li>the &lt;strong>Kendall&lt;/strong> $\tau$, reported with the exact small-sample distribution when feasible.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Visual output.&lt;/strong> A scatter plot with the regression line, the marginal histograms, and a $95%$ confidence ellipse for the joint distribution is drawn alongside the coefficient table. A drag-a-point interaction lets students pull a single observation and watch the three coefficients, the regression line, and the $p$-values update — making vivid the difference between a Pearson coefficient that collapses under one outlier and a Spearman coefficient that does not.&lt;/p>
&lt;h2 id="pedagogical-use">Pedagogical use&lt;/h2>
&lt;p>StatCorr is designed for the lecture in which correlation is introduced and for the practical that follows it. Three exercises map naturally to the app:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Linear vs. monotone vs. independent.&lt;/strong> Generate samples from a bivariate normal, from $Y = X^{3}+\varepsilon$, and from $Y = X^{2} + \varepsilon$ on $[-1,1]$. Compare Pearson, Spearman, and Kendall, and discuss why $r \approx 0$ does &lt;strong>not&lt;/strong> imply independence.&lt;/li>
&lt;li>&lt;strong>Outlier sensitivity.&lt;/strong> Pin a Pearson coefficient near $0.9$, then drag a single point far from the cloud and watch $r$ collapse while $\rho_{s}$ and $\tau$ barely move.&lt;/li>
&lt;li>&lt;strong>Inference vs. magnitude.&lt;/strong> With $n = 5$ a sample correlation of $0.6$ is not significantly different from zero; with $n = 500$ a sample correlation of $0.1$ is. The Fisher-$z$ interval makes both statements explicit on a single graph.&lt;/li>
&lt;/ol>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React + Vite&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip and no data leaving the device. Quantiles for the $t$ and standard normal distributions used for inference and for the Fisher-$z$ interval are computed with the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed). Random samples for the simulator are produced from a high-quality PRNG seeded by the user, so that classroom demonstrations are reproducible across machines. The static bundle is deployed on Netlify; like its siblings it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatCI — Confidence Interval Visualizer</title><link>https://dhafermalouche.net/apps/statci/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statci/</guid><description>&lt;p>A browser-only simulation tool for the single most misunderstood object in introductory statistics: the &lt;strong>confidence interval&lt;/strong>. &lt;strong>StatCI&lt;/strong> turns the frequentist definition into a visible, repeatable experiment, so that a student can &lt;em>see&lt;/em> the long-run coverage statement instead of only reading it.&lt;/p>
&lt;h2 id="the-misconception-statci-addresses">The misconception StatCI addresses&lt;/h2>
&lt;p>Surveys of statistics students consistently report the same wrong reading of &amp;ldquo;95% confidence&amp;rdquo;: the belief that a particular computed interval $[\hat\theta_{L},\hat\theta_{U}]$ contains the true parameter $\theta$ with probability $0.95$. The frequentist statement is in fact about the &lt;em>procedure&lt;/em>, not about any single interval: across many independent samples from the same population, the proportion of CIs that cover $\theta$ converges to the nominal level $1-\alpha$. StatCI turns this abstract sentence into an animation.&lt;/p>
&lt;h2 id="what-the-app-does">What the app does&lt;/h2>
&lt;p>The user picks (i) a sampling distribution and the true parameter value $\theta$, (ii) a sample size $n$, (iii) a confidence level $1-\alpha$, and (iv) the type of interval (e.g., $z$- or $t$-interval for a mean, exact / Wilson / Wald interval for a proportion, $\chi^{2}$ interval for a variance). The app then:&lt;/p>
&lt;ul>
&lt;li>draws $K$ independent samples from the chosen population;&lt;/li>
&lt;li>computes the corresponding $K$ confidence intervals;&lt;/li>
&lt;li>stacks them on a single horizontal axis, with the true parameter $\theta$ marked by a vertical reference line;&lt;/li>
&lt;li>colours each interval according to whether it covers $\theta$ (navy) or misses it (coral);&lt;/li>
&lt;li>reports the running empirical coverage $\hat{C}_K$ and compares it to the nominal $1-\alpha$.&lt;/li>
&lt;/ul>
&lt;p>The simulation can be advanced one sample at a time, or in batches of $50$/$500$/$5000$, so students can watch the empirical coverage stabilise at the nominal level as $K$ grows.&lt;/p>
&lt;h2 id="pedagogical-use">Pedagogical use&lt;/h2>
&lt;p>StatCI is designed for the lecture in which the definition of a confidence interval is introduced, and for the practical that follows. Three exercises map naturally to the app:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Coverage at the nominal level.&lt;/strong> Verify that for a $z$-interval on a normal mean, $\hat{C}_K \to 0.95$ as $K \to \infty$.&lt;/li>
&lt;li>&lt;strong>The cost of model misspecification.&lt;/strong> Build a Wald interval for a binomial proportion close to $0$ or $1$ and observe that the empirical coverage falls well below $0.95$ — motivating the Wilson and Clopper–Pearson alternatives.&lt;/li>
&lt;li>&lt;strong>The effect of $n$ and $\alpha$.&lt;/strong> Show that doubling $n$ halves the interval width while leaving coverage unchanged, and that lowering $\alpha$ raises coverage at the cost of width.&lt;/li>
&lt;/ol>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React + Vite&lt;/strong>: all sampling and inference run in the student&amp;rsquo;s browser, with no server round-trip and no data leaving the device. Random samples are produced from a high-quality PRNG seeded by the user (so that classroom demonstrations are reproducible across machines). Quantiles for the $z$, $t$, $\chi^{2}$, and $F$ distributions are computed with the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed). The static bundle is deployed on Netlify; like its siblings, it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatPower — Power &amp; Sample-Size Calculator</title><link>https://dhafermalouche.net/apps/statpower/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statpower/</guid><description>&lt;p>A browser-only calculator and visualiser for the four-quantity relationship that governs the design of a statistical study: &lt;strong>effect size&lt;/strong>, &lt;strong>sample size $n$&lt;/strong>, &lt;strong>type-I error $\alpha$&lt;/strong>, and &lt;strong>power $1-\beta$&lt;/strong>. &lt;strong>StatPower&lt;/strong> treats these four quantities symmetrically — fix any three and the app solves for the fourth — and accompanies the numerical answer with the corresponding power curve, so that the student sees what a $5%$ change in $n$ or in $d$ does to the chance of a true rejection.&lt;/p>
&lt;h2 id="the-four-quantity-rule">The four-quantity rule&lt;/h2>
&lt;p>For a fixed test, the relationship $\Pr(\text{reject } H_{0} \mid H_{1}) = 1 - \beta(d, n, \alpha)$ implicitly ties together $d$, $n$, $\alpha$, and the resulting power $1-\beta$. Any three of these determine the fourth. StatPower exposes this as a single interface: enter three of the four quantities and the app returns the fourth and draws the curve along which it sits.&lt;/p>
&lt;h2 id="tests-covered">Tests covered&lt;/h2>
&lt;p>&lt;strong>Means.&lt;/strong> One-sample $t$-test ($d = (\mu - \mu_{0})/\sigma$), paired $t$-test (on differences), two-sample $t$-test (Cohen&amp;rsquo;s $d$, pooled SD), one-way ANOVA (Cohen&amp;rsquo;s $f$).&lt;/p>
&lt;p>&lt;strong>Proportions.&lt;/strong> One-proportion $z$-test, two-proportion $z$-test (Cohen&amp;rsquo;s $h$ or risk-difference parameterisation).&lt;/p>
&lt;p>&lt;strong>Correlation and association.&lt;/strong> Test of $\rho = 0$ (Fisher $z$-transform), $\chi^{2}$ test of independence (Cohen&amp;rsquo;s $w$).&lt;/p>
&lt;p>&lt;strong>Regression.&lt;/strong> Global $F$-test for $H_{0}: \beta_{1} = \cdots = \beta_{p} = 0$ (Cohen&amp;rsquo;s $f^{2}$), single-coefficient $t$-test in multiple regression.&lt;/p>
&lt;p>For each test the app reports the non-centrality parameter (e.g., $\lambda = d\sqrt{n/2}$ for a two-sample $t$-test) so that students see the algebra behind the answer rather than receiving a black-box number.&lt;/p>
&lt;h2 id="what-the-user-sees">What the user sees&lt;/h2>
&lt;p>Three coordinated panels respond to every change of inputs:&lt;/p>
&lt;ul>
&lt;li>a &lt;strong>scalar answer panel&lt;/strong> showing the solved quantity to four significant figures;&lt;/li>
&lt;li>the &lt;strong>power curve&lt;/strong> $1-\beta$ as a function of the chosen free axis (typically $n$ or $d$), with the operating point marked and the target power drawn as a horizontal reference;&lt;/li>
&lt;li>a &lt;strong>distribution panel&lt;/strong> with the null and alternative reference distributions overlaid, the rejection region shaded, and the geometric area corresponding to $\beta$ — the type-II error — highlighted, so that the tradeoff between $\alpha$ and $\beta$ is visible rather than merely stated.&lt;/li>
&lt;/ul>
&lt;h2 id="classroom-workflow">Classroom workflow&lt;/h2>
&lt;p>In lectures, the instructor steps through the four-quantity rule by varying one input at a time and watching the curve and the geometry update. In assignments, students paste a target effect size and target power and report the required $n$, together with the non-centrality parameter and the curve they read it from — making grading deterministic and removing the ambiguity that surrounds the choice of effect-size convention. The app is a natural complement to the inferential procedures in &lt;strong>StatTests&lt;/strong>: the design of the study and its analysis use the same reference distributions, displayed in the same shaded form.&lt;/p>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React + Vite&lt;/strong> and styled with &lt;strong>Tailwind CSS&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip. The non-central $t$, $F$, and $\chi^{2}$ distributions used to evaluate power, and the central distributions used for critical values, are computed with the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed); inverse problems (solving for $n$ or $d$) are obtained by safeguarded bisection on the monotone power function. The static bundle is deployed on Netlify; like its siblings, it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatRegress — Linear Regression Workbench</title><link>https://dhafermalouche.net/apps/statregress/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/statregress/</guid><description>&lt;p>An interactive web application that fits and diagnoses ordinary least-squares regression models entirely in the student&amp;rsquo;s browser. &lt;strong>StatRegress&lt;/strong> completes a small family of teaching tools designed for undergraduate statistics at Qatar University: where &lt;strong>StatTables&lt;/strong> answers &lt;em>what is the critical value&lt;/em> and &lt;strong>StatTests&lt;/strong> answers &lt;em>which test do I run&lt;/em>, &lt;strong>StatRegress&lt;/strong> asks &lt;em>given these data, what is the model — and is it any good?&lt;/em>&lt;/p>
&lt;h2 id="why-a-regression-workbench">Why a regression workbench?&lt;/h2>
&lt;p>Most introductory regression instruction is split between (i) computing $\hat{\beta}$, $\mathrm{SE}(\hat{\beta})$, $t$- and $F$-statistics by hand on toy data and (ii) demonstrating the same calculations in R or Python with &lt;code>lm()&lt;/code>/&lt;code>statsmodels&lt;/code>. Both have pedagogical limits: hand calculations don&amp;rsquo;t scale beyond $n \approx 10$, while a full statistical environment hides the geometry of the fit behind a console output. StatRegress sits between the two — students paste a real dataset, see the regression line drawn directly on the scatter, and read the standard coefficient table and diagnostic plots in the same view, with no installation and no server round-trip.&lt;/p>
&lt;h2 id="what-the-app-does">What the app does&lt;/h2>
&lt;p>&lt;strong>Input.&lt;/strong> Paste a CSV (or load one of the bundled teaching datasets), choose the response and the predictor(s), and select the assumed model (simple linear regression, multiple regression with up to a small handful of predictors, or polynomial extension).&lt;/p>
&lt;p>&lt;strong>Estimation output.&lt;/strong> A regression report formatted as in a textbook:&lt;/p>
&lt;ul>
&lt;li>the &lt;strong>coefficient table&lt;/strong> with $\hat{\beta}&lt;em>{j}$, $\mathrm{SE}(\hat{\beta}&lt;/em>{j})$, $t_{j} = \hat{\beta}&lt;em>{j}/\mathrm{SE}(\hat{\beta}&lt;/em>{j})$, the two-sided $p$-value, and the $95%$ confidence interval;&lt;/li>
&lt;li>the &lt;strong>model summary&lt;/strong>: residual standard error $\hat{\sigma}$, multiple $R^{2}$, adjusted $R^{2}$, and the global $F$-test for $H_{0}: \beta_{1} = \cdots = \beta_{p} = 0$;&lt;/li>
&lt;li>the &lt;strong>ANOVA decomposition&lt;/strong> of the total sum of squares.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Diagnostic output.&lt;/strong> The four classical residual plots — residuals vs.\ fitted values, normal Q–Q plot of standardised residuals, scale–location ($\sqrt{|r_{i}|}$ vs.\ $\hat{y}_{i}$), and residuals vs.\ leverage with &lt;strong>Cook&amp;rsquo;s distance&lt;/strong> contours — together with a flag for influential or high-leverage observations.&lt;/p>
&lt;h2 id="drag-a-point-mode">Drag-a-point mode&lt;/h2>
&lt;p>For simple linear regression the app exposes a &lt;strong>drag-a-point&lt;/strong> interaction: students grab a single observation in the scatter, move it, and the fitted line, $R^{2}$, the coefficient table, and the residuals all update in real time. This makes intuitive what an algebraic discussion of leverage and influence usually fails to convey — that a single high-leverage point can rotate the line, that an outlier in the middle of the design space barely moves the slope, and that Cook&amp;rsquo;s distance is geometric in nature.&lt;/p>
&lt;h2 id="classroom-workflow">Classroom workflow&lt;/h2>
&lt;p>In lectures, the instructor mirrors the app on the projector while building the model on the board: each new term in the algebra has its counterpart in the live coefficient table. In practice sessions, students paste their assigned dataset, copy the coefficient table and diagnostic plots into their solution, and report which assumptions look satisfied, which look suspicious, and which observations they would investigate further. Because the app produces a deterministic report from a deterministic input, grading is reproducible.&lt;/p>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip and no data leaving the device. The OLS estimator is computed via the QR decomposition for numerical stability; standard errors and inference are obtained from the corresponding $(X^{\top}X)^{-1}$ block. Distributional quantiles for the $t$ and $F$ tables are computed with the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed). The static bundle is deployed on Netlify; like its siblings, it works offline after first load and has no external run-time dependencies.&lt;/p></description></item><item><title>StatTables — Interactive Statistical Distribution Tables &amp; Calculators</title><link>https://dhafermalouche.net/apps/stattables/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/stattables/</guid><description>&lt;p>An interactive web application that replaces the printed statistical tables traditionally found at the back of introductory statistics textbooks. The app is designed for undergraduate courses in statistical inference, probability, and applied statistics at Qatar University, and is freely available to students and instructors elsewhere.&lt;/p>
&lt;h2 id="why-not-the-printed-tables">Why not the printed tables?&lt;/h2>
&lt;p>Classical textbook tables are fixed to a handful of significance levels (typically $\alpha \in {0.10, 0.05, 0.025, 0.01, 0.005}$) and to a limited grid of degrees of freedom or parameter values. In practice, students need critical values and tail probabilities at arbitrary points — and instructors want them reproducible, shareable, and visually annotated. &lt;strong>StatTables&lt;/strong> returns exact values for any query, simultaneously displays the corresponding shaded region on the density curve, and shows the formula being applied — so the numerical answer is always paired with both geometric intuition and analytical rigor.&lt;/p>
&lt;h2 id="distributions-covered">Distributions covered&lt;/h2>
&lt;p>Continuous:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Standard normal&lt;/strong> $Z \sim \mathcal{N}(0,1)$ — critical values $z_{\alpha}$, two-sided cutoffs $z_{\alpha/2}$, and tail probabilities $P(Z &amp;gt; z)$.&lt;/li>
&lt;li>&lt;strong>Student $t$&lt;/strong> — $t_{\alpha,\nu}$ for any degrees of freedom $\nu$; $t$-tests and confidence intervals for the mean under unknown variance.&lt;/li>
&lt;li>&lt;strong>Chi-square $\chi^{2}$&lt;/strong> — lower and upper critical values $\chi^{2}_{\alpha,\nu}$ for variance tests, goodness-of-fit, and tests of independence.&lt;/li>
&lt;li>&lt;strong>Fisher $F$&lt;/strong> — $F_{\alpha, \nu_{1}, \nu_{2}}$ for analysis of variance, regression overall-significance tests, and variance-ratio comparisons.&lt;/li>
&lt;li>&lt;strong>Exponential&lt;/strong> — survival, hazard, and waiting-time problems.&lt;/li>
&lt;/ul>
&lt;p>Discrete:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Binomial&lt;/strong> $X \sim \mathcal{B}(n,p)$ — pmf, cdf, and tail probabilities for finite Bernoulli experiments.&lt;/li>
&lt;li>&lt;strong>Poisson&lt;/strong> $X \sim \mathcal{P}(\lambda)$ — counts of rare events over fixed exposure.&lt;/li>
&lt;/ul>
&lt;h2 id="how-students-use-it">How students use it&lt;/h2>
&lt;p>For every distribution the app supports both directions:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Cutoff $\rightarrow$ probability.&lt;/strong> Given a value of the test statistic, obtain the one- or two-tailed $p$-value.&lt;/li>
&lt;li>&lt;strong>Probability $\rightarrow$ cutoff.&lt;/strong> Given a significance level $\alpha$, obtain the corresponding critical value.&lt;/li>
&lt;/ol>
&lt;p>Each query is rendered in three coordinated panels:&lt;/p>
&lt;ul>
&lt;li>a &lt;strong>classical book-style lookup table&lt;/strong>, with the cell matching the current query highlighted;&lt;/li>
&lt;li>a &lt;strong>shaded density plot&lt;/strong> indicating the region the reported probability refers to, removing the ambiguity that often surrounds one- vs. two-tailed procedures;&lt;/li>
&lt;li>a &lt;strong>step-by-step formula breakdown&lt;/strong>, so the student can see the integral or summation being evaluated.&lt;/li>
&lt;/ul>
&lt;h2 id="classroom-workflow">Classroom workflow&lt;/h2>
&lt;p>The app is intended as an in-class replacement for the printed appendix tables. During exercises, students paste the query parameters they used into their solution; during exams the app&amp;rsquo;s screen can be mirrored on the instructor&amp;rsquo;s display so the class works from a shared source of truth. The accompanying solution sheets indicate the exact query, not a table row, making grading deterministic and self-checkable.&lt;/p>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React + Vite&lt;/strong> and styled with &lt;strong>Tailwind CSS&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip. Quantiles, cdf, and pmf values are computed with the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed). Density curves are rendered on an HTML canvas so that shaded regions and critical-value markers stay crisp on high-DPI displays. The bundle is fully static and is deployed on Netlify, which means it works offline after first load and has no external dependencies at run time.&lt;/p></description></item><item><title>StatTests — Hypothesis Testing Hub</title><link>https://dhafermalouche.net/apps/stattests/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://dhafermalouche.net/apps/stattests/</guid><description>&lt;p>An interactive web application that performs the hypothesis tests covered in a standard one- or two-semester course in statistical inference, with a uniform interface, fully visible formulas, and automatic checking of the assumptions on which each procedure depends. The app is the natural complement to &lt;strong>StatTables&lt;/strong>: where StatTables answers &lt;em>what is the critical value&lt;/em> and &lt;em>what is the tail probability&lt;/em>, StatTests answers &lt;em>which test do I run, and what does the conclusion look like&lt;/em>.&lt;/p>
&lt;h2 id="why-a-unified-hub">Why a unified hub?&lt;/h2>
&lt;p>Most introductory textbooks present each test as a self-contained recipe — formula for the test statistic, sampling distribution under $H_{0}$, decision rule, and example. In practice, students confuse the recipes, mis-identify the appropriate distribution, and forget to verify the assumptions. &lt;strong>StatTests&lt;/strong> unifies all the standard procedures behind a single interface: pick the inference problem (one mean, two means, proportion, variance ratio, ANOVA, association, location shift, …), enter the data or the summary statistics, and the app returns a complete inference report consisting of:&lt;/p>
&lt;ul>
&lt;li>the explicit hypotheses $H_{0}$ vs.\ $H_{1}$ in the chosen direction (left, right, two-sided);&lt;/li>
&lt;li>the test statistic and its formula, with all values substituted;&lt;/li>
&lt;li>the reference distribution, displayed with the rejection region(s) shaded;&lt;/li>
&lt;li>the $p$-value, the critical value(s), and the decision at the user-selected $\alpha$;&lt;/li>
&lt;li>a checklist of the parametric assumptions, marked as satisfied, suspicious, or violated when checkable from the data.&lt;/li>
&lt;/ul>
&lt;h2 id="tests-covered">Tests covered&lt;/h2>
&lt;p>The current release implements 14 procedures grouped by inferential goal:&lt;/p>
&lt;p>&lt;strong>Means.&lt;/strong> One-sample $t$-test, paired $t$-test, two-sample $t$-test (pooled and Welch), one-way ANOVA.&lt;/p>
&lt;p>&lt;strong>Proportions.&lt;/strong> One-proportion $z$-test, two-proportion $z$-test.&lt;/p>
&lt;p>&lt;strong>Variances.&lt;/strong> Chi-square test for a single variance, $F$-test for the ratio of two variances, Bartlett / Levene-style homogeneity check feeding into ANOVA.&lt;/p>
&lt;p>&lt;strong>Categorical.&lt;/strong> $\chi^{2}$ goodness-of-fit, $\chi^{2}$ test of independence in a contingency table.&lt;/p>
&lt;p>&lt;strong>Non-parametric.&lt;/strong> Wilcoxon signed-rank (one-sample and paired), Mann–Whitney $U$ (two-sample location), Kruskal–Wallis (one-way location across $k &amp;gt; 2$ groups).&lt;/p>
&lt;h2 id="classroom-workflow">Classroom workflow&lt;/h2>
&lt;p>In lectures, the instructor mirrors the app on the projector and walks through a worked example: the formula panel shows exactly the algebra the instructor would write on the board, while the shaded density panel makes the geometry of the decision rule explicit. In practice sessions and exams, students paste the inputs they used together with the resulting $p$-value, which makes grading deterministic and removes ambiguity around one- vs. two-tailed conventions. The accompanying solution sheets cite the exact query rather than a row in a table.&lt;/p>
&lt;h2 id="technical-notes">Technical notes&lt;/h2>
&lt;p>The app is a single-page client-side application built with &lt;strong>React&lt;/strong>: all computation runs in the student&amp;rsquo;s browser, with no server round-trip. Distributional computations rely on the &lt;a href="https://github.com/jstat/jstat" target="_blank" rel="noopener">jStat&lt;/a> numerical library (MIT-licensed). The static bundle is deployed on Netlify, which means it works offline after first load and has no external dependencies at run time.&lt;/p></description></item></channel></rss>