<?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: plotting means and standard errors in proc glm in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751899#M36575</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Sat, 03 Jul 2021 11:57:42 GMT</pubDate>
    <dc:creator>emaneman</dc:creator>
    <dc:date>2021-07-03T11:57:42Z</dc:date>
    <item>
      <title>plotting means and standard errors in proc glm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751834#M36570</link>
      <description>&lt;P&gt;(Very) Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a PROC GLM with one class variable that has two levels, and I would like to get plots for the means for each condition.&lt;/P&gt;&lt;P&gt;I attach an example of the type of plot that I'd like, below .&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="Screenshot 2021-07-03 at 00.42.22.png" style="width: 326px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60919iB4C71906CE780565/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-07-03 at 00.42.22.png" alt="Screenshot 2021-07-03 at 00.42.22.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 22:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751834#M36570</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-07-02T22:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: plotting means and standard errors in proc glm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751895#M36572</link>
      <description>&lt;P&gt;You can get close to this plot using one of the plotting options in PROC GLM, specifically ANOMPLOT or MEANPLOT. These won't match exactly what you show, but are specifically designed to provide meaningful graphics in the case where you are comparing means, so in that sense, the plots will be better than the plots you show.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_glm_syntax01.htm#statug.glm.cglmfplots" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_glm_syntax01.htm#statug.glm.cglmfplots&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 11:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751895#M36572</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-03T11:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: plotting means and standard errors in proc glm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751896#M36573</link>
      <description>&lt;P&gt;It is generally recommended to use dot plots with error bars (rather than bar charts) to plot a mean and confidence limits. This is built into PROC GLM. You can use the LSMEANS and PLOTS=MEANPLOT options to get the plot, as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=sashelp.class plots(only)=(meanplot(cl ascending)); /* plot of means and CIs */
class sex;
model Weight = sex;
output out=GLMOut Predicted=Pred lclm=lclm uclm=uclm;
lsmeans Sex / cl;
run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you insist on using a bar chart, then use ODS OUTPUT to capture the&amp;nbsp; LSMeanCL table, then use the techniques in the article &lt;A href="https://blogs.sas.com/content/iml/2011/10/07/creating-bar-charts-with-confidence-intervals.html" target="_self"&gt;"Creating bar charts with confidence intervals"&lt;/A&gt;&amp;nbsp;to create the plot. It will look something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc glm data=sashelp.class plots(only)=(meanplot(cl ascending)); /* plot of means and CIs */
   class sex;
   model Weight = sex;
   output out=GLMOut Predicted=Pred lclm=lclm uclm=uclm;
   lsmeans Sex / cl;
   ods output LSMeanCL=LS;
run;
quit;

proc sgplot data=LS;
vbarparm category=Sex response=LSMean /
    limitlower=LowerCL limitupper=UpperCL;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As Peter Flom wrote in the comments to my blog post:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Bar charts with confidence intervals are also known as "dynamite plots" and for two reasons: 1) They look like the old dynamite things on cartoons and 2) They are dangerous. See&amp;nbsp;&lt;A href="http://biostat.mc.vanderbilt.edu/twiki/pub/Main/TatsukiRcode/Poster3.pdf" rel="nofollow ugc" target="_blank"&gt;http://biostat.mc.vanderbilt.edu/twiki/pub/Main/TatsukiRcode/Poster3.pdf&lt;/A&gt;&amp;nbsp;for a good explanation of why they are bad.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 11:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751896#M36573</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-07-03T11:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: plotting means and standard errors in proc glm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751898#M36574</link>
      <description>&lt;P&gt;Thank you! both are good.&lt;/P&gt;&lt;P&gt;I may take advantage of your expertise for one more step. The design is in fact more complex, with a nested factor that is random.&lt;/P&gt;&lt;P&gt;This is the syntax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;proc glm data=ebal_st plots=(meanplot(cl ascending));&lt;BR /&gt;class genre author;&lt;BR /&gt;model lessico = genre author(genre) /effectsize;&lt;BR /&gt;output out=GLMOut Predicted=Pred lclm=lclm uclm=uclm;&lt;BR /&gt;lsmeans genre / cl;&lt;BR /&gt;random author(genre);&lt;BR /&gt;ods output LSMeanCL=LS;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS automatically outputs an additional graph, to plot the random factor, AUTHOR, see below. I am not sure why for some of the levels of the random factor AUTHOR it puts what seem to be error bars. I cannot find the documentation where this graph is explained. Any idea?&lt;/P&gt;&lt;P&gt;The graph is below.&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="Screenshot 2021-07-03 at 13.53.04.png" style="width: 944px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60931iE895EA18694F1F13/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-07-03 at 13.53.04.png" alt="Screenshot 2021-07-03 at 13.53.04.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 11:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751898#M36574</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-07-03T11:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: plotting means and standard errors in proc glm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751899#M36575</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 11:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-means-and-standard-errors-in-proc-glm/m-p/751899#M36575</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-07-03T11:57:42Z</dc:date>
    </item>
  </channel>
</rss>

