cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-249259%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EWie%20berechne%20ich%20Z-Scores%20auf%20verschiedenen%20Aggregationsebenen%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249259%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWie%20verwende%20ich%20JSL%2C%20um%20Z-Scores%20auf%20verschiedenen%20Aggregationsebenen%20zu%20berechnen%3F%20Ich%20arbeite%20mit%20Krebssterblichkeitsdaten%20(1999%20-%202015)%20auf%20Kreisebene.%20Ich%20muss%20Z-Scores%20berechnen%2C%20um%20jeden%20Bezirk%20mit%20den%20anderen%20innerhalb%20eines%20Staates%20und%20allen%20Bezirken%20innerhalb%20des%20Landes%20zu%20vergleichen.%20Ich%20kann%20die%20Standardisierungsfunktion%20nicht%20einfach%20verwenden%2C%20da%20sie%20automatisch%20einen%20Durchschnitt%20der%20Raten%20nimmt%20-%20was%20ung%C3%BCltig%20ist%2C%20es%20sei%20denn%2C%20die%20Populationen%20sind%20alle%20genau%20gleich%20gro%C3%9F.%20Ich%20muss%20eine%20Variante%20der%20allgemeinen%20Z-Score-Formel%20verwenden%2C%20um%20den%20Mittelwert%20der%20Raten%20f%C3%BCr%20einen%20bestimmten%20Staat%20(falsch)%20durch%20einen%20Mittelwert%20einer%20aggregierten%20Region%20(z.%20B.%20der%20gesamte%20Staat)%20zu%20ersetzen.%20Dies%20wird%20berechnet%2C%20indem%20Z%C3%A4hler%20und%20Nenner%20unabh%C3%A4ngig%20voneinander%20aggregiert%20und%20dann%20dividiert%20werden%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Emit%20anderen%20Worten%2C%3CFONT%20color%3D%22%230000FF%22%3E%20SUM(Alle%20Todesf%C3%A4lle%20in%20allen%20Bezirken%20im%20Bundesstaat%20K%20im%20Jahr%20X)%3C%2FFONT%3E%20%2F%3CFONT%20color%3D%22%230000FF%22%3E%20SUM(Alle%20Personen%20in%20allen%20Bezirken%20in%20Staat%20K%20im%20Jahr%20X)%3CFONT%20color%3D%22%23000000%22%3E%20%3D%2F%3D%3CFONT%20color%3D%22%23FF0000%22%3E%20MITTELWERT%20(Krebssterberaten)%20f%C3%BCr%20alle%20Bezirke%20in%20Staat%20X%20zum%20Zeitpunkt%20Y.%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CFONT%20color%3D%22%23000000%22%3EAm%20kritischsten%20ist%2C%20dass%20bei%20der%20Z-Score-Berechnung%20der%20Subtrahend%20im%20Z%C3%A4hler%20einen%20aggregierten%20Mittelwert%20f%C3%BCr%20eine%20gesamte%20Region%20widerspiegeln%20muss%2C%20NICHT%20einen%20Durchschnitt%20von%20Raten.%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%20color%3D%22%23000000%22%3EDas%20Skript%20muss%20Nullwerte%20bei%20seiner%20Berechnung%20von%20N%20und%20auf%20verschiedenen%20Aggregationsebenen%20ber%C3%BCcksichtigen%20(Anzahl%20der%20Landkreise%20f%C3%BCr%20WV%20zum%20Beispiel%20%3D%2055%2C%20Anzahl%20der%20Landkreise%2C%20f%C3%BCr%20die%20Daten%20nicht%20null%20sind%20%3D%2052%3B%20Anzahl%20aller%20Landkreise%20in%20den%20USA%20%3D%203141%2C%20Anzahl%20aller%20Landkreise%20f%C3%BCr%20Daten%20ist%20beispielsweise%20nicht%20null%20%3D%202956).%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%20color%3D%22%23000000%22%3E%3CFONT%20color%3D%22%23000000%22%3EDie%20Standardisierungsfunktion%20kann%20hier%20nicht%20verwendet%20werden%2C%20da%20die%3C%2FFONT%3E%3C%2FFONT%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Jmsouch_1-1582729326586.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jmsouch_1-1582729326586.png%22%20style%3D%22width%3A%208px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jmsouch_1-1582729326586.png%22%20style%3D%22width%3A%208px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21917i04CF11799F6BFD58%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Jmsouch_1-1582729326586.png%22%20alt%3D%22Jmsouch_1-1582729326586.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%20wird%20als%20Durchschnitt%20der%20Kurse%20berechnet%2C%20was%20ung%C3%BCltig%20ist.%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Jmsouch_0-1582729290983.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jmsouch_0-1582729290983.png%22%20style%3D%22width%3A%2094px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jmsouch_0-1582729290983.png%22%20style%3D%22width%3A%2094px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21916iB1CAA2D1E0785C1B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Jmsouch_0-1582729290983.png%22%20alt%3D%22Jmsouch_0-1582729290983.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EGibt%20es%20eine%20M%C3%B6glichkeit%2C%20JSL%20zu%20verwenden%2C%20um%20diese%20Aufgabe%20effizient%20zu%20erledigen%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5579%22%20target%3D%22_blank%22%3E%40Wendy_Murphrey%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6713%22%20target%3D%22_blank%22%3E%20%40Theresa_Utlaut%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-249259%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3ESkripterstellung%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Choose Language Hide Translation Bar
Jmsouch
Level I

How do I calculate z-scores at different aggregation levels?

Hello, 

 

How do I use JSL to calculate Z-scores at different levels of aggregation? I am working with cancer mortality data (1999 - 2015) at the county-level. I need to calculate Z-scores to compare each county to the others within a state and all counties within the country. I cannot simply use the standardize function because it automatically takes an average of rates--which is invalid unless the populations are all exactly equal in size. I need to use some variant of the common Z-score formula to replace the mean of the rates for a given state (incorrect) with a mean of an aggregated region (entire state, for example). This is calculated by aggregating the numerator and denominator independently and then dividing:

 

in other words, SUM(All deaths in all counties in state K at year X) / SUM(All people in all counties in State K at  year X) =/= MEAN(Cancer Death Rates) for all counties in State X at time Y. 

 

  • Most critically, in the z-score calculation, the subtrahend in the numerator must reflect an aggregate mean for an entire region, NOT an average of Rates. 
  • The script needs to account for null values in its calculation of N and at different levels of aggregation (Number of counties for WV  for example = 55, number of counties for which data is non-null = 52; number of all counties in the US  = 3141, number of all counties for data is non-null = 2956, for example). 
  • the standardize function cannot be used here because the Jmsouch_1-1582729326586.png is calculated as an average of rates, which is invalid. 

     

 

Jmsouch_0-1582729290983.png

Is there any way to use JSL to accomplish this task efficiently? 

 

@Wendy_Murphrey @Theresa_Utlaut 

 

 

0 REPLIES 0

Recommended Articles