<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pearson | Dhafer Malouche</title><link>https://dhafermalouche.net/tag/pearson/</link><atom:link href="https://dhafermalouche.net/tag/pearson/index.xml" rel="self" type="application/rss+xml"/><description>pearson</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>Dhafer Malouche © 2026</copyright><lastBuildDate>Wed, 29 Apr 2026 00:00:00 +0000</lastBuildDate><image><url>https://dhafermalouche.net/media/icon_hu294da7f24af66942b94b8e240e33fe59_2153342_512x512_fill_lanczos_center_3.png</url><title>pearson</title><link>https://dhafermalouche.net/tag/pearson/</link></image><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></channel></rss>