<?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 Q-Q plots by class use the same slope and intercept in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780781#M38339</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset where my variable of interest is adv_turnout and I have four treatment levels: "AP", "OP", "Both" and "None".&lt;/P&gt;
&lt;P&gt;I want to produce Q-Q plots for all the four treatments, so I use the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=anova_input normal cipctldf;
	class missing_info;
	var adv_turnout;
	qqplot / normal (mu=est sigma=est);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that I want to compare the qqplots with a normal distribution, with parameters estimated from the data.&lt;/P&gt;
&lt;P&gt;The issue I have is that, for all four plots, the same mu and sigma are used: that is, the mu and sigma estimated from the first group "AP". See the following plots:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabonzo_0-1637168055413.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65841i5B7C4D16C980B372/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabonzo_0-1637168055413.png" alt="gabonzo_0-1637168055413.png" /&gt;&lt;/span&gt;&lt;/P&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="gabonzo_1-1637168076076.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65842i6E71C7AD1ACF48E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabonzo_1-1637168076076.png" alt="gabonzo_1-1637168076076.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this a bug?&lt;/P&gt;
&lt;P&gt;Is there a way to match the qqplots with the correct mu and sigma estimations? I could run PROC UNIVARIATE four times separately for each subset, but that seems cumbersome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 16:58:16 GMT</pubDate>
    <dc:creator>gabonzo</dc:creator>
    <dc:date>2021-11-17T16:58:16Z</dc:date>
    <item>
      <title>Q-Q plots by class use the same slope and intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780781#M38339</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset where my variable of interest is adv_turnout and I have four treatment levels: "AP", "OP", "Both" and "None".&lt;/P&gt;
&lt;P&gt;I want to produce Q-Q plots for all the four treatments, so I use the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=anova_input normal cipctldf;
	class missing_info;
	var adv_turnout;
	qqplot / normal (mu=est sigma=est);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that I want to compare the qqplots with a normal distribution, with parameters estimated from the data.&lt;/P&gt;
&lt;P&gt;The issue I have is that, for all four plots, the same mu and sigma are used: that is, the mu and sigma estimated from the first group "AP". See the following plots:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabonzo_0-1637168055413.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65841i5B7C4D16C980B372/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabonzo_0-1637168055413.png" alt="gabonzo_0-1637168055413.png" /&gt;&lt;/span&gt;&lt;/P&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="gabonzo_1-1637168076076.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65842i6E71C7AD1ACF48E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabonzo_1-1637168076076.png" alt="gabonzo_1-1637168076076.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this a bug?&lt;/P&gt;
&lt;P&gt;Is there a way to match the qqplots with the correct mu and sigma estimations? I could run PROC UNIVARIATE four times separately for each subset, but that seems cumbersome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 16:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780781#M38339</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-11-17T16:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Q-Q plots by class use the same slope and intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780782#M38340</link>
      <description>&lt;P&gt;Change your statement from CLASS to BY which is the equivalent of running PROC UNIVARIATE multiple times with each group individually.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780782#M38340</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-17T17:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Q-Q plots by class use the same slope and intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780795#M38342</link>
      <description>Thank you, that works. However, it generates several plots instead of generating panels.</description>
      <pubDate>Wed, 17 Nov 2021 17:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/780795#M38342</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-11-17T17:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Q-Q plots by class use the same slope and intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/781353#M38374</link>
      <description>&lt;P&gt;To get them in the same plot, you can use PROC SGPANEL.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=sashelp.class out=class; by sex;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods exclude qqplot;&lt;BR /&gt;ods output qqplot=qqdata;&lt;BR /&gt;proc univariate data=class;&lt;BR /&gt;by sex;&lt;BR /&gt;var height;&lt;BR /&gt;qqplot / normal(mu=est sigma=est);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data qqdata;&lt;BR /&gt;set qqdata;&lt;BR /&gt;label = "Mu=" || put(RefInt,best6.) ||", Sigma=" || put(RefSlope,best6.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgpanel data=qqdata;&lt;BR /&gt;panelby sex / columns=1;&lt;BR /&gt;lineparm x=0 y=refInt slope=refSlope;&lt;BR /&gt;scatter x=quantile y=data;&lt;BR /&gt;inset label / position=BottomRight;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC UNIVARIATE uses the same reference line for each plot to ensure they can share a common x-axis.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 18:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Q-Q-plots-by-class-use-the-same-slope-and-intercept/m-p/781353#M38374</guid>
      <dc:creator>cyrus</dc:creator>
      <dc:date>2021-11-19T18:01:35Z</dc:date>
    </item>
  </channel>
</rss>

