<?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 Re: Annual percentage change of a categorical variable using complex data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979566#M49092</link>
    <description>&lt;P&gt;Please explain further. How can we calculate annual change if there is no variable in your data set that indicates year?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain further. You have weighted data, what are the weights, and which variable(s) are weighted, and how/why would we use the weights?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Nov 2025 17:02:33 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-11-25T17:02:33Z</dc:date>
    <item>
      <title>Annual percentage change of a categorical variable using complex data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979542#M49090</link>
      <description>&lt;P&gt;Hi everyone, I have looked through the forums and cannot seem to find an answer to my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have complex, weighted data (roughly 4000 observations) over the course of 3 waves in multiple age bands: 15-18, 19-21, 22-25. I want to show the annual percentage change between each wave of the categorical variable "heavy drinker" (binary yes/no). I would then like to test if the annual percent change is significant between the age groups as well as across multiple waves within each age group (wave 1 to 2, 2 to 3, 1 to 5).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I create the annual percentage change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the appropriate statistical test for something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt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/TD&gt;&lt;TD&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;19-21&lt;/TD&gt;&lt;TD&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 15:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979542#M49090</guid>
      <dc:creator>dinyuen</dc:creator>
      <dc:date>2025-11-25T15:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Annual percentage change of a categorical variable using complex data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979563#M49091</link>
      <description>&lt;P&gt;First, I would make mosaic plots for visualization:&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2013/11/04/create-mosaic-plots-in-sas-by-using-proc-freq.html" target="_blank"&gt;Create mosaic plots in SAS by using PROC FREQ - The DO Loop&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2013/11/06/how-to-specify-mosaic-plot-colors-in-sas.html" target="_blank"&gt;How to specify mosaic plot colors in SAS - The DO Loop&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/07/25/color-mosaic-plots-independence.html" target="_blank"&gt;Color cells in a mosaic plot by deviation from independence - The DO Loop&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/07/08/add-annotation-mosaic-plot-sas.html" target="_blank"&gt;How to add an annotation to a mosaic plot in SAS - The DO Loop&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Then &lt;STRONG&gt;compare proportions&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;For dependent samples :&amp;nbsp;&lt;A href="https://support.sas.com/kb/22/562.html" target="_blank"&gt;22562 - Testing the equality of proportions from dependent samples&lt;/A&gt;&lt;BR /&gt;For independent samples :&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://support.sas.com/kb/22/561.html" target="_blank"&gt;22561 - Testing the equality of two or more proportions from independent samples&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html" target="_blank"&gt;Test for the equality of two proportions in SAS - The DO Loop&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can also take a modelling approach, but first you can try with statistical hypothesis testing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 16:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979563#M49091</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-11-25T16:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Annual percentage change of a categorical variable using complex data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979566#M49092</link>
      <description>&lt;P&gt;Please explain further. How can we calculate annual change if there is no variable in your data set that indicates year?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain further. You have weighted data, what are the weights, and which variable(s) are weighted, and how/why would we use the weights?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 17:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979566#M49092</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-11-25T17:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Annual percentage change of a categorical variable using complex data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979608#M49095</link>
      <description>&lt;P&gt;The wave represents "year". The data were collected at different lengths of time. For example, Wave 1 took place between 2010 to 2012, Wave 2 2015 to 2018 and Wave 3 2020 to 2021. The same people were surveyed at each time point. I have been working with weights calculated as "all waves weights variable: weights_waves1to3" that is to be used for used when working with all 3 waves. So the calculation would be more of a wave percent change rather than annual. For other calculations I have relied on the proc surveyfreq incorporating the weight variable. Expansion of the data would be assigning the weight variable to each id and carrying it through the waves. Please let me know if you need any more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example data:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;wave&lt;/TD&gt;&lt;TD&gt;age group&lt;/TD&gt;&lt;TD&gt;heavy drinker&lt;/TD&gt;&lt;TD&gt;weights_waves1to3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;15-18&lt;/TD&gt;&lt;TD&gt;yes&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;15-18&lt;/TD&gt;&lt;TD&gt;no&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;19-21&lt;/TD&g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>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979608#M49095</guid>
      <dc:creator>dinyuen</dc:creator>
      <dc:date>2025-11-26T13:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Annual percentage change of a categorical variable using complex data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979610#M49096</link>
      <description>&lt;P&gt;Thank you for the response. Is there an option to incorporate the weight aspect like in proc surveyfreq to create these?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 13:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Annual-percentage-change-of-a-categorical-variable-using-complex/m-p/979610#M49096</guid>
      <dc:creator>dinyuen</dc:creator>
      <dc:date>2025-11-26T13:54:43Z</dc:date>
    </item>
  </channel>
</rss>

