<?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 can I present P-value in the histogram using SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794865#M22558</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to represent the P-value in the histogram graph. I have used SGPLOT to plot the histogram graph. How can I add the P-value to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options nonumber nodate center;
ods escapechar="^";
ods graphics/ reset imagename = "Overall education" imagefmt = jpeg;
ods listing gpath = "/Projects/Programs";
ods pdf file = "/Projects/Programs/Overall education.pdf";
title "Comparision of Impact on Overall Education between Female and Male";
proc sgplot data=PD2;
  histogram femaleedueffect /  transparency = 0.6 nbins=5
               name="Female" legendlabel="Female" fillattrs=(color=pink);
  histogram maleedueffect /  transparency=0.6 nbins=5
               name="Male" legendlabel="Male" fillattrs=(color=lightblue);
  xaxis label="Impact" values = (1 to 5 by 1) 
  valuesdisplay=("Large -ve impact" "Small -ve impact" "No impact" "Small +ve impact" "Large +ve impact") /*offsetmin= 0.2 offsetmax= 0.2*/;
  keylegend "Female" "Male" / across=1 position=TopRight location=Inside;
run;
ods pdf close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 19:33:10 GMT</pubDate>
    <dc:creator>RAVI2000</dc:creator>
    <dc:date>2022-02-07T19:33:10Z</dc:date>
    <item>
      <title>How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794865#M22558</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to represent the P-value in the histogram graph. I have used SGPLOT to plot the histogram graph. How can I add the P-value to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options nonumber nodate center;
ods escapechar="^";
ods graphics/ reset imagename = "Overall education" imagefmt = jpeg;
ods listing gpath = "/Projects/Programs";
ods pdf file = "/Projects/Programs/Overall education.pdf";
title "Comparision of Impact on Overall Education between Female and Male";
proc sgplot data=PD2;
  histogram femaleedueffect /  transparency = 0.6 nbins=5
               name="Female" legendlabel="Female" fillattrs=(color=pink);
  histogram maleedueffect /  transparency=0.6 nbins=5
               name="Male" legendlabel="Male" fillattrs=(color=lightblue);
  xaxis label="Impact" values = (1 to 5 by 1) 
  valuesdisplay=("Large -ve impact" "Small -ve impact" "No impact" "Small +ve impact" "Large +ve impact") /*offsetmin= 0.2 offsetmax= 0.2*/;
  keylegend "Female" "Male" / across=1 position=TopRight location=Inside;
run;
ods pdf close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 19:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794865#M22558</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-02-07T19:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794871#M22559</link>
      <description>&lt;P&gt;If you have the numeric p value, the easiest way to add it on the graph might be in a title2 or footnote statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have something specific in mine? A certain location on/around the graph where you'd like to show the numeric p value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 19:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794871#M22559</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2022-02-07T19:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794875#M22560</link>
      <description>I want to show it in the top right corner of the graph.</description>
      <pubDate>Mon, 07 Feb 2022 21:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794875#M22560</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-02-07T21:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794876#M22561</link>
      <description>&lt;P&gt;You can also use the INSET statement to put the p-value inside the data area:&lt;/P&gt;
&lt;P&gt;inset ("p-value:"="0.05");&lt;/P&gt;
&lt;P&gt;The procedure will perform automatic collision avoidance with this inset, or you can explicitly set the position via the POSITION option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 21:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794876#M22561</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-02-07T21:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794880#M22562</link>
      <description>How is the INSET statement going to calculate the P-value?</description>
      <pubDate>Mon, 07 Feb 2022 22:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794880#M22562</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-02-07T22:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794881#M22563</link>
      <description>&lt;P&gt;P-value for what hypothesis test?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any calculation of p-values would have to be done in a PROC before you try to create the plot.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 22:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794881#M22563</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-07T22:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794900#M22564</link>
      <description>Yes, you are right. But how do I use that P- value in my SGPLOT again?&lt;BR /&gt;&lt;BR /&gt;If i am using proc univariate I can only perform for one histogram. I also want to overlay the graph with different group. And how am I supposed to get p-value for both the variables that I am looking for.&lt;BR /&gt;&lt;BR /&gt;Can you provide the proc code with p-value calculation for two or more variable?</description>
      <pubDate>Tue, 08 Feb 2022 00:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794900#M22564</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-02-08T00:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794965#M22565</link>
      <description>&lt;P&gt;Again I ask: P-value for what hypothesis test? Please be specific, as we need to know this in order to state actual code, rather than general wording of how to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;General wording of how to do this&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Any PROC allows you to store p-values in output data sets, from there you could create a macro variable that has the value of p-value, and then use the macro variable in the INSET statement.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 12:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/794965#M22565</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-08T12:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I present P-value in the histogram using SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/795073#M22566</link>
      <description>&lt;P&gt;You might be thinking of PROC UNIVARIATE, which supports an INSET statement that can automatically add statistics to a histogram.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=sashelp.cars mu0=(20 26);
   var       mpg_city mpg_highway;
   histogram mpg_city mpg_highway;
   inset T="t" probt="p-value" / pos=NE format=6.3;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above example creates two histograms and puts the t statistic and the associated p-value for the Student's t test for the two hypotheses mean(mpg_city)=20 and&amp;nbsp;mean(mpg_highway)=26.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/procstat/v_003/procstat_univariate_syntax15.htm#procstat.univariate.insetoptdict" target="_self"&gt;The documentation state&lt;/A&gt;s that the built-in p-values are for the t-test for location and for a normality test. However, you can put any statistic into a SAS data set and use the DATA= option to add your own labels and p-values from any other test.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 21:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-present-P-value-in-the-histogram-using-SGPLOT/m-p/795073#M22566</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-02-08T21:43:39Z</dc:date>
    </item>
  </channel>
</rss>

