<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I calculate z-scores at different aggregation levels? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-calculate-z-scores-at-different-aggregation-levels/m-p/249259#M48931</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in other words,&lt;FONT color="#0000FF"&gt; SUM(All deaths in all counties in state K at year X)&lt;/FONT&gt; / &lt;FONT color="#0000FF"&gt;SUM(All people in all counties in State K at&amp;nbsp; year X)&lt;FONT color="#000000"&gt; =/= &lt;FONT color="#FF0000"&gt;MEAN(Cancer Death Rates) for all counties in State X at time Y.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;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.&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;The script needs to account for null values in its calculation of N and at different levels of aggregation (Number of counties for WV&amp;nbsp; for example = 55, number of counties for which data is non-null = 52; number of all counties in the US&amp;nbsp; = 3141, number of all counties for data is non-null = 2956, for example).&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;the standardize function cannot be used here because the&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jmsouch_1-1582729326586.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21917i04CF11799F6BFD58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jmsouch_1-1582729326586.png" alt="Jmsouch_1-1582729326586.png" /&gt;&lt;/span&gt;&amp;nbsp;is calculated as an average of rates, which is invalid.&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jmsouch_0-1582729290983.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21916iB1CAA2D1E0785C1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jmsouch_0-1582729290983.png" alt="Jmsouch_0-1582729290983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use JSL to accomplish this task efficiently?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5579"&gt;@Wendy_Murphrey&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6713"&gt;@Theresa_Utlaut&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:26:11 GMT</pubDate>
    <dc:creator>Jmsouch</dc:creator>
    <dc:date>2023-06-09T23:26:11Z</dc:date>
    <item>
      <title>How do I calculate z-scores at different aggregation levels?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-calculate-z-scores-at-different-aggregation-levels/m-p/249259#M48931</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in other words,&lt;FONT color="#0000FF"&gt; SUM(All deaths in all counties in state K at year X)&lt;/FONT&gt; / &lt;FONT color="#0000FF"&gt;SUM(All people in all counties in State K at&amp;nbsp; year X)&lt;FONT color="#000000"&gt; =/= &lt;FONT color="#FF0000"&gt;MEAN(Cancer Death Rates) for all counties in State X at time Y.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;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.&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;The script needs to account for null values in its calculation of N and at different levels of aggregation (Number of counties for WV&amp;nbsp; for example = 55, number of counties for which data is non-null = 52; number of all counties in the US&amp;nbsp; = 3141, number of all counties for data is non-null = 2956, for example).&amp;nbsp;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;the standardize function cannot be used here because the&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jmsouch_1-1582729326586.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21917i04CF11799F6BFD58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jmsouch_1-1582729326586.png" alt="Jmsouch_1-1582729326586.png" /&gt;&lt;/span&gt;&amp;nbsp;is calculated as an average of rates, which is invalid.&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jmsouch_0-1582729290983.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21916iB1CAA2D1E0785C1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jmsouch_0-1582729290983.png" alt="Jmsouch_0-1582729290983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use JSL to accomplish this task efficiently?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5579"&gt;@Wendy_Murphrey&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6713"&gt;@Theresa_Utlaut&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:26:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-calculate-z-scores-at-different-aggregation-levels/m-p/249259#M48931</guid>
      <dc:creator>Jmsouch</dc:creator>
      <dc:date>2023-06-09T23:26:11Z</dc:date>
    </item>
  </channel>
</rss>

