1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34966],{20531:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>U});var s=a(95155),r=a(12115),n=a(99669),i=a(97003),l=a(27784),o=a(33789),d=a(90235),h=a(67001),u=a(33534),c=a(25016),m=a(81322);function p(e){let t=e.match(/\d[\d.,]*\d/g)??[],a="",s=0,r=0;for(let e of t){let t=(e.match(/,/g)??[]).length;if(0===t)continue;""===a&&(a=e);let n=e.lastIndexOf(".");if(n>=0){e.lastIndexOf(",")>n?r+=2:s+=2;continue}if(t>1){s+=2;continue}let i=e.slice(e.indexOf(",")+1);3===i.length?s+=1:i.length<=2&&(r+=1)}return{role:r>s?"decimal":"thousands",seen:e.includes(","),example:a}}function x(e,t){return"thousands"===t?e.replace(/\b\d{1,3}(?:,\d{3})+\b/g,e=>e.replace(/,/g,"")):e.replace(/(\d)\.(?=\d{3}(?:\D|$))/g,"$1").replace(/(\d),(\d+)/g,"$1.$2")}function f(e,t){let a=x(e.trim(),t);return""===a?NaN:Number(a)}function g(e,t){let a=x(e,t),s=[],r=[],n=0,i=0,l=a.split(/\r?\n/);for(let e=0;e<l.length;e++){let t=l[e]??"";if(""===t.trim())continue;let a=t.split(/[\s,;|]+/).filter(e=>""!==e),o=[],d=!1,h="";for(let e of a){let t=e.replace(/^[$£â¬]/,"").replace(/%$/,""),a=Number(t);""!==t&&Number.isFinite(a)?o.push(a):(d=!0,h||(h=e.slice(0,24)))}if(0===o.length){n+=1,r.length<400&&r.push({line:e+1,text:t.trim().slice(0,40)});continue}let u=o[o.length-1];for(let t of d&&void 0!==u?[u]:o){if(s.length>=12e3){i+=1;continue}s.push({id:s.length,value:t,line:e+1,label:h})}}return{rows:s,overCap:i,skipped:r,skippedCount:n}}var N=a(16110);let b="tb-zscore-prefs",v="The standard deviation is 0, so every value sits exactly on the mean and there is nothing to divide by. A z score does not exist for constant data.";function j(e){return Math.exp(-.5*e*e-.9189385332046728)}function w(e){return .5*(1+(0,n.Y12)(e/Math.SQRT2))}function y(e){let t=0;for(let a=60;a>=1;a--)t=a/(e+t);return j(e)/(e+t)}function M(e){return Number.isNaN(e)?NaN:e===1/0?0:e===-1/0?1:e<0?1-M(-e):e<=6?1-w(e):y(e)}function k(e){let t;if(e<=0)return-1/0;if(e>=1)return 1/0;if(e<.02425){let a=Math.sqrt(-2*Math.log(e));t=(((((-.007784894002430293*a+-.3223964580411365)*a+-2.400758277161838)*a+-2.549732539343734)*a+4.374664141464968)*a+2.938163982698783)/((((.007784695709041462*a+.3224671290700398)*a+2.445134137142996)*a+3.754408661907416)*a+1)}else if(e<=.97575){let a=e-.5,s=a*a;t=(((((-39.69683028665376*s+220.9460984245205)*s+-275.928510446968)*s+138.357751867269)*s+-30.66479806614716)*s+2.506628277459239)*a/(((((-54.47609879822406*s+161.5858368580409)*s+-155.6989798598866)*s+66.80131188771972)*s+-13.28068155288572)*s+1)}else{let a=Math.sqrt(-2*Math.log(1-e));t=-(((((-.007784894002430293*a+-.3223964580411365)*a+-2.400758277161838)*a+-2.549732539343734)*a+4.374664141464968)*a+2.938163982698783)/((((.007784695709041462*a+.3224671290700398)*a+2.445134137142996)*a+3.754408661907416)*a+1)}for(let a=0;a<2;a++){let a=(M(-t)-e)/j(t);t-=a/(1+t*a/2)}return t}function z(e){let t=[676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,15056327351493116e-23];if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-z(1-e);let a=e-1,s=.9999999999998099;for(let e=0;e<t.length;e++)s+=(t[e]??0)/(a+e+1);let r=a+t.length-.5;return .5*Math.log(2*Math.PI)+(a+.5)*Math.log(r)-r+Math.log(s)}function $(e,t,a){let s=e+t,r=e+1,n=e-1,i=1,l=1-s*a/r;1e-300>Math.abs(l)&&(l=1e-300);let o=l=1/l;for(let d=1;d<=300;d++){let h=2*d,u=d*(t-d)*a/((n+h)*(e+h));1e-300>Math.abs(l=1+u*l)&&(l=1e-300),1e-300>Math.abs(i=1+u/i)&&(i=1e-300),o*=(l=1/l)*i,1e-300>Math.abs(l=1+(u=-(e+d)*(s+d)*a/((e+h)*(r+h)))*l)&&(l=1e-300),1e-300>Math.abs(i=1+u/i)&&(i=1e-300);let c=(l=1/l)*i;if(o*=c,1e-12>Math.abs(c-1))break}return o}function F(e,t){if(!(t>0)||!Number.isFinite(e))return NaN;let a=.5*function(e,t,a){if(a<=0)return 0;if(a>=1)return 1;let s=Math.exp(z(e+.5)-z(e)-z(.5)+e*Math.log(a)+t*Math.log(1-a));return a<(e+1)/(e+t+2)?s*$(e,t,a)/e:1-s*$(t,e,1-a)/t}(t/2,.5,t/(t+e*e));return e>0?1-a:a}function S(e,t){return e>=2?"sample"===t?(e-1)/Math.sqrt(e):Math.sqrt(e-1):NaN}function C(e,t){if(!(t>=3))return NaN;let a=Math.abs(e)*Math.sqrt(t)/(t-1);return a>=1?0:2*(1-F(a*Math.sqrt(t-2)/Math.sqrt(1-a*a),t-2))}function P(){let e=[];Math.abs(w(1.96)-.9750021048517796)>1e-12&&e.push("normal CDF"),Math.abs(2*M(1.96)-.049995790296440745)>1e-12&&e.push("two sided tail");let t=1-w(6);for(let a of(Math.abs(t-y(6))/t>1e-6&&e.push("far tail seam"),Math.abs(y(37)-5725571222524577e-315)/5725571222524577e-315>1e-9&&e.push("far tail value"),Math.abs(k(.975)-1.959963984540054)>1e-9&&e.push("inverse normal"),0!==k(.5)&&e.push("inverse normal at the median"),[1e-20,1e-100,1e-300]))Math.abs(M(-k(a))-a)/a>1e-9&&e.push("inverse normal far tail");
1for(let[t,a,s]of(Math.abs(-k(1e-20)-9.262340089798407)>1e-9&&e.push("inverse upper tail"),Math.abs(F(2.1448,14)-.975)>1e-5&&e.push("t distribution"),Math.abs(F(1.96,1e7)-w(1.96))>1e-5&&e.push("t at large df"),Math.abs(S(10,"sample")-2.846049894151541)>1e-12&&e.push("ceiling"),Math.abs(C(3,20)-5025182269453587e-19)>1e-15&&e.push("exact point p"),[["3,5","decimal",3.5],["0,75","decimal",.75],["1.200","decimal",1200],["1,200","thousands",1200],["1,234.5","thousands",1234.5]])){let r=f(t,a),n=g(t,a).rows[0]?.value??NaN;(r!==s||n!==s)&&e.push(`comma reading of ${t}`)}return e}function T(e,t){return Number.isFinite(e)?e.toFixed(t):"not defined"}function A(e,t){return Number.isNaN(e)?"not defined":0===e?"below 1e-308":e>=1?"1":e<1e-4?e.toExponential(Math.min(6,Math.max(2,t))):e.toFixed(Math.max(t,4))}function L(e,t){if(Number.isNaN(e))return"not defined";let a=100*e;return a>=99.995?"above 99.99%":a<=.005?"below 0.01%":`${a.toFixed(Math.min(Math.max(t,2),4))}%`}let D="rounded-md border bg-muted px-4 py-3 text-sm",q={single:"A single value",mean:"The mean of a sample",sample:"A value inside a pasted sample"},W={single:"how unusual one observation is",mean:"how unusual an average of n observations is",sample:"how far one row sits from the rest of the rows you pasted"},J={left:"Left tail",right:"Right tail",two:"Two tailed"},I={cumulative:"Area to the LEFT of z",upper:"Area to the RIGHT of z",body:"Area between 0 and z"},R=`72 268 375 471 569 673 770 874 967 1071 1172 1270 1369 1491 1573`;function U(){let e=(0,r.useMemo)(P,[]),[t,a]=(0,r.useState)("score"),[n,x]=(0,r.useState)("single"),[w,y]=(0,r.useState)("78"),[$,U]=(0,r.useState)("70"),[E,O]=(0,r.useState)("5"),[H,B]=(0,r.useState)("25"),[Y,Z]=(0,r.useState)(!1),[V,_]=(0,r.useState)(""),[G,X]=(0,r.useState)("thousands"),[Q,K]=(0,r.useState)(!1),[ee,et]=(0,r.useState)("sample"),[ea,es]=(0,r.useState)(null),[er,en]=(0,r.useState)([]),[ei,el]=(0,r.useState)("3"),[eo,ed]=(0,r.useState)(!1),[eh,eu]=(0,r.useState)(""),[ec,em]=(0,r.useState)("two"),[ep,ex]=(0,r.useState)(4),[ef,eg]=(0,r.useState)("cumulative"),[eN,eb]=(0,r.useState)("p"),[ev,ej]=(0,r.useState)("0.05"),[ew,ey]=(0,r.useState)("two"),[eM,ek]=(0,r.useState)("1350"),[ez,e$]=(0,r.useState)("1050"),[eF,eS]=(0,r.useState)("200"),[eC,eP]=(0,r.useState)("28"),[eT,eA]=(0,r.useState)("20.6"),[eL,eD]=(0,r.useState)("5.4");(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(b);if(e){let t=JSON.parse(e);("single"===t.mode||"mean"===t.mode||"sample"===t.mode)&&x(t.mode),("left"===t.tail||"right"===t.tail||"two"===t.tail)&&em(t.tail),"number"==typeof t.dp&&t.dp>=2&&t.dp<=6&&ex(Math.round(t.dp)),("cumulative"===t.conv||"upper"===t.conv||"body"===t.conv)&&eg(t.conv)}}catch{}let e=new URLSearchParams(window.location.search),t=new URLSearchParams(window.location.hash.slice(1)),a=a=>t.get(a)??e.get(a),s=e.get("m");("single"===s||"mean"===s||"sample"===s)&&x(s);let r=e.get("t");
15("left"===r||"right"===r||"two"===r)&&em(r);let n=a("x");n&&y(n);let i=a("u");i&&U(i);let l=a("s");l&&O(l);let o=a("n");o?B(o):"mean"===s&&B("");let d=a("d");d&&_(d);let h=e.get("c");("cumulative"===h||"upper"===h||"body"===h)&&eg(h);let u=e.get("p");if(u){let e=Number(u);Number.isFinite(e)&&e>=2&&e<=6&&ex(Math.round(e))}let c=e.get("k");("sample"===c||"population"===c)&&et(c)},[]),(0,l.Vd)(b,()=>JSON.stringify({mode:n,tail:ec,dp:ep,conv:ef}),[n,ec,ep,ef]);let eq=(0,r.useMemo)(()=>"reverse"===t?ev:"compare"===t?[eM,ez,eF,eC,eT,eL].join(" "):"table"===t?"":"sample"===n?ei:[w,$,E,H].join(" "),[t,n,ev,eM,ez,eF,eC,eT,eL,ei,w,$,E,H]),eW=(0,r.useMemo)(()=>{let e=p(V);return e.seen?e:p(eq)},[V,eq]),eJ=Q?G:eW.role,eI=(0,r.useMemo)(()=>g(V,eJ),[V,eJ]),eR=eW.seen&&""!==eW.example?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["thousands"===eJ?`${eW.example} was read with the comma as a thousands separator.`:`${eW.example} was read with the comma as a decimal point.`," ",(0,s.jsx)("button",{type:"button",className:"text-primary underline underline-offset-4",onClick:()=>{X("thousands"===eJ?"decimal":"thousands"),K(!0)},children:"Read it the other way"})]}):null,eU=(0,r.useMemo)(()=>new Set(er),[er]),eE=(0,r.useMemo)(()=>eI.rows.filter(e=>!eU.has(e.id)),[eI.rows,eU]),eO=(0,r.useMemo)(()=>er.map(e=>eI.rows[e]?.line??e),[er,eI.rows]),eH=(0,r.useMemo)(()=>(function(e){let t=0,a=0,s=0;for(let r of e){t+=1;let e=r-a;a+=e/t,s+=e*(r-a)}return{n:t,mean:a,sampleSd:t>1?Math.sqrt(s/(t-1)):NaN,popSd:t>0?Math.sqrt(s/t):NaN}})(eE.map(e=>e.value)),[eE]),eB="sample"===ee?eH.sampleSd:eH.popSd,eY=S(eH.n,ee),eZ=(0,r.useMemo)(()=>eH.n>=2&&Number.isFinite(eB)&&0!==eB?eE.map(e=>({...e,z:(e.value-eH.mean)/eB})).sort((e,t)=>Math.abs(t.z)-Math.abs(e.z)):[],[eE,eH.mean,eH.n,eB]),eV=eZ[0],e_=(0,r.useMemo)(()=>null===ea?eV:eZ.find(e=>e.id===ea)??eV,[ea,eZ,eV]),eG=f(w,eJ),eX=f($,eJ),eQ=f(E,eJ),eK=f(H,eJ),e0=(0,r.useMemo)(()=>{let e={ok:!1,error:null,z:NaN,zSingle:NaN,zMean:NaN,se:NaN,nUsed:NaN,label:""};if("sample"===n)return""===V.trim()?{...e,error:"Paste a column of numbers to score a value against."}:1===eH.n?{...e,error:"One number is not a sample. A z score here needs a mean and a spread, and a single reading gives you neither."}:eH.n>=2?Number.isFinite(eB)&&0!==eB?e_?{ok:!0,error:null,z:e_.z,zSingle:e_.z,zMean:NaN,se:NaN,nUsed:eH.n,label:`row on line ${e_.line}`}:{...e,error:"Pick a row to score."}:{...e,error:v}:{...e,error:"No numbers were read from what you pasted."};if(!Number.isFinite(eG)||!Number.isFinite(eX)||!Number.isFinite(eQ))return{...e,error:"Fill in the value, the mean and the standard deviation."};if(eQ<0)return{...e,error:"A standard deviation cannot be negative. Check that field."};if(0===eQ)return{...e,error:v};let t=(eG-eX)/eQ,a=Number.isFinite(eK)&&eK>=1,s=a?eQ/Math.sqrt(eK):NaN,r=a?(eG-eX)/s:NaN;return"mean"!==n||a?{ok:!0,error:null,z:"mean"===n?r:t,zSingle:t,zMean:r,se:s,nUsed:a?eK:NaN,label:"mean"===n?"sample mean":"single value"}:{...e,error:"A sample mean needs its sample size. Enter n, because that is the only thing separating this answer from the single value one."}}
15,[n,V,eH.n,eB,e_,eG,eX,eQ,eK]),e1=e0.z,e2=e0.ok?M(-e1):NaN,e3=e0.ok?M(e1):NaN,e5=e0.ok?Math.min(1,2*M(Math.abs(e1))):NaN,e4="left"===ec?e2:"right"===ec?e3:e5,e9=e0.ok&&Math.abs(e1)>37.5,e6=(0,r.useMemo)(()=>"sample"===n&&e0.ok&&eH.n>=3?C("sample"===ee?e1:e1*Math.sqrt((eH.n-1)/eH.n),eH.n):NaN,[n,e0.ok,eH.n,ee,e1]),e7=Number.isNaN(e6)?NaN:Math.min(1,eH.n*e6),e8=!!(e_&&eV&&e_.id===eV.id),te=(0,r.useMemo)(()=>"mean"===n&&e0.ok&&Y&&eK>=2?Math.min(1,2*(1-F(Math.abs(e1),eK-1))):NaN,[n,e0.ok,Y,eK,e1]),tt=f(ev,eJ),ta=(0,r.useMemo)(()=>Number.isFinite(tt)?"pct"===eN?tt<=0||tt>=100?{ok:!1,msg:"A percentile has to sit between 0 and 100, and neither end is reachable.",z:NaN,read:""}:{ok:!0,msg:"",z:k(tt/100),read:`read as the ${tt} percentile, so the area to the LEFT of z`}:tt<=0||tt>=1?{ok:!1,msg:"A p value has to sit between 0 and 1.",z:NaN,read:""}:"two"===ew?{ok:!0,msg:"",z:-k(tt/2),read:`read as a TWO tailed p, so the area is split, ${tt/2} in each tail`}:"right"===ew?{ok:!0,msg:"",z:-k(tt),read:"read as a RIGHT tail p, so the whole area sits above z"}:{ok:!0,msg:"",z:k(tt),read:"read as a LEFT tail p, so the whole area sits below z"}:{ok:!1,msg:"Enter a number.",z:NaN,read:""},[eN,tt,ew]),ts=(0,r.useMemo)(()=>{let e=f(eM,eJ),t=f(ez,eJ),a=f(eF,eJ),s=f(eC,eJ),r=f(eT,eJ),n=f(eL,eJ),i=Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(a)&&a>0,l=Number.isFinite(s)&&Number.isFinite(r)&&Number.isFinite(n)&&n>0;return i&&l?{ok:!0,za:(e-t)/a,zb:(s-r)/n}:{ok:!1,za:NaN,zb:NaN}},[eM,ez,eF,eC,eT,eL,eJ]),tr=(0,r.useMemo)(()=>{let e=e=>"cumulative"===ef?M(-e):"upper"===ef?M(e):Math.abs(M(-e)-.5),t=(t,a)=>{let s=[];for(let r=0;r<10;r++){let n=a?t-r/100:t+r/100;s.push({z:n,area:e(n)})}return{key:`${a?"n":"p"}${t.toFixed(1)}`,head:t,neg:a,cells:s}},a=[];for(let e=34;e>=0;e--)a.push(t(-e/10,!0));for(let e=0;e<=34;e++)a.push(t(e/10,!1));return a},[ef]),tn=e0.ok&&3.49>=Math.abs(e1)?Math.round(100*e1)/100:null,ti=null!==tn&&tn<0,tl=null===tn?0:Math.round(100*tn),to=Math.trunc(tl/10),td=0===to&&tl<0?"-0.0":(to/10).toFixed(1),th=`0.0${Math.abs(tl%10)}`,tu=e0.ok?Math.min(6,Math.max(4,Math.ceil(Math.abs(e1))+.5)):4,tc=(0,r.useRef)(null),[tm,tp]=(0,r.useState)(!1);function tx(e){if("sample"===n)return;let t=function(e){let t=tc.current;if(!t)return null;let a=t.getBoundingClientRect();if(a.width<=0)return null;let s=.94375*a.width;return-tu+2*Math.min(1,Math.max(0,(e-(a.left+a.width*(18/640)))/s))*tu}(e);if(null===t||!Number.isFinite(eQ)||eQ<=0||!Number.isFinite(eX))return;let a="mean"===n?e0.se:eQ;Number.isFinite(a)&&!(a<=0)&&y(String(Number((eX+t*a).toFixed(4))))}let tf="sample"===n?V:"",tg=(0,r.useMemo)(()=>encodeURIComponent(tf).length,[tf]),tN=tg>8e3;function tb(){if(!e0.ok)return"";let e=[];return"sample"===n&&e_?(e.push(`Sample of n = ${eH.n} read from your paste`),e.push(`mean = ${T(eH.mean,ep)}`),e.push(`${"sample"===ee?"sample":"population"} standard deviation = ${T(eB,ep)}`),e.push("z = (x - mean) / s"),e.push(`z = (${e_.value} - ${T(eH.mean,ep)}) / ${T(eB,ep)} = ${T(e1,ep)}`)):"mean"===n?(e.push("z = (xbar - mu) / (sigma / sqrt(n))"),e.push(`standard error = ${eQ} / sqrt(${eK}) = ${T(e0.se,ep)}`),e.push(`z = (${eG} - ${eX}) / ${T(e0.se,ep)} = ${T(e1,ep)}`)):(e.push("z = (x - mu) / sigma"),e.push(`z = (${eG} - ${eX}) / ${eQ} = ${T(e1,ep)}`)),e.push(""),e.push(`left tail p = ${A(e2,ep)}`),e.push(`right tail p = ${A(e3,ep)}`),e.push(`two tailed p = ${A(e5,ep)}`),e.push(`percentile = ${L(e2,ep)}`),e.join("\n")}async function tv(e){if(!e)return;let t=e.name.toLowerCase();if(!(e.type.startsWith("text/")||t.endsWith(".txt")||t.endsWith(".csv")||t.endsWith(".tsv")))return void eu(`${e.name} is not a text file, so nothing was read from it. Drop a .csv, .tsv or .txt.`);try{let t=await (0,m.G)(e);_(t.text),en([]),es(null),eu(""!==t.note?`Read ${e.name}. ${t.note}`:`Read ${e.name}.`)}catch(t){eu(t instanceof Error&&t.message.includes("UTF-32")?t.message:`${e.name} could not be read.`)}}let tj=f(ei,eJ),tw="sample"===n&&Number.isFinite(tj)&&Number.isFinite(eY)&&tj>eY,ty=(()=>{let e=-tu,t=t=>18+(t-e)/(tu-e)*604,a=j(0),s=e=>182-Math.min(e,1.35*a)/(1.35*a)*164,r=[];for(let a=0;a<=240;a++){let n=e+(tu-e)*a/240;r.push(`${t(n).toFixed(2)},${s(j(n)).toFixed(2)}`)}let i=(a,r)=>{let n=Math.max(e,a),i=Math.min(tu,r);if(!(i>n))return"";let l=[`M ${t(n).toFixed(2)} 182.00`];for(let e=0;e<=120;e++){let a=n+(i-n)*e/120;l.push(`L ${t(a).toFixed(2)} ${s(j(a)).toFixed(2)}`)}return l.push(`L ${t(i).toFixed(2)} 182.00 Z`),l.join(" ")},l=[];e0.ok&&("left"===ec?l.push(i(e,e1)):"right"===ec?l.push(i(e1,tu)):(l.push(i(e,-Math.abs(e1))),l.push(i(Math.abs(e1),tu))));let o="";if("sample"===n&&eH.n>=4&&Number.isFinite(eY)){let a=[];for(let r=0;r<=240;r++){let n=e+(tu-e)*r/240,i=function(e,t,a){if(!(t>=4))return NaN;let s=S(t,a),r=e/s;if(Math.abs(r)>=1)return 0;let n=z(.5)+z((t-2)/2)-z((t-1)/2);return Math.exp((t-4)/2*Math.log(1-r*r)-n)/s}(n,eH.n,ee);Number.isFinite(i)&&0!==i&&a.push(`${0===a.length?"M":"L"} ${t(n).toFixed(2)} ${s(i).toFixed(2)}`)}o=a.join(" ")}return{W:640,H:200,PAD:18,xPix:t,yPix:s,pts:r.join(" "),shades:l,exactPath:o,lo:e,hi:tu}})();return(0,s.jsxs)("div",{className:"space-y-4",children:[e.length>
150?(0,s.jsxs)("p",{className:(0,c.cn)(D,"text-destructive"),role:"alert",children:["The built in check of this page failed on: ",e.join(", "),". Do not trust the numbers below and please report it."]}):null,(0,s.jsx)("div",{className:"flex flex-wrap gap-1","aria-label":"Which direction you are working in",children:[["score","Z score"],["reverse","p or percentile to z"],["compare","Compare two scores"],["table","Z table"]].map(([e,r])=>(0,s.jsx)(i.$,{"aria-pressed":t===e,variant:t===e?"default":"outline",size:"sm",onClick:()=>a(e),children:r},e))}),"score"===t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{children:"What are you actually asking?"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"What are you asking",children:["single","mean","sample"].map(e=>(0,s.jsx)(i.$,{"aria-pressed":n===e,variant:n===e?"default":"outline",size:"sm",onClick:()=>x(e),children:q[e]},e))}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["This picks the denominator, and it is the difference between two answers that can be a factor of the square root of n apart. Right now you are asking ",W[n],"."]})]}),"sample"===n?(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"paste",children:"Your numbers"}),(0,s.jsx)("div",{onDragOver:e=>{e.preventDefault(),ed(!0)},onDragLeave:()=>ed(!1),onDrop:e=>{e.preventDefault(),ed(!1),tv(e.dataTransfer.files?.[0])},onPaste:e=>{let t=e.clipboardData?.files?.[0];t&&(e.preventDefault(),tv(t))},className:(0,c.cn)("rounded-md",eo&&"ring-2 ring-primary ring-offset-2"),children:(0,s.jsx)(h.T,{id:"paste",value:V,onChange:e=>{_(e.target.value),en([]),es(null)},rows:6,placeholder:"Click here and paste a spreadsheet column, or type values on separate lines, or drag a .csv or .txt file onto this box. Labeled rows like Maria 88 work too."})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("label",{className:"cursor-pointer text-xs text-primary underline-offset-4 hover:underline",children:["Choose a file",(0,s.jsx)("input",{type:"file",accept:".csv,.txt,.tsv,text/plain",className:"sr-only",onChange:e=>void tv(e.target.files?.[0])})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"or drag one onto the box, or paste it. All three go through the same reader."}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{_(R),en([]),es(null)},children:"Try 15 numbers"})]}),(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-1 text-xs"),"aria-live":"polite",children:[(0,s.jsxs)("p",{className:"text-foreground",children:[eI.rows.length," number",1===eI.rows.length?"":"s"," read",er.length>0?`, ${er.length} set aside, ${eH.n} in use`:"","."]}),eI.overCap>0?(0,s.jsxs)("p",{className:"text-destructive",children:[12e3.toLocaleString()," rows read, which is the cap. ",eI.overCap," ","further row",1===eI.overCap?" was":"s were"," not read."]}):null,eI.skippedCount>0?(0,s.jsxs)("p",{className:"text-muted-foreground",children:[eI.skippedCount," line",1===eI.skippedCount?" was":"s were"," not numbers and ",1===eI.skippedCount?"was":"were"," skipped: line"," ",eI.skipped.slice(0,8).map(e=>e.line).join(", "),eI.skippedCount>8?" and more":"","."]}):null,eR,""!==eh?(0,s.jsx)("p",{className:"text-muted-foreground",children:eh}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Standard deviation"}),["sample","population"].map(e=>(0,s.jsx)(i.$,{"aria-pressed":ee===e,variant:ee===e?"default":"outline",size:"sm",onClick:()=>et(e),children:"sample"===e?"Sample (n - 1)":"Population (n)"},e))]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"xv",children:"mean"===n?"Sample mean (x bar)":"Your value (x)"}),(0,s.jsx)(o.p,{id:"xv",value:w,onChange:e=>y(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"muv",children:"Population mean (mu)"}),(0,s.jsx)(o.p,{id:"muv",value:$,onChange:e=>U(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"sgv",children:"Standard deviation (sigma)"}),(0,s.jsx)(o.p,{id:"sgv",value:E,onChange:e=>O(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(d.J,{htmlFor:"nv",children:["Sample size (n)","mean"===n?"":", optional"]}),(0,s.jsx)(o.p,{id:"nv",value:H,onChange:e=>B(e.target.value),inputMode:"numeric",placeholder:"mean"===n?"required":"to see the other answer too"})]})]}),eR,"mean"===n?(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("input",{type:"checkbox",checked:Y,onChange:e=>Z(e.target.checked),className:"h-4 w-4"}),"That standard deviation came from my sample, not from a known population"]}):null,(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{y("78"),U("70"),O("5"),B("25")},children:"Try 78 against a mean of 70"}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{y("1350"),U("1050"),O("200"),B("")},children:"Try an SAT score"})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1",role:"group","aria-label":"Which tail",children:["left","right","two"].map(e=>(0,s.jsx)(i.$,{"aria-pressed":ec===e,variant:ec===e?"default":"outline",size:"sm",onClick:()=>em(e),children:J[e]},e))}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.J,{htmlFor:"dp",className:"text-xs text-muted-foreground",children:"Decimal places"}),(0,s.jsx)("select",{id:"dp",value:ep,onChange:e=>ex(Number(e.target.value)),className:"h-9 rounded-md border bg-background px-2 text-sm",children:[2,3,4,5,6].map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]})]}
15),e0.error?(0,s.jsx)("p",{className:(0,c.cn)(D,"text-destructive"),"aria-live":"polite",children:e0.error}):null,e0.ok?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-2"),"aria-live":"polite",children:[(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["z score for ","sample"===n?e0.label:q[n].toLowerCase()]}),(0,s.jsxs)("p",{className:"text-3xl font-semibold text-foreground",children:["z = ",T(e1,ep)]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e1>=0?"Above":"Below"," the mean by ",T(Math.abs(e1),ep)," standard deviations. Percentile ",L(e2,ep),"."]}),(0,s.jsxs)("div",{className:"grid gap-2 sm:grid-cols-3 pt-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Left tail p"}),(0,s.jsx)("p",{className:(0,c.cn)("font-medium","left"===ec&&"text-primary"),children:A(e2,ep)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Right tail p"}),(0,s.jsx)("p",{className:(0,c.cn)("font-medium","right"===ec&&"text-primary"),children:A(e3,ep)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Two tailed p"}),(0,s.jsx)("p",{className:(0,c.cn)("font-medium","two"===ec&&"text-primary"),children:A(e5,ep)})]})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All three are correct for this z. Which one you want is a property of your hypothesis, not of the number, so the tool shows them together instead of picking one for you. You have ",J[ec].toLowerCase()," selected, giving"," ",A(e4,ep),"."]}),e9?(0,s.jsxs)("p",{className:"text-xs text-destructive",children:["Past a z of about ",37.5," the tail area is smaller than a
15normal double can hold, and by about 38.5 it underflows to nothing at all. At that point the answer is reported as below 1e-308 rather than as a zero that would read like certainty."]}):null]}),"sample"!==n&&Number.isFinite(e0.zMean)?(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-2"),children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Both answers, side by side, because the same three numbers give two different z scores depending on the question."}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:(0,c.cn)("rounded-md border p-3","single"===n&&"border-primary bg-background"),children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"One value, divided by sigma"}),(0,s.jsxs)("p",{className:"text-xl font-semibold text-foreground",children:["z = ",T(e0.zSingle,ep)]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Answers how unusual a single observation of ",w," is."]})]}),(0,s.jsxs)("div",{className:(0,c.cn)("rounded-md border p-3","mean"===n&&"border-primary bg-background"),children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["A mean of ",e0.nUsed,", divided by sigma over the square root of n"]}),(0,s.jsxs)("p",{className:"text-xl font-semibold text-foreground",children:["z = ",T(e0.zMean,ep)]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Answers how unusual an average of ",e0.nUsed," readings of ",w," is."]})]})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Standard error used for the right hand box: ",E," divided by the square root of ",e0.nUsed," is ",T(e0.se,ep),". The two z values differ by a factor of"," ",T(Math.sqrt(e0.nUsed),4),", which is exactly the square root of n and the most common way a z score comes out wrong."]}),Number.isFinite(te)?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["You said that sigma was estimated from the sample, so the honest reference is t on ",eK-1," degrees of freedom rather than the normal. That gives a two tailed p of ",A(te,ep)," against the normal figure of ",A(e5,ep),"."]}):null]}):null,(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("svg",{ref:tc,viewBox:`0 0 ${ty.W} ${ty.H}`,className:(0,c.cn)("w-full min-w-[320px]","sample"!==n&&"cursor-ew-resize"),role:"img","aria-label":`Normal curve with the ${J[ec].toLowerCase()} area shaded at z of ${T(e1,2)}`,onPointerDown:e=>{"sample"!==n&&(e.currentTarget.setPointerCapture(e.pointerId),tp(!0),tx(e.clientX))},onPointerMove:e=>{tm&&tx(e.clientX)},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),tp(!1)},onPointerCancel:()=>tp(!1),children:[ty.shades.map((e,t)=>""===e?null:(0,s.jsx)("path",{d:e,className:"fill-primary/25"},t)),(0,s.jsx)("polyline",{points:ty.pts,fill:"none",className:"stroke-foreground",strokeWidth:1.5}),""!==ty.exactPath?(0,s.jsx)("path",{d:ty.exactPath,fill:"none",className:"stroke-primary",strokeWidth:1.5,strokeDasharray:"4 3"}):null,(0,s.jsx)("line",{x1:ty.PAD,y1:ty.H-ty.PAD,x2:ty.W-ty.PAD,y2:ty.H-ty.PAD,className:"stroke-muted-foreground",strokeWidth:1}),[-3,-2,-1,0,1,2,3].filter(e=>Math.abs(e)<=tu).map(e=>(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:ty.xPix(e),y1:ty.H-ty.PAD,x2:ty.xPix(e),y2:ty.H-ty.PAD+4,className:"stroke-muted-foreground"}),(0,s.jsx)("text",{x:ty.xPix(e),y:ty.H-2,textAnchor:"middle",className:"fill-muted-foreground",fontSize:10,children:e})]},e)),Math.abs(e1)<=tu?(0,s.jsx)("line",{x1:ty.xPix(e1),y1:ty.PAD,x2:ty.xPix(e1),y2:ty.H-ty.PAD,className:"stroke-primary",strokeWidth:2}):null]})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"sample"===n?""!==ty.exactPath?"The solid line is the standard normal. The dashed line is the distribution your own sample actually produces, and it stops dead at the ceiling below because no point in the sample can reach past it.":"The solid line is the standard normal curve, with your selected area shaded.":"Drag anywhere on the curve to move the value and watch every number follow."}),"sample"===n&&Number.isFinite(eY)?(0,s.jsxs)("div",{className:(0,
15c.cn)(D,"space-y-2"),children:[(0,s.jsxs)("p",{className:"text-foreground",children:["With n = ",eH.n,", no point in this sample can exceed a z of ",T(eY,4),"."]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Scoring a value against the same numbers that produced the mean and the spread puts a hard cap on it, ","sample"===ee?"(n - 1) divided by the square root of n":"the square root of n - 1","."," ",eH.n<11&&"sample"===ee?"That is below 3, so a 3 sigma outlier cannot exist in this sample no matter what the numbers are. The smallest sample where a z of 3 is even reachable is 11.":"Any rule of thumb you apply has to sit under that number to mean anything."]}),Number.isFinite(e6)?(0,s.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,s.jsxs)("p",{className:"text-muted-foreground",children:["Two tailed p read off a normal table: ",A(e5,ep),". That figure assumes the spread was known in advance."]}),(0,s.jsxs)("p",{className:"text-muted-foreground",children:["If you had picked this row before seeing the data: ",A(e6,ep),". This is the exact figure for one point measured against its own sample, t on"," ",eH.n-2," degrees of freedom."]}),e8?(0,s.jsxs)("p",{className:"text-muted-foreground",children:["If you picked it because it was the most extreme of ",eH.n,":"," ",A(e7,ep),". Screening all ",eH.n," rows and reporting the winner is a different question, and it is the one most people are really asking."]}):null]}):null]}):null,"sample"===n&&eZ.length>0?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(d.J,{htmlFor:"thr",className:"text-xs text-muted-foreground",children:"Flag rows above a z of"}),(0,s.jsx)(o.p,{id:"thr",value:ei,onChange:e=>el(e.target.value),inputMode:"decimal",className:"h-9 w-24"}),eV?(0,s.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>en(e=>[...e,eV.id]),children:["Set aside line ",eV.line]}):null,er.length>0?(0,s.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>en([]),children:["Put ",1===er.length?"it":"them"," back"]}):null]}),tw?(0,s.jsxs)("p",{className:"text-xs text-destructive",children:["A threshold of ",T(tj,2)," is above the ceiling of"," ",T(eY,4)," for a sample of ",eH.n,", so nothing can ever cross it."]}):null,(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full min-w-[360px] text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b text-left text-xs text-muted-foreground",children:[(0,s.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Line"}),(0,s.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Value"}),(0,s.jsx)("th",{className:"py-1 pr-3 font-medium",children:"z"}),(0,s.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Percentile"}),(0,s.jsx)("th",{className:"py-1 font-medium",children:"Score it"})]})}),(0,s.jsx)("tbody",{children:eZ.slice(0,20).map(e=>(0,s.jsxs)("tr",{className:(0,c.cn)("border-b",Number.isFinite(tj)&&Math.abs(e.z)>=tj&&!tw&&"text-destructive"),children:[(0,s.jsx)("td",{className:"py-1 pr-3",children:e.line}),(0,s.jsx)("td",{className:"py-1 pr-3",children:e.value}),(0,s.jsx)("td",{className:"py-1 pr-3",children:T(e.z,Math.min(ep,4))}),(0,s.jsx)("td",{className:"py-1 pr-3",children:L(M(-e.z),2)}),(0,s.jsx)("td",{className:"py-1",children:(0,s.jsx)("button",{type:"button",className:"text-primary underline underline-offset-4",onClick:()=>es(e.id),children:e_&&e_.id===e.id?"showing":"pick"})})]},e.id))})]})}),eZ.length>20?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing the 20 rows furthest from the mean out of ",eZ.length,"."]}):null,er.length>0&&eV?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["With line",1===er.length?"":"s"," ",eO.join(", ")," set aside, the mean is ",T(eH.mean,ep)," and the largest remaining z is"," ",T(eV.z,ep)," on line ",eV.line,". Pulling one extreme value out moves the mean and the spread that everything else is judged against, which is why a second row can cross your threshold only after the first one leaves."]}):null]}):null,null!==tn?(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["On a printed z table this is the row for ",td," and the column for"," ",th,". Open the Z table above and the matching cell is highlighted."]}
15):null,(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-1"),children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Show your work"}),(0,s.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap text-xs text-foreground",children:tb()})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(N.i,{value:`z = ${T(e1,ep)}, ${J[ec].toLowerCase()} p = ${A(e4,ep)}, percentile ${L(e2,ep)}`,label:"Copy the result",copiedLabel:"Copied â",variant:"outline",size:"sm"}),(0,s.jsx)(N.i,{value:tb(),label:"Copy the working",copiedLabel:"Copied â",variant:"outline",size:"sm"})]})]}):null]}):null,"reverse"===t?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:[["p","I have a p value"],["pct","I have a percentile"]].map(([e,t])=>(0,s.jsx)(i.$,{"aria-pressed":eN===e,variant:eN===e?"default":"outline",size:"sm",onClick:()=>eb(e),children:t},e))}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"rev",children:"p"===eN?"p value":"Percentile"}),(0,s.jsx)(o.p,{id:"rev",value:ev,onChange:e=>ej(e.target.value),inputMode:"decimal"})]}),"p"===eN?(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{children:"Which tail is that p from?"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:["left","right","two"].map(e=>(0,s.jsx)(i.$,{"aria-pressed":ew===e,variant:ew===e?"default":"outline",size:"sm",onClick:()=>ey(e),children:J[e]},e))})]}):null]}),eR,ta.ok?(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-1"),"aria-live":"polite",children:[(0,s.jsxs)("p",{className:"text-3xl font-semibold text-foreground",children:["z = ",T(ta.z,ep),"p"===eN&&"two"===ew?` and ${T(-ta.z,ep)}`:""]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Your ",ev," was ",ta.read,"."]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"A p of 0.05 gives 1.645 one tailed and 1.960 two tailed. Both are right, and handing back one without saying which is the same mistake as guessing the tail on the way out."})]}):(0,s.jsx)("p",{className:(0,c.cn)(D,"text-destructive"),"aria-live":"polite",children:ta.msg})]}):null,"compare"===t?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Two scores from two different tests are not comparable as raw numbers. Turn each into a z and they are."}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Score A"}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"ax",children:"Value"}),(0,s.jsx)(o.p,{id:"ax",value:eM,onChange:e=>ek(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"amu",children:"Mean"}),(0,s.jsx)(o.p,{id:"amu",value:ez,onChange:e=>e$(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"asg",children:"Standard deviation"}),(0,s.jsx)(o.p,{id:"asg",value:eF,onChange:e=>eS(e.target.value),inputMode:"decimal"})]})]}),(0,s.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Score B"}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"bx",children:"Value"}),(0,s.jsx)(o.p,{id:"bx",value:eC,onChange:e=>eP(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"bmu",children:"Mean"}),(0,s.jsx)(o.p,{id:"bmu",value:eT,onChange:e=>eA(e.target.value),inputMode:"decimal"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(d.J,{htmlFor:"bsg",children:"Standard deviation"}),(0,s.jsx)(o.p,{id:"bsg",value:eL,onChange:e=>eD(e.target.value),inputMode:"decimal"})]})]})]}),eR,ts.ok?(0,s.jsxs)("div",{className:(0,c.cn)(D,"space-y-1"),"aria-live":"polite",children:[(0,s.jsxs)("p",{className:"text-foreground",children:["A is z = ",T(ts.za,ep)," at the ",L(M(-ts.za),2)," mark. B is z ="," ",T(ts.zb,ep)," at the ",L(M(-ts.zb),2)," mark."]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:1e-12>Math.abs(ts.za-ts.zb)?"The two sit at exactly the same place in their own distributions.":ts.za>ts.zb?`A sits further above its own mean, by ${T(ts.za-ts.zb,ep)} standard deviations.`:`B sits further above its own mean, by ${T(ts.zb-ts.za,ep)} standard deviations.`}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"This only tells you who ranks higher within their own group. It says nothing about which test was harder or whether the two groups were alike."})]}
15):(0,s.jsx)("p",{className:(0,c.cn)(D,"text-destructive"),children:"Both sides need a value, a mean and a standard deviation above 0."})]}):null,"table"===t?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:["cumulative","upper","body"].map(e=>(0,s.jsx)(i.$,{"aria-pressed":ef===e,variant:ef===e?"default":"outline",size:"sm",onClick:()=>eg(e),children:I[e]},e))}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing ",I[ef].toLowerCase(),", which is the convention this grid is currently built on. Printed tables use all three, so check the caption on yours before you compare. Every cell here is computed from the same function that produced your answer, so the table and the calculator cannot disagree."]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["The grid runs from -3.49 to 3.49, which is where printed tables stop. For a z outside that, go back to the Z score view, where the tail is computed properly and keeps working out to about 37.",null!==tn?` Your current z of ${T(e1,2)} is highlighted below.`:""]}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-[640px] text-xs",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b",children:[(0,s.jsx)("th",{className:"sticky left-0 bg-background px-2 py-1 text-left font-medium",children:"z"}),[0,1,2,3,4,5,6,7,8,9].map(e=>(0,s.jsxs)("th",{className:"px-2 py-1 text-right font-medium",children:["0.0",e]},e))]})}),(0,s.jsx)("tbody",{children:tr.map(e=>(0,s.jsxs)("tr",{className:"border-b",children:[(0,s.jsx)("th",{className:"sticky left-0 bg-background px-2 py-1 text-left font-medium",children:e.neg&&0===e.head?"-0.0":e.head.toFixed(1)}),e.cells.map(t=>{let a=null!==tn&&e.neg===ti&&.0049>Math.abs(t.z-tn);return(0,s.jsx)("td",{className:(0,c.cn)("px-2 py-1 text-right tabular-nums",a&&"bg-primary/20 font-semibold text-foreground"),children:t.area.toFixed(4)},t.z)})]},e.key))})]})})]}):null,tN?(0,s.jsxs)("p",{className:(0,c.cn)(D,"text-xs text-muted-foreground"),children:["This dataset encodes to ",tg.toLocaleString()," characters and the share link limit is ",8e3.toLocaleString(),", which is our own policy rather than a standard. The link below carries your settings without the data, so copy the results instead of relying on it to restore the numbers."]}):null,(0,s.jsx)(u.ToolActions,{getParams:function(){let e=new URLSearchParams;return e.set("m",n),e.set("t",ec),e.set("p",String(ep)),e.set("c",ef),"sample"===n&&e.set("k",ee),e},getFragment:function(){let e=new URLSearchParams;return"sample"===n?tN||""===tf||e.set("d",tf):(e.set("x",w),e.set("u",$),e.set("s",E),""!==H.trim()&&e.set("n",H)),e},title:"Z Score Calculator"})]})}},41234:()=>{}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.