@winm2m/inferential-stats-js 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +185 -417
- package/dist/python/dimension.d.ts +1 -1
- package/dist/stats-worker.js +17 -3
- package/dist/stats-worker.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
## Table of Contents
|
|
13
13
|
|
|
14
14
|
- [Architecture Overview](#architecture-overview)
|
|
15
|
-
- [Installation](#installation)
|
|
16
|
-
- [Quick Start](#quick-start)
|
|
17
|
-
- [CDN / CodePen Usage](#cdn--codepen-usage)
|
|
18
|
-
- [API Reference](#api-reference)
|
|
19
15
|
- [Core Analysis Features — Mathematical & Technical Documentation](#core-analysis-features--mathematical--technical-documentation)
|
|
20
16
|
- [① Descriptive Statistics](#-descriptive-statistics)
|
|
21
17
|
- [② Compare Means](#-compare-means)
|
|
@@ -23,6 +19,10 @@
|
|
|
23
19
|
- [④ Classify](#-classify)
|
|
24
20
|
- [⑤ Dimension Reduction](#-dimension-reduction)
|
|
25
21
|
- [⑥ Scale](#-scale)
|
|
22
|
+
- [Installation](#installation)
|
|
23
|
+
- [Quick Start](#quick-start)
|
|
24
|
+
- [CDN / CodePen Usage](#cdn--codepen-usage)
|
|
25
|
+
- [API Reference](#api-reference)
|
|
26
26
|
- [Sample Data](#sample-data)
|
|
27
27
|
- [Progress Event Handling](#progress-event-handling)
|
|
28
28
|
- [License](#license)
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
│ │ (ESM / CJS) │ (Transferable) │ │
|
|
42
42
|
│ └───────────────────────┘ ▼ │
|
|
43
43
|
│ ┌─────────────────────┐ │
|
|
44
|
-
│ │ Web Worker
|
|
45
|
-
│ │ ┌────────────────┐
|
|
46
|
-
│ │ │ Pyodide WASM │
|
|
47
|
-
│ │ │ ┌───────────┐ │
|
|
48
|
-
│ │ │ │ Python
|
|
49
|
-
│ │ │ │ Runtime
|
|
50
|
-
│ │ │ └───────────┘ │
|
|
51
|
-
│ │ └────────────────┘
|
|
44
|
+
│ │ Web Worker │ │
|
|
45
|
+
│ │ ┌────────────────┐ │ │
|
|
46
|
+
│ │ │ Pyodide WASM │ │ │
|
|
47
|
+
│ │ │ ┌───────────┐ │ │ │
|
|
48
|
+
│ │ │ │ Python │ │ │ │
|
|
49
|
+
│ │ │ │ Runtime │ │ │ │
|
|
50
|
+
│ │ │ └───────────┘ │ │ │
|
|
51
|
+
│ │ └────────────────┘ │ │
|
|
52
52
|
│ └─────────────────────┘ │
|
|
53
53
|
└─────────────────────────────────────────────────────────┘
|
|
54
54
|
```
|
|
@@ -66,383 +66,12 @@
|
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
69
|
-
## Installation
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm install @winm2m/inferential-stats-js
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
> **Peer dependency (optional):** If you want explicit control over the Pyodide version, install `pyodide` (>= 0.26.0) as a peer dependency. Otherwise the SDK loads Pyodide from the jsDelivr CDN automatically.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Quick Start
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
import { InferentialStats, PROGRESS_EVENT_NAME } from '@winm2m/inferential-stats-js';
|
|
83
|
-
|
|
84
|
-
// 1. Listen for initialization progress
|
|
85
|
-
window.addEventListener(PROGRESS_EVENT_NAME, (e: Event) => {
|
|
86
|
-
const { stage, progress, message } = (e as CustomEvent).detail;
|
|
87
|
-
console.log(`[${stage}] ${progress}% — ${message}`);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// 2. Create an instance (pass the URL to the bundled worker)
|
|
91
|
-
const stats = new InferentialStats({
|
|
92
|
-
workerUrl: new URL('@winm2m/inferential-stats-js/worker', import.meta.url).href,
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// 3. Initialize (loads Pyodide + Python packages inside the worker)
|
|
96
|
-
await stats.init();
|
|
97
|
-
|
|
98
|
-
// 4. Prepare your data
|
|
99
|
-
const data = [
|
|
100
|
-
{ group: 'A', score: 85 },
|
|
101
|
-
{ group: 'A', score: 90 },
|
|
102
|
-
{ group: 'B', score: 78 },
|
|
103
|
-
{ group: 'B', score: 82 },
|
|
104
|
-
// ... more rows
|
|
105
|
-
];
|
|
106
|
-
|
|
107
|
-
// 5. Run an analysis
|
|
108
|
-
const result = await stats.anovaOneway({
|
|
109
|
-
data,
|
|
110
|
-
variable: 'score',
|
|
111
|
-
groupVariable: 'group',
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
console.log(result);
|
|
115
|
-
// {
|
|
116
|
-
// success: true,
|
|
117
|
-
// data: { fStatistic: ..., pValue: ..., groupStats: [...], ... },
|
|
118
|
-
// executionTimeMs: 42
|
|
119
|
-
// }
|
|
120
|
-
|
|
121
|
-
// 6. Clean up when done
|
|
122
|
-
stats.destroy();
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## CDN / CodePen Usage
|
|
128
|
-
|
|
129
|
-
You can use the SDK directly in a browser or CodePen with no build step. The snippet below loads the library from a CDN, fetches the sample dataset from GitHub Pages, and runs six analyses (one from each major category). Results are rendered as HTML tables.
|
|
130
|
-
|
|
131
|
-
```html
|
|
132
|
-
<!DOCTYPE html>
|
|
133
|
-
<html lang="en">
|
|
134
|
-
<head>
|
|
135
|
-
<meta charset="UTF-8" />
|
|
136
|
-
<title>inferential-stats-js CDN Demo</title>
|
|
137
|
-
</head>
|
|
138
|
-
<body>
|
|
139
|
-
<h1>inferential-stats-js — CDN Demo</h1>
|
|
140
|
-
<p id="status">Initializing...</p>
|
|
141
|
-
<div id="output"></div>
|
|
142
|
-
|
|
143
|
-
<style>
|
|
144
|
-
body { font-family: "IBM Plex Sans", "Segoe UI", sans-serif; margin: 24px; }
|
|
145
|
-
table { border-collapse: collapse; margin: 12px 0 24px; width: 100%; }
|
|
146
|
-
th, td { border: 1px solid #ddd; padding: 6px 10px; font-size: 14px; }
|
|
147
|
-
th { background: #f5f5f5; text-align: left; }
|
|
148
|
-
h2 { margin: 20px 0 8px; font-size: 18px; }
|
|
149
|
-
</style>
|
|
150
|
-
|
|
151
|
-
<!-- Load the worker script (global IIFE, no import needed) -->
|
|
152
|
-
<!-- The worker is loaded by URL below, not as a script tag -->
|
|
153
|
-
|
|
154
|
-
<script type="module">
|
|
155
|
-
// 1. Import the SDK from a CDN
|
|
156
|
-
import { InferentialStats, PROGRESS_EVENT_NAME } from 'https://unpkg.com/@winm2m/inferential-stats-js/dist/index.js';
|
|
157
|
-
|
|
158
|
-
const status = document.getElementById('status');
|
|
159
|
-
const output = document.getElementById('output');
|
|
160
|
-
|
|
161
|
-
const setStatus = (message) => {
|
|
162
|
-
if (status) {
|
|
163
|
-
status.textContent = message;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const renderTable = (title, headers, rows) => {
|
|
168
|
-
if (!output) return;
|
|
169
|
-
|
|
170
|
-
const section = document.createElement('section');
|
|
171
|
-
const heading = document.createElement('h2');
|
|
172
|
-
heading.textContent = title;
|
|
173
|
-
section.appendChild(heading);
|
|
174
|
-
|
|
175
|
-
const table = document.createElement('table');
|
|
176
|
-
const thead = document.createElement('thead');
|
|
177
|
-
const headerRow = document.createElement('tr');
|
|
178
|
-
headers.forEach((header) => {
|
|
179
|
-
const th = document.createElement('th');
|
|
180
|
-
th.textContent = header;
|
|
181
|
-
headerRow.appendChild(th);
|
|
182
|
-
});
|
|
183
|
-
thead.appendChild(headerRow);
|
|
184
|
-
table.appendChild(thead);
|
|
185
|
-
|
|
186
|
-
const tbody = document.createElement('tbody');
|
|
187
|
-
rows.forEach((cells) => {
|
|
188
|
-
const tr = document.createElement('tr');
|
|
189
|
-
cells.forEach((cell) => {
|
|
190
|
-
const td = document.createElement('td');
|
|
191
|
-
td.textContent = cell;
|
|
192
|
-
tr.appendChild(td);
|
|
193
|
-
});
|
|
194
|
-
tbody.appendChild(tr);
|
|
195
|
-
});
|
|
196
|
-
table.appendChild(tbody);
|
|
197
|
-
section.appendChild(table);
|
|
198
|
-
output.appendChild(section);
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const renderKeyValueTable = (title, rows) => {
|
|
202
|
-
renderTable(title, ['Metric', 'Value'], rows);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const formatNumber = (value, digits = 4) => Number(value).toFixed(digits);
|
|
206
|
-
|
|
207
|
-
// 2. Listen for progress events
|
|
208
|
-
window.addEventListener(PROGRESS_EVENT_NAME, (e) => {
|
|
209
|
-
const { stage, progress, message } = e.detail;
|
|
210
|
-
setStatus(`[${stage}] ${message} (${progress}%)`);
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// 3. Create an instance pointing to the CDN-hosted worker
|
|
214
|
-
const stats = new InferentialStats({
|
|
215
|
-
workerUrl: 'https://unpkg.com/@winm2m/inferential-stats-js/dist/stats-worker.js',
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
// 4. Initialize (downloads Pyodide WASM + Python packages)
|
|
220
|
-
await stats.init();
|
|
221
|
-
setStatus('Initialization complete. Running analyses...');
|
|
222
|
-
|
|
223
|
-
// 5. Fetch sample survey data from GitHub Pages
|
|
224
|
-
const response = await fetch(
|
|
225
|
-
'https://winm2m.github.io/inferential-stats-js/sample-survey-data.json'
|
|
226
|
-
);
|
|
227
|
-
const data = await response.json();
|
|
228
|
-
setStatus(`Loaded ${data.length} rows. Rendering tables...`);
|
|
229
|
-
|
|
230
|
-
// 6. Descriptive Statistics — Frequencies
|
|
231
|
-
const frequenciesResult = await stats.frequencies({
|
|
232
|
-
data,
|
|
233
|
-
variable: 'favorite_music',
|
|
234
|
-
});
|
|
235
|
-
const frequencyRows = frequenciesResult.data.frequencies
|
|
236
|
-
.slice(0, 6)
|
|
237
|
-
.map((item) => [
|
|
238
|
-
String(item.value),
|
|
239
|
-
String(item.count),
|
|
240
|
-
`${item.percentage.toFixed(2)}%`,
|
|
241
|
-
]);
|
|
242
|
-
renderTable(
|
|
243
|
-
'Descriptive Statistics — Frequencies (favorite_music, top 6)',
|
|
244
|
-
['Value', 'Count', 'Percent'],
|
|
245
|
-
frequencyRows
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
// 7. Compare Means — One-Way ANOVA
|
|
249
|
-
const anovaResult = await stats.anovaOneway({
|
|
250
|
-
data,
|
|
251
|
-
variable: 'music_satisfaction',
|
|
252
|
-
groupVariable: 'age_group',
|
|
253
|
-
});
|
|
254
|
-
renderKeyValueTable('Compare Means — One-Way ANOVA (music_satisfaction by age_group)', [
|
|
255
|
-
['F-statistic', anovaResult.data.fStatistic.toFixed(4)],
|
|
256
|
-
['p-value', anovaResult.data.pValue.toFixed(4)],
|
|
257
|
-
['eta-squared', anovaResult.data.etaSquared.toFixed(4)],
|
|
258
|
-
]);
|
|
259
|
-
|
|
260
|
-
// 8. Regression — OLS
|
|
261
|
-
const regressionResult = await stats.linearRegression({
|
|
262
|
-
data,
|
|
263
|
-
dependentVariable: 'music_satisfaction',
|
|
264
|
-
independentVariables: ['weekly_hours_music', 'weekly_hours_movie'],
|
|
265
|
-
});
|
|
266
|
-
renderKeyValueTable('Regression — OLS (music_satisfaction ~ weekly_hours_music + weekly_hours_movie)', [
|
|
267
|
-
['R-squared', regressionResult.data.rSquared.toFixed(4)],
|
|
268
|
-
['Adj. R-squared', regressionResult.data.adjustedRSquared.toFixed(4)],
|
|
269
|
-
['F-statistic', regressionResult.data.fStatistic.toFixed(4)],
|
|
270
|
-
['F p-value', regressionResult.data.fPValue.toFixed(4)],
|
|
271
|
-
['Durbin-Watson', regressionResult.data.durbinWatson.toFixed(4)],
|
|
272
|
-
]);
|
|
273
|
-
|
|
274
|
-
// 9. Classify — K-Means
|
|
275
|
-
const kmeansResult = await stats.kmeans({
|
|
276
|
-
data,
|
|
277
|
-
variables: ['weekly_hours_music', 'weekly_hours_movie', 'monthly_art_visits'],
|
|
278
|
-
k: 3,
|
|
279
|
-
randomState: 42,
|
|
280
|
-
maxIterations: 100,
|
|
281
|
-
});
|
|
282
|
-
const clusterRows = Object.entries(kmeansResult.data.clusterSizes).map(
|
|
283
|
-
([cluster, size]) => [`Cluster ${cluster}`, String(size)]
|
|
284
|
-
);
|
|
285
|
-
renderKeyValueTable('Classify — K-Means (k=3)', [
|
|
286
|
-
['Inertia', kmeansResult.data.inertia.toFixed(2)],
|
|
287
|
-
['Iterations', String(kmeansResult.data.iterations)],
|
|
288
|
-
...clusterRows,
|
|
289
|
-
]);
|
|
290
|
-
|
|
291
|
-
// 10. Dimension Reduction — PCA
|
|
292
|
-
const pcaResult = await stats.pca({
|
|
293
|
-
data,
|
|
294
|
-
variables: [
|
|
295
|
-
'music_satisfaction',
|
|
296
|
-
'movie_satisfaction',
|
|
297
|
-
'art_satisfaction',
|
|
298
|
-
'weekly_hours_music',
|
|
299
|
-
'weekly_hours_movie',
|
|
300
|
-
'monthly_art_visits',
|
|
301
|
-
],
|
|
302
|
-
nComponents: 3,
|
|
303
|
-
standardize: true,
|
|
304
|
-
});
|
|
305
|
-
const pcaRows = pcaResult.data.explainedVarianceRatio.map((value, index) => [
|
|
306
|
-
`PC${index + 1}`,
|
|
307
|
-
formatNumber(value),
|
|
308
|
-
]);
|
|
309
|
-
renderTable('Dimension Reduction — PCA (top 3 components)', ['Component', 'Explained Variance Ratio'], pcaRows);
|
|
310
|
-
|
|
311
|
-
const efaResult = await stats.efa({
|
|
312
|
-
data,
|
|
313
|
-
variables: [
|
|
314
|
-
'music_satisfaction',
|
|
315
|
-
'movie_satisfaction',
|
|
316
|
-
'art_satisfaction',
|
|
317
|
-
'weekly_hours_music',
|
|
318
|
-
'weekly_hours_movie',
|
|
319
|
-
'monthly_art_visits',
|
|
320
|
-
],
|
|
321
|
-
nFactors: 3,
|
|
322
|
-
rotation: 'varimax',
|
|
323
|
-
});
|
|
324
|
-
if (efaResult.success) {
|
|
325
|
-
const efaHeaders = ['Variable', 'Factor 1', 'Factor 2', 'Factor 3'];
|
|
326
|
-
const efaRows = Object.entries(efaResult.data.loadings).map(([variable, loadings]) => [
|
|
327
|
-
variable,
|
|
328
|
-
formatNumber(loadings[0]),
|
|
329
|
-
formatNumber(loadings[1]),
|
|
330
|
-
formatNumber(loadings[2]),
|
|
331
|
-
]);
|
|
332
|
-
renderTable('Dimension Reduction — EFA Loadings (varimax, 3 factors)', efaHeaders, efaRows);
|
|
333
|
-
} else {
|
|
334
|
-
renderKeyValueTable('Dimension Reduction — EFA Loadings (varimax, 3 factors)', [
|
|
335
|
-
['Error', efaResult.error ?? 'Unknown error'],
|
|
336
|
-
]);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// 11. Scale — Cronbach Alpha
|
|
340
|
-
const alphaResult = await stats.cronbachAlpha({
|
|
341
|
-
data,
|
|
342
|
-
items: ['music_satisfaction', 'movie_satisfaction', 'art_satisfaction'],
|
|
343
|
-
});
|
|
344
|
-
renderKeyValueTable('Scale — Cronbach Alpha (satisfaction items)', [
|
|
345
|
-
['Alpha', alphaResult.data.alpha.toFixed(4)],
|
|
346
|
-
['Standardized Alpha', alphaResult.data.standardizedAlpha.toFixed(4)],
|
|
347
|
-
['Inter-item correlation mean', alphaResult.data.interItemCorrelationMean.toFixed(4)],
|
|
348
|
-
['Items', String(alphaResult.data.nItems)],
|
|
349
|
-
['Observations', String(alphaResult.data.nObservations)],
|
|
350
|
-
]);
|
|
351
|
-
|
|
352
|
-
setStatus('All analyses completed.');
|
|
353
|
-
|
|
354
|
-
} catch (err) {
|
|
355
|
-
setStatus('Error: ' + err.message);
|
|
356
|
-
} finally {
|
|
357
|
-
stats.destroy();
|
|
358
|
-
}
|
|
359
|
-
</script>
|
|
360
|
-
</body>
|
|
361
|
-
</html>
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
> **Tip:** Paste the JavaScript portion into the **JS panel** of CodePen (with the "JavaScript preprocessor" set to **None** or **Babel**) and the HTML into the **HTML panel**. The demo runs entirely in the browser.
|
|
365
|
-
>
|
|
366
|
-
> **Live Demo:** Try it out on CodePen: https://codepen.io/editor/YoungjuneKwon/pen/019d3c97-35c0-743c-ad43-78e02225b008
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## API Reference
|
|
371
|
-
|
|
372
|
-
All analysis methods are async and return `Promise<AnalysisResult<T>>`:
|
|
373
|
-
|
|
374
|
-
```typescript
|
|
375
|
-
interface AnalysisResult<T> {
|
|
376
|
-
success: boolean;
|
|
377
|
-
data: T;
|
|
378
|
-
error?: string;
|
|
379
|
-
executionTimeMs: number;
|
|
380
|
-
}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### Lifecycle Methods
|
|
384
|
-
|
|
385
|
-
| Method | Description |
|
|
386
|
-
|---|---|
|
|
387
|
-
| `new InferentialStats(config)` | Create an instance. `config.workerUrl` is required. Optional: `config.pyodideUrl`, `config.eventTarget`. |
|
|
388
|
-
| `init(): Promise<void>` | Load Pyodide and install Python packages inside the Web Worker. |
|
|
389
|
-
| `isInitialized(): boolean` | Returns `true` if the worker is ready. |
|
|
390
|
-
| `destroy(): void` | Terminate the Web Worker and release resources. |
|
|
391
|
-
|
|
392
|
-
### Analysis Methods (16 total)
|
|
393
|
-
|
|
394
|
-
#### Descriptive Statistics
|
|
395
|
-
|
|
396
|
-
| # | Method | Input → Output | Description |
|
|
397
|
-
|---|---|---|---|
|
|
398
|
-
| 1 | `frequencies(input)` | `FrequenciesInput` → `FrequenciesOutput` | Frequency distribution and relative percentages for a categorical variable. |
|
|
399
|
-
| 2 | `descriptives(input)` | `DescriptivesInput` → `DescriptivesOutput` | Summary statistics (mean, std, min, max, quartiles, skewness, kurtosis) for numeric variables. |
|
|
400
|
-
| 3 | `crosstabs(input)` | `CrosstabsInput` → `CrosstabsOutput` | Cross-tabulation with observed/expected counts, Chi-square test, and Cramér's V. |
|
|
401
|
-
|
|
402
|
-
#### Compare Means
|
|
403
|
-
|
|
404
|
-
| # | Method | Input → Output | Description |
|
|
405
|
-
|---|---|---|---|
|
|
406
|
-
| 4 | `ttestIndependent(input)` | `TTestIndependentInput` → `TTestIndependentOutput` | Independent-samples t-test with Levene's equality-of-variances test. |
|
|
407
|
-
| 5 | `ttestPaired(input)` | `TTestPairedInput` → `TTestPairedOutput` | Paired-samples t-test for dependent observations. |
|
|
408
|
-
| 6 | `anovaOneway(input)` | `AnovaInput` → `AnovaOutput` | One-way ANOVA with group descriptives and eta-squared effect size. |
|
|
409
|
-
| 7 | `posthocTukey(input)` | `PostHocInput` → `PostHocOutput` | Post-hoc Tukey HSD pairwise comparisons following ANOVA. |
|
|
410
|
-
|
|
411
|
-
#### Regression
|
|
412
|
-
|
|
413
|
-
| # | Method | Input → Output | Description |
|
|
414
|
-
|---|---|---|---|
|
|
415
|
-
| 8 | `linearRegression(input)` | `LinearRegressionInput` → `LinearRegressionOutput` | OLS linear regression with coefficients, R², F-test, and Durbin-Watson statistic. |
|
|
416
|
-
| 9 | `logisticBinary(input)` | `LogisticBinaryInput` → `LogisticBinaryOutput` | Binary logistic regression with odds ratios, pseudo-R², and model fit statistics. |
|
|
417
|
-
| 10 | `logisticMultinomial(input)` | `MultinomialLogisticInput` → `MultinomialLogisticOutput` | Multinomial logistic regression with per-category coefficients and odds ratios. |
|
|
418
|
-
|
|
419
|
-
#### Classify
|
|
420
|
-
|
|
421
|
-
| # | Method | Input → Output | Description |
|
|
422
|
-
|---|---|---|---|
|
|
423
|
-
| 11 | `kmeans(input)` | `KMeansInput` → `KMeansOutput` | K-Means clustering with cluster centers, labels, and inertia. |
|
|
424
|
-
| 12 | `hierarchicalCluster(input)` | `HierarchicalClusterInput` → `HierarchicalClusterOutput` | Agglomerative hierarchical clustering with linkage matrix and dendrogram data. |
|
|
425
|
-
|
|
426
|
-
#### Dimension Reduction
|
|
427
|
-
|
|
428
|
-
| # | Method | Input → Output | Description |
|
|
429
|
-
|---|---|---|---|
|
|
430
|
-
| 13 | `efa(input)` | `EFAInput` → `EFAOutput` | Exploratory Factor Analysis with rotation, KMO, and Bartlett's test. |
|
|
431
|
-
| 14 | `pca(input)` | `PCAInput` → `PCAOutput` | Principal Component Analysis with loadings and explained variance. |
|
|
432
|
-
| 15 | `mds(input)` | `MDSInput` → `MDSOutput` | Multidimensional Scaling with stress value and coordinate output. |
|
|
433
|
-
|
|
434
|
-
#### Scale
|
|
435
|
-
|
|
436
|
-
| # | Method | Input → Output | Description |
|
|
437
|
-
|---|---|---|---|
|
|
438
|
-
| 16 | `cronbachAlpha(input)` | `CronbachAlphaInput` → `CronbachAlphaOutput` | Reliability analysis with Cronbach's alpha, item-total correlations, and alpha-if-deleted. |
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
69
|
## Core Analysis Features — Mathematical & Technical Documentation
|
|
443
70
|
|
|
444
71
|
This section documents the mathematical foundations and internal Python implementations of all 16 analyses.
|
|
445
72
|
|
|
73
|
+
> **Note on math rendering:** Equations are rendered as images via `latex.codecogs.com` so they display correctly on npm.
|
|
74
|
+
|
|
446
75
|
---
|
|
447
76
|
|
|
448
77
|
### ① Descriptive Statistics
|
|
@@ -455,7 +84,7 @@ Computes a frequency distribution for a categorical variable, including absolute
|
|
|
455
84
|
|
|
456
85
|
**Relative frequency:**
|
|
457
86
|
|
|
458
|
-
|
|
87
|
+

|
|
459
88
|
|
|
460
89
|
where $n_i$ is the count of category $i$ and $N$ is the total number of observations. Cumulative percentage is the running sum of $f_i \times 100$.
|
|
461
90
|
|
|
@@ -469,19 +98,19 @@ Produces summary statistics for one or more numeric variables: count, mean, stan
|
|
|
469
98
|
|
|
470
99
|
**Arithmetic mean:**
|
|
471
100
|
|
|
472
|
-
|
|
101
|
+

|
|
473
102
|
|
|
474
103
|
**Sample standard deviation (Bessel-corrected):**
|
|
475
104
|
|
|
476
|
-
|
|
105
|
+
^2})
|
|
477
106
|
|
|
478
107
|
**Skewness (Fisher):**
|
|
479
108
|
|
|
480
|
-
|
|
109
|
+
^k)
|
|
481
110
|
|
|
482
111
|
**Excess kurtosis (Fisher):**
|
|
483
112
|
|
|
484
|
-
|
|
113
|
+

|
|
485
114
|
|
|
486
115
|
---
|
|
487
116
|
|
|
@@ -493,13 +122,13 @@ Cross-tabulates two categorical variables and tests for independence using Pears
|
|
|
493
122
|
|
|
494
123
|
**Pearson's Chi-square statistic:**
|
|
495
124
|
|
|
496
|
-
|
|
125
|
+
^2}{E_{ij}})
|
|
497
126
|
|
|
498
127
|
where $O_{ij}$ is the observed frequency in cell $(i, j)$ and $E_{ij} = \frac{R_i \cdot C_j}{N}$ is the expected frequency under independence.
|
|
499
128
|
|
|
500
129
|
**Cramér's V:**
|
|
501
130
|
|
|
502
|
-
|
|
131
|
+
}})
|
|
503
132
|
|
|
504
133
|
where $k = \min(\text{rows}, \text{cols})$.
|
|
505
134
|
|
|
@@ -515,11 +144,11 @@ Compares the means of a numeric variable between two independent groups. Automat
|
|
|
515
144
|
|
|
516
145
|
**T-statistic (equal variance assumed):**
|
|
517
146
|
|
|
518
|
-
|
|
147
|
+

|
|
519
148
|
|
|
520
149
|
**Pooled standard deviation:**
|
|
521
150
|
|
|
522
|
-
|
|
151
|
+
s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}})
|
|
523
152
|
|
|
524
153
|
**Degrees of freedom:** $df = n_1 + n_2 - 2$
|
|
525
154
|
|
|
@@ -535,7 +164,7 @@ Tests whether the mean difference between two paired measurements is significant
|
|
|
535
164
|
|
|
536
165
|
**T-statistic:**
|
|
537
166
|
|
|
538
|
-
|
|
167
|
+

|
|
539
168
|
|
|
540
169
|
where $\bar{D} = \frac{1}{n}\sum_{i=1}^{n}(X_{1i} - X_{2i})$ is the mean difference and $S_D$ is the standard deviation of the differences.
|
|
541
170
|
|
|
@@ -551,23 +180,23 @@ Tests whether the means of a numeric variable differ significantly across three
|
|
|
551
180
|
|
|
552
181
|
**F-statistic:**
|
|
553
182
|
|
|
554
|
-
|
|
183
|
+

|
|
555
184
|
|
|
556
185
|
**Sum of Squares Between Groups:**
|
|
557
186
|
|
|
558
|
-
|
|
187
|
+
^2)
|
|
559
188
|
|
|
560
189
|
**Sum of Squares Within Groups:**
|
|
561
190
|
|
|
562
|
-
|
|
191
|
+
^2)
|
|
563
192
|
|
|
564
193
|
**Mean Squares:**
|
|
565
194
|
|
|
566
|
-
|
|
195
|
+

|
|
567
196
|
|
|
568
197
|
**Effect size (Eta-squared):**
|
|
569
198
|
|
|
570
|
-
|
|
199
|
+

|
|
571
200
|
|
|
572
201
|
---
|
|
573
202
|
|
|
@@ -579,7 +208,7 @@ Performs pairwise comparisons of group means following a significant ANOVA resul
|
|
|
579
208
|
|
|
580
209
|
**Studentized range statistic:**
|
|
581
210
|
|
|
582
|
-
|
|
211
|
+

|
|
583
212
|
|
|
584
213
|
where $MS_W$ is the within-group mean square from the ANOVA and $n$ is the harmonic mean of group sizes. The critical $q$ value is obtained from the Studentized Range distribution with $k$ groups and $N - k$ degrees of freedom.
|
|
585
214
|
|
|
@@ -595,17 +224,17 @@ Fits an Ordinary Least Squares regression model with one or more independent var
|
|
|
595
224
|
|
|
596
225
|
**Model:**
|
|
597
226
|
|
|
598
|
-
|
|
227
|
+

|
|
599
228
|
|
|
600
229
|
where $\epsilon \sim N(0, \sigma^2)$.
|
|
601
230
|
|
|
602
231
|
**OLS estimator:**
|
|
603
232
|
|
|
604
|
-
|
|
233
|
+
^{-1}X^TY)
|
|
605
234
|
|
|
606
235
|
**Coefficient of determination:**
|
|
607
236
|
|
|
608
|
-
|
|
237
|
+

|
|
609
238
|
|
|
610
239
|
where $SS_{res} = \sum(Y_i - \hat{Y}_i)^2$ and $SS_{tot} = \sum(Y_i - \bar{Y})^2$.
|
|
611
240
|
|
|
@@ -619,11 +248,11 @@ Models the probability of a binary outcome as a function of one or more independ
|
|
|
619
248
|
|
|
620
249
|
**Logit link function:**
|
|
621
250
|
|
|
622
|
-
|
|
251
|
+
=\beta_0+\beta_1X_1+\cdots+\beta_pX_p)
|
|
623
252
|
|
|
624
253
|
**Predicted probability:**
|
|
625
254
|
|
|
626
|
-
|
|
255
|
+
=\frac{1}{1+e^{-(\beta_0+\beta_1X_1+\cdots+\beta_pX_p)}})
|
|
627
256
|
|
|
628
257
|
Coefficients are estimated by Maximum Likelihood Estimation (MLE). The odds ratio for predictor $j$ is $e^{\beta_j}$.
|
|
629
258
|
|
|
@@ -637,13 +266,13 @@ Extends binary logistic regression to outcomes with more than two unordered cate
|
|
|
637
266
|
|
|
638
267
|
**Log-odds relative to reference category $K$:**
|
|
639
268
|
|
|
640
|
-
|
|
269
|
+
}{P(Y=K)}\right)=\beta_{k0}+\beta_{k1}X_1+\cdots+\beta_{kp}X_p)
|
|
641
270
|
|
|
642
271
|
for each category $k \neq K$.
|
|
643
272
|
|
|
644
273
|
**Predicted probability via softmax:**
|
|
645
274
|
|
|
646
|
-
|
|
275
|
+
=\frac{e^{\beta_{k0}+\beta_{k1}X_1+\cdots+\beta_{kp}X_p}}{\sum_{j=1}^{K}e^{\beta_{j0}+\beta_{j1}X_1+\cdots+\beta_{jp}X_p}})
|
|
647
276
|
|
|
648
277
|
---
|
|
649
278
|
|
|
@@ -657,7 +286,7 @@ Partitions observations into $K$ clusters by iteratively assigning points to the
|
|
|
657
286
|
|
|
658
287
|
**Objective function (inertia):**
|
|
659
288
|
|
|
660
|
-
|
|
289
|
+

|
|
661
290
|
|
|
662
291
|
where $C_j$ is the set of observations in cluster $j$ and $\mu_j$ is the centroid. The algorithm minimizes $J$ using Lloyd's algorithm (Expectation-Maximization style).
|
|
663
292
|
|
|
@@ -671,7 +300,7 @@ Builds a hierarchy of clusters using a bottom-up approach. Supports Ward, comple
|
|
|
671
300
|
|
|
672
301
|
**Ward's minimum variance method** (default):
|
|
673
302
|
|
|
674
|
-
|
|
303
|
+
=\frac{n_A n_B}{n_A+n_B}\|\bar{x}_A-\bar{x}_B\|^2)
|
|
675
304
|
|
|
676
305
|
At each step, the pair of clusters $(A, B)$ that produces the smallest increase in total within-cluster variance is merged. Ward's method tends to produce compact, equally sized clusters.
|
|
677
306
|
|
|
@@ -687,13 +316,13 @@ Discovers latent factors underlying a set of observed variables. Supports varima
|
|
|
687
316
|
|
|
688
317
|
**Factor model:**
|
|
689
318
|
|
|
690
|
-
|
|
319
|
+

|
|
691
320
|
|
|
692
321
|
where $X$ is the observed variable vector, $\Lambda$ is the matrix of factor loadings, $F$ is the vector of latent factors, and $\epsilon$ is the unique variance.
|
|
693
322
|
|
|
694
323
|
**Kaiser-Meyer-Olkin (KMO) measure:**
|
|
695
324
|
|
|
696
|
-
|
|
325
|
+

|
|
697
326
|
|
|
698
327
|
where $r_{ij}$ are elements of the correlation matrix and $u_{ij}$ are elements of the partial correlation matrix. KMO values above 0.6 are generally considered acceptable for factor analysis.
|
|
699
328
|
|
|
@@ -707,13 +336,13 @@ Finds orthogonal components that maximize variance in the data. Reports componen
|
|
|
707
336
|
|
|
708
337
|
**Objective:** Find the weight vector $w$ that maximizes projected variance:
|
|
709
338
|
|
|
710
|
-
|
|
339
|
+
\to\max\quad\text{subject to}\quad\|w\|=1)
|
|
711
340
|
|
|
712
341
|
This is equivalent to finding the eigenvectors of the covariance matrix $\Sigma = \frac{1}{N-1}X^TX$. The eigenvalues $\lambda_1 \geq \lambda_2 \geq \cdots$ represent the variance explained by each component.
|
|
713
342
|
|
|
714
343
|
**Explained variance ratio:**
|
|
715
344
|
|
|
716
|
-
|
|
345
|
+

|
|
717
346
|
|
|
718
347
|
---
|
|
719
348
|
|
|
@@ -725,7 +354,7 @@ Projects high-dimensional data into a lower-dimensional space (typically 2D) whi
|
|
|
725
354
|
|
|
726
355
|
**Stress function (Kruskal's Stress-1):**
|
|
727
356
|
|
|
728
|
-
|
|
357
|
+
^2}{\sum_{i<j}d_{ij}^2}})
|
|
729
358
|
|
|
730
359
|
where $d_{ij}$ is the distance in the reduced space and $\delta_{ij}$ is the original distance (or a monotonic transformation for non-metric MDS). A stress value below 0.1 is generally considered a good fit.
|
|
731
360
|
|
|
@@ -741,13 +370,13 @@ Measures the internal consistency (reliability) of a set of scale items. Reports
|
|
|
741
370
|
|
|
742
371
|
**Cronbach's alpha (raw):**
|
|
743
372
|
|
|
744
|
-
|
|
373
|
+
)
|
|
745
374
|
|
|
746
375
|
where $K$ is the number of items, $\sigma_{Y_i}^2$ is the variance of item $i$, and $\sigma_X^2$ is the variance of the total score.
|
|
747
376
|
|
|
748
377
|
**Standardized alpha (based on mean inter-item correlation):**
|
|
749
378
|
|
|
750
|
-
|
|
379
|
+
\bar{r}})
|
|
751
380
|
|
|
752
381
|
where $\bar{r}$ is the mean of all pairwise Pearson correlations among items.
|
|
753
382
|
|
|
@@ -761,6 +390,145 @@ where $\bar{r}$ is the mean of all pairwise Pearson correlations among items.
|
|
|
761
390
|
|
|
762
391
|
---
|
|
763
392
|
|
|
393
|
+
## Installation
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
npm install @winm2m/inferential-stats-js
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
> **Peer dependency (optional):** If you want explicit control over the Pyodide version, install `pyodide` (>= 0.26.0) as a peer dependency. Otherwise the SDK loads Pyodide from the jsDelivr CDN automatically.
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## Quick Start
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
import { InferentialStats, PROGRESS_EVENT_NAME } from '@winm2m/inferential-stats-js';
|
|
407
|
+
|
|
408
|
+
// 1. Listen for initialization progress
|
|
409
|
+
window.addEventListener(PROGRESS_EVENT_NAME, (e: Event) => {
|
|
410
|
+
const { stage, progress, message } = (e as CustomEvent).detail;
|
|
411
|
+
console.log(`[${stage}] ${progress}% — ${message}`);
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
// 2. Create an instance (pass the URL to the bundled worker)
|
|
415
|
+
const stats = new InferentialStats({
|
|
416
|
+
workerUrl: new URL('@winm2m/inferential-stats-js/worker', import.meta.url).href,
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// 3. Initialize (loads Pyodide + Python packages inside the worker)
|
|
420
|
+
await stats.init();
|
|
421
|
+
|
|
422
|
+
// 4. Prepare your data
|
|
423
|
+
const data = [
|
|
424
|
+
{ group: 'A', score: 85 },
|
|
425
|
+
{ group: 'A', score: 90 },
|
|
426
|
+
{ group: 'B', score: 78 },
|
|
427
|
+
{ group: 'B', score: 82 },
|
|
428
|
+
// ... more rows
|
|
429
|
+
];
|
|
430
|
+
|
|
431
|
+
// 5. Run an analysis
|
|
432
|
+
const result = await stats.anovaOneway({
|
|
433
|
+
data,
|
|
434
|
+
variable: 'score',
|
|
435
|
+
groupVariable: 'group',
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
console.log(result);
|
|
439
|
+
// {
|
|
440
|
+
// success: true,
|
|
441
|
+
// data: { fStatistic: ..., pValue: ..., groupStats: [...], ... },
|
|
442
|
+
// executionTimeMs: 42
|
|
443
|
+
// }
|
|
444
|
+
|
|
445
|
+
// 6. Clean up when done
|
|
446
|
+
stats.destroy();
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## CDN / CodePen Usage
|
|
452
|
+
|
|
453
|
+
You can use the SDK directly in a browser or CodePen with no build step. The full demo code is identical to the local page below (except for CDN import paths).
|
|
454
|
+
|
|
455
|
+
- **Local demo source:** `src/dev/demo.html`
|
|
456
|
+
- **CodePen live demo:** https://codepen.io/editor/YoungjuneKwon/pen/019d3c97-35c0-743c-ad43-78e02225b008
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## API Reference
|
|
461
|
+
|
|
462
|
+
All analysis methods are async and return `Promise<AnalysisResult<T>>`:
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
interface AnalysisResult<T> {
|
|
466
|
+
success: boolean;
|
|
467
|
+
data: T;
|
|
468
|
+
error?: string;
|
|
469
|
+
executionTimeMs: number;
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Lifecycle Methods
|
|
474
|
+
|
|
475
|
+
| Method | Description |
|
|
476
|
+
|---|---|
|
|
477
|
+
| `new InferentialStats(config)` | Create an instance. `config.workerUrl` is required. Optional: `config.pyodideUrl`, `config.eventTarget`. |
|
|
478
|
+
| `init(): Promise<void>` | Load Pyodide and install Python packages inside the Web Worker. |
|
|
479
|
+
| `isInitialized(): boolean` | Returns `true` if the worker is ready. |
|
|
480
|
+
| `destroy(): void` | Terminate the Web Worker and release resources. |
|
|
481
|
+
|
|
482
|
+
### Analysis Methods (16 total)
|
|
483
|
+
|
|
484
|
+
#### Descriptive Statistics
|
|
485
|
+
|
|
486
|
+
| # | Method | Input → Output | Description |
|
|
487
|
+
|---|---|---|---|
|
|
488
|
+
| 1 | `frequencies(input)` | `FrequenciesInput` → `FrequenciesOutput` | Frequency distribution and relative percentages for a categorical variable. |
|
|
489
|
+
| 2 | `descriptives(input)` | `DescriptivesInput` → `DescriptivesOutput` | Summary statistics (mean, std, min, max, quartiles, skewness, kurtosis) for numeric variables. |
|
|
490
|
+
| 3 | `crosstabs(input)` | `CrosstabsInput` → `CrosstabsOutput` | Cross-tabulation with observed/expected counts, Chi-square test, and Cramér's V. |
|
|
491
|
+
|
|
492
|
+
#### Compare Means
|
|
493
|
+
|
|
494
|
+
| # | Method | Input → Output | Description |
|
|
495
|
+
|---|---|---|---|
|
|
496
|
+
| 4 | `ttestIndependent(input)` | `TTestIndependentInput` → `TTestIndependentOutput` | Independent-samples t-test with Levene's equality-of-variances test. |
|
|
497
|
+
| 5 | `ttestPaired(input)` | `TTestPairedInput` → `TTestPairedOutput` | Paired-samples t-test for dependent observations. |
|
|
498
|
+
| 6 | `anovaOneway(input)` | `AnovaInput` → `AnovaOutput` | One-way ANOVA with group descriptives and eta-squared effect size. |
|
|
499
|
+
| 7 | `posthocTukey(input)` | `PostHocInput` → `PostHocOutput` | Post-hoc Tukey HSD pairwise comparisons following ANOVA. |
|
|
500
|
+
|
|
501
|
+
#### Regression
|
|
502
|
+
|
|
503
|
+
| # | Method | Input → Output | Description |
|
|
504
|
+
|---|---|---|---|
|
|
505
|
+
| 8 | `linearRegression(input)` | `LinearRegressionInput` → `LinearRegressionOutput` | OLS linear regression with coefficients, R², F-test, and Durbin-Watson statistic. |
|
|
506
|
+
| 9 | `logisticBinary(input)` | `LogisticBinaryInput` → `LogisticBinaryOutput` | Binary logistic regression with odds ratios, pseudo-R², and model fit statistics. |
|
|
507
|
+
| 10 | `logisticMultinomial(input)` | `MultinomialLogisticInput` → `MultinomialLogisticOutput` | Multinomial logistic regression with per-category coefficients and odds ratios. |
|
|
508
|
+
|
|
509
|
+
#### Classify
|
|
510
|
+
|
|
511
|
+
| # | Method | Input → Output | Description |
|
|
512
|
+
|---|---|---|---|
|
|
513
|
+
| 11 | `kmeans(input)` | `KMeansInput` → `KMeansOutput` | K-Means clustering with cluster centers, labels, and inertia. |
|
|
514
|
+
| 12 | `hierarchicalCluster(input)` | `HierarchicalClusterInput` → `HierarchicalClusterOutput` | Agglomerative hierarchical clustering with linkage matrix and dendrogram data. |
|
|
515
|
+
|
|
516
|
+
#### Dimension Reduction
|
|
517
|
+
|
|
518
|
+
| # | Method | Input → Output | Description |
|
|
519
|
+
|---|---|---|---|
|
|
520
|
+
| 13 | `efa(input)` | `EFAInput` → `EFAOutput` | Exploratory Factor Analysis with rotation, KMO, and Bartlett's test. |
|
|
521
|
+
| 14 | `pca(input)` | `PCAInput` → `PCAOutput` | Principal Component Analysis with loadings and explained variance. |
|
|
522
|
+
| 15 | `mds(input)` | `MDSInput` → `MDSOutput` | Multidimensional Scaling with stress value and coordinate output. |
|
|
523
|
+
|
|
524
|
+
#### Scale
|
|
525
|
+
|
|
526
|
+
| # | Method | Input → Output | Description |
|
|
527
|
+
|---|---|---|---|
|
|
528
|
+
| 16 | `cronbachAlpha(input)` | `CronbachAlphaInput` → `CronbachAlphaOutput` | Reliability analysis with Cronbach's alpha, item-total correlations, and alpha-if-deleted. |
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
764
532
|
## Sample Data
|
|
765
533
|
|
|
766
534
|
The repository includes a ready-to-use sample dataset at `docs/sample-survey-data.json`, also hosted on GitHub Pages at:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Python code for dimension reduction functions.
|
|
3
3
|
*/
|
|
4
|
-
export declare const EFA_PY = "\nimport json\nimport pandas as pd\nimport numpy as np\nimport scipy as sp\nfrom factor_analyzer import FactorAnalyzer\nfrom factor_analyzer.factor_analyzer import calculate_bartlett_sphericity, calculate_kmo\n\ndef run_efa(data_json, variables_json, n_factors, rotation='varimax', method='minres'):\n if not hasattr(sp, 'sum'):\n sp.sum = np.sum\n df = pd.DataFrame(json.loads(data_json))\n variables = json.loads(variables_json)\n \n X = df[variables].apply(pd.to_numeric, errors='coerce').dropna()\n \n # KMO and Bartlett tests\n
|
|
4
|
+
export declare const EFA_PY = "\nimport json\nimport pandas as pd\nimport numpy as np\nimport scipy as sp\nfrom factor_analyzer import FactorAnalyzer\nfrom factor_analyzer.factor_analyzer import calculate_bartlett_sphericity, calculate_kmo\n\ndef run_efa(data_json, variables_json, n_factors, rotation='varimax', method='minres'):\n if not hasattr(sp, 'sum'):\n sp.sum = np.sum\n df = pd.DataFrame(json.loads(data_json))\n variables = json.loads(variables_json)\n \n X = df[variables].apply(pd.to_numeric, errors='coerce').dropna()\n \n # KMO and Bartlett tests\n kmo_result = calculate_kmo(X)\n if isinstance(kmo_result, tuple):\n kmo_all = kmo_result[0]\n kmo_model = kmo_result[1] if len(kmo_result) > 1 else kmo_result[0]\n else:\n kmo_all = kmo_result\n kmo_model = kmo_result\n chi2, p_value = calculate_bartlett_sphericity(X)\n \n fa = FactorAnalyzer(n_factors=n_factors, rotation=rotation, method=method)\n fa.fit(X)\n \n loadings = fa.loadings_\n loadings_dict = {}\n for i, var in enumerate(variables):\n loadings_dict[var] = [round(float(x), 6) for x in loadings[i]]\n \n variance_result = fa.get_factor_variance()\n if isinstance(variance_result, tuple):\n ev = variance_result[0]\n v = variance_result[1] if len(variance_result) > 1 else variance_result[0]\n cumulative = variance_result[2] if len(variance_result) > 2 else None\n else:\n ev = variance_result\n v = variance_result\n cumulative = None\n \n communalities = fa.get_communalities()\n uniquenesses = fa.get_uniquenesses()\n \n comm_dict = {}\n uniq_dict = {}\n for i, var in enumerate(variables):\n comm_dict[var] = round(float(communalities[i]), 6)\n uniq_dict[var] = round(float(uniquenesses[i]), 6)\n \n eigenvalues = fa.get_eigenvalues()[0]\n \n return json.dumps({\n 'loadings': loadings_dict,\n 'eigenvalues': [round(float(x), 6) for x in eigenvalues],\n 'variance': [round(float(x), 6) for x in ev],\n 'cumulativeVariance': [round(float(x), 6) for x in cumulative] if cumulative is not None else [round(float(sum(v[:i+1])), 6) for i in range(len(v))],\n 'communalities': comm_dict,\n 'uniquenesses': uniq_dict,\n 'nFactors': n_factors,\n 'rotation': rotation,\n 'kmo': round(float(kmo_model), 6),\n 'bartlettChi2': round(float(chi2), 6),\n 'bartlettPValue': float(p_value)\n })\n";
|
|
5
5
|
export declare const PCA_PY = "\nimport json\nimport pandas as pd\nimport numpy as np\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import StandardScaler\n\ndef run_pca(data_json, variables_json, n_components=None, standardize=True):\n df = pd.DataFrame(json.loads(data_json))\n variables = json.loads(variables_json)\n \n X = df[variables].apply(pd.to_numeric, errors='coerce').dropna()\n \n if standardize:\n scaler = StandardScaler()\n X_scaled = scaler.fit_transform(X)\n else:\n X_scaled = X.values\n \n if n_components is None:\n n_components = min(len(variables), len(X_scaled))\n \n pca = PCA(n_components=n_components)\n transformed = pca.fit_transform(X_scaled)\n \n loadings = {}\n for i, var in enumerate(variables):\n loadings[var] = [round(float(x), 6) for x in pca.components_[:, i]]\n \n cum_var = np.cumsum(pca.explained_variance_ratio_)\n \n return json.dumps({\n 'components': [[round(float(x), 6) for x in row] for row in transformed.tolist()],\n 'explainedVariance': [round(float(x), 6) for x in pca.explained_variance_],\n 'explainedVarianceRatio': [round(float(x), 6) for x in pca.explained_variance_ratio_],\n 'cumulativeVarianceRatio': [round(float(x), 6) for x in cum_var],\n 'loadings': loadings,\n 'singularValues': [round(float(x), 6) for x in pca.singular_values_],\n 'nComponents': n_components\n })\n";
|
|
6
6
|
export declare const MDS_PY = "\nimport json\nimport pandas as pd\nimport numpy as np\nfrom sklearn.manifold import MDS\nfrom sklearn.preprocessing import StandardScaler\n\ndef run_mds(data_json, variables_json, n_components=2, metric=True, max_iterations=300, random_state=42):\n df = pd.DataFrame(json.loads(data_json))\n variables = json.loads(variables_json)\n \n X = df[variables].apply(pd.to_numeric, errors='coerce').dropna()\n \n scaler = StandardScaler()\n X_scaled = scaler.fit_transform(X)\n \n mds = MDS(n_components=n_components, metric=metric, max_iter=max_iterations, random_state=random_state, normalized_stress='auto')\n coords = mds.fit_transform(X_scaled)\n \n return json.dumps({\n 'coordinates': [[round(float(x), 6) for x in row] for row in coords.tolist()],\n 'stress': round(float(mds.stress_), 6),\n 'nComponents': n_components\n })\n";
|
package/dist/stats-worker.js
CHANGED
|
@@ -598,7 +598,13 @@ def run_efa(data_json, variables_json, n_factors, rotation='varimax', method='mi
|
|
|
598
598
|
X = df[variables].apply(pd.to_numeric, errors='coerce').dropna()
|
|
599
599
|
|
|
600
600
|
# KMO and Bartlett tests
|
|
601
|
-
|
|
601
|
+
kmo_result = calculate_kmo(X)
|
|
602
|
+
if isinstance(kmo_result, tuple):
|
|
603
|
+
kmo_all = kmo_result[0]
|
|
604
|
+
kmo_model = kmo_result[1] if len(kmo_result) > 1 else kmo_result[0]
|
|
605
|
+
else:
|
|
606
|
+
kmo_all = kmo_result
|
|
607
|
+
kmo_model = kmo_result
|
|
602
608
|
chi2, p_value = calculate_bartlett_sphericity(X)
|
|
603
609
|
|
|
604
610
|
fa = FactorAnalyzer(n_factors=n_factors, rotation=rotation, method=method)
|
|
@@ -609,7 +615,15 @@ def run_efa(data_json, variables_json, n_factors, rotation='varimax', method='mi
|
|
|
609
615
|
for i, var in enumerate(variables):
|
|
610
616
|
loadings_dict[var] = [round(float(x), 6) for x in loadings[i]]
|
|
611
617
|
|
|
612
|
-
|
|
618
|
+
variance_result = fa.get_factor_variance()
|
|
619
|
+
if isinstance(variance_result, tuple):
|
|
620
|
+
ev = variance_result[0]
|
|
621
|
+
v = variance_result[1] if len(variance_result) > 1 else variance_result[0]
|
|
622
|
+
cumulative = variance_result[2] if len(variance_result) > 2 else None
|
|
623
|
+
else:
|
|
624
|
+
ev = variance_result
|
|
625
|
+
v = variance_result
|
|
626
|
+
cumulative = None
|
|
613
627
|
|
|
614
628
|
communalities = fa.get_communalities()
|
|
615
629
|
uniquenesses = fa.get_uniquenesses()
|
|
@@ -626,7 +640,7 @@ def run_efa(data_json, variables_json, n_factors, rotation='varimax', method='mi
|
|
|
626
640
|
'loadings': loadings_dict,
|
|
627
641
|
'eigenvalues': [round(float(x), 6) for x in eigenvalues],
|
|
628
642
|
'variance': [round(float(x), 6) for x in ev],
|
|
629
|
-
'cumulativeVariance': [round(float(sum(v[:i+1])), 6) for i in range(len(v))],
|
|
643
|
+
'cumulativeVariance': [round(float(x), 6) for x in cumulative] if cumulative is not None else [round(float(sum(v[:i+1])), 6) for i in range(len(v))],
|
|
630
644
|
'communalities': comm_dict,
|
|
631
645
|
'uniquenesses': uniq_dict,
|
|
632
646
|
'nFactors': n_factors,
|
package/dist/stats-worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-worker.js","sources":["../src/python/descriptive.ts","../src/python/compare-means.ts","../src/python/regression.ts","../src/python/classify.ts","../src/python/dimension.ts","../src/python/scale.ts","../src/worker/stats-worker.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;IAAA;;;IAGG;IAEI,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B7B;IAEM,MAAM,eAA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K,GAAG,MAAM,GAAG,OAAO;IACxD,iBAAA,CAAC;oBACF;IAEF,YAAA,KAAK,KAAK;IACR,gBAAA,MAAM,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;wBACvC,QAAQ;wBACR,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC;IACvC,oBAAA,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,CAAC,CAAC;IAChC,oBAAA,MAAM,CAAC,MAAM,EAAE,MAAM,KAAK,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACnD,oBAAA,MAAM,CAAC,MAAM,EAAE,aAAa,IAAI,GAAG,CAAC;IACpC,oBAAA,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,EAAE;IACjC,iBAAA,CAAC;oBACF;;IAGF,YAAA,KAAK,gBAAgB;IACnB,gBAAA,MAAM,WAAW,CAAC,EAAE,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;wBAC7D,QAAQ;wBACR,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;IACnC,iBAAA,CAAC;oBACF;IAEF,YAAA;IACE,gBAAA,SAAS,CAAC,EAAE,EAAE,0BAA0B,IAAI,CAAA,CAAE,CAAC;;QAErD;QAAE,OAAO,GAAG,EAAE;YACZ,SAAS,CAAC,EAAE,EAAE,CAAA,cAAA,EAAiB,GAAG,YAAY,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA,CAAE,CAAC;QACpF;IACF,CAAC;IAED;IACA,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"stats-worker.js","sources":["../src/python/descriptive.ts","../src/python/compare-means.ts","../src/python/regression.ts","../src/python/classify.ts","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AE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@winm2m/inferential-stats-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A headless JavaScript SDK for advanced statistical analysis in the browser using WebAssembly (Pyodide). Performs SPSS-level inferential statistics entirely client-side with no backend required.",
|
|
5
5
|
"author": "Youngjune Kwon <yjkwon@winm2m.com>",
|
|
6
6
|
"license": "MIT",
|