<?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: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508424#M17309</link>
    <description>&lt;P&gt;I wanted to plot the mean value of "avgbis" at 0, 25, 50, 75, 100, 125 in the second plot. The first plot is good.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2018 17:36:56 GMT</pubDate>
    <dc:creator>desireatem</dc:creator>
    <dc:date>2018-10-29T17:36:56Z</dc:date>
    <item>
      <title>sgplot and average plots. The problem is with the second code that corresponce to attachment2 plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508403#M17307</link>
      <description>&lt;P&gt;Hello -,&lt;/P&gt;
&lt;P&gt;I plotted the following plots using sgplot procedure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; proc sgplot data=sonic7;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;series x=sidobs y=avgbis/ group=music;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;by sid;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;(SEE ATTACHMENT1)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;Nex I want to plot the average at time point 0, 25, 50 etc and below is the code. (THE PLOTS DOES NOT COME THE WAY I WANT IT, see ATTACHMENT2)&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;proc sort data=sonic7;&lt;BR /&gt;&amp;nbsp;by music sidobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc summary data=sonic7;&lt;BR /&gt;&amp;nbsp;by music sidobs;&lt;BR /&gt;&amp;nbsp;var avgbis;&lt;BR /&gt;&amp;nbsp;output out=mean1 (drop=_:) mean=mean n=n stderr=stderr;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data meanstdREVISED;&lt;BR /&gt;&amp;nbsp;set mean1;&lt;BR /&gt;&amp;nbsp;yvalue=mean;&lt;BR /&gt;&amp;nbsp;high=yvalue + stderr;&lt;BR /&gt;&amp;nbsp;low=yvalue - stderr;&lt;BR /&gt;&amp;nbsp;*if 2 le visit le 3 then treatment=1;&lt;BR /&gt;&amp;nbsp;*else treatment=0;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;* have to sort if using block plot! ;&lt;/P&gt;
&lt;P&gt;proc sort data=meanstdREVISED;&lt;BR /&gt;&amp;nbsp; by sidobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format ;&lt;BR /&gt;&amp;nbsp;value music_userfmt 0='Control' 1='Music';&lt;BR /&gt;&amp;nbsp;*value treat 0=' ' 1='Treatment period';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods graphics / attrpriority=none;&lt;/P&gt;
&lt;P&gt;proc sgplot data=meanstdREVISED;&lt;BR /&gt;&amp;nbsp;block x=sidobs block=music / valueattrs=(weight=bold size=10)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; valuevalign=bottom filltype=alternate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fillattrs=(color=white) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; altfillattrs=(color=yellow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; transparency=.8;&lt;BR /&gt;&amp;nbsp;scatter x=sidobs y=yvalue / group=music yerrorlower=low yerrorupper=high &lt;BR /&gt;&amp;nbsp;&amp;nbsp;markerattrs=(size=12) errorbarattrs=(thickness=3) name='scatter';&lt;BR /&gt;&amp;nbsp;styleattrs datasymbols=(circlefilled diamondfilled) datalinepatterns=(solid &lt;BR /&gt;&amp;nbsp;&amp;nbsp;shortdash);&lt;BR /&gt;&amp;nbsp;series x=sidobs y=yvalue / group=music name='series';&lt;BR /&gt;&amp;nbsp;yaxis values=(0 to 1 by .1);&lt;BR /&gt;&amp;nbsp;xaxis label='sidobs' values=(0 to 125 by 25);&lt;BR /&gt;&amp;nbsp;keylegend 'scatter' 'series' / location=inside down=2;&lt;BR /&gt;&amp;nbsp;format music music_userfmt.; *treatment treat. ;&lt;BR /&gt;&amp;nbsp;xaxistable n / class=music location=outside colorgroup=music valueattrs=(weight=bold &lt;BR /&gt;&amp;nbsp;&amp;nbsp;size=10) labelattrs=(weight=bold size=10) title='Sample size at each sidobs' &lt;BR /&gt;&amp;nbsp;&amp;nbsp;titleattrs=(weight=bold size=10);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 16:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508403#M17307</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2018-10-29T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508410#M17308</link>
      <description>&lt;P&gt;You might at least try to describe what is wanted that didn't happen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;some actual data in the form of a data step might help.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 16:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508410#M17308</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-29T16:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508424#M17309</link>
      <description>&lt;P&gt;I wanted to plot the mean value of "avgbis" at 0, 25, 50, 75, 100, 125 in the second plot. The first plot is good.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 17:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508424#M17309</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2018-10-29T17:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508439#M17311</link>
      <description>&lt;P&gt;First of all, I'm not sure why you have the BLOCK plot in this example, so I would remove it for now. The "n" for the AXISTABLE has too many values, which is why the text runs together. I would create a little data step that adds an "n2" variable, and copies the "n" value only when the "sidobs" value is&amp;nbsp;&lt;SPAN&gt;0, 25, 50, 75, 100, or 125. All other "sidobs" values should set "n2" to missing (.). Use the "n2" variable on the AXISTABLE instead of the "n" variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let us know if you are try to use the BLOCK statement to create another feature in the graph.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508439#M17311</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-10-29T18:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508451#M17313</link>
      <description>&lt;P&gt;Actually once I take out the bloc, I got something, by the means are every where:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=meanstdREVISED;&lt;BR /&gt;&amp;nbsp;scatter x=sidobs y=yvalue / group=music yerrorlower=low yerrorupper=high &lt;BR /&gt;&amp;nbsp;&amp;nbsp;markerattrs=(size=12) errorbarattrs=(thickness=3) name='scatter';&lt;BR /&gt;&amp;nbsp;styleattrs datasymbols=(circlefilled diamondfilled) datalinepatterns=(solid &lt;BR /&gt;&amp;nbsp;&amp;nbsp;shortdash);&lt;BR /&gt;&amp;nbsp;series x=sidobs y=yvalue / group=music name='series';&lt;BR /&gt;&amp;nbsp;yaxis values=(0 to 70 by 10);&lt;BR /&gt;&amp;nbsp;xaxis label='sidobs' values=(0 to 125 by 25);&lt;BR /&gt;&amp;nbsp;keylegend 'scatter' 'series' / location=inside down=2;&lt;BR /&gt;&amp;nbsp;format music music_userfmt.; *treatment treat. ;&lt;BR /&gt;&amp;nbsp;xaxistable&amp;nbsp; / class=music location=outside colorgroup=music valueattrs=(weight=bold &lt;BR /&gt;&amp;nbsp;&amp;nbsp;size=10) labelattrs=(weight=bold size=10) title='Sample size at each sidobs' &lt;BR /&gt;&amp;nbsp;&amp;nbsp;titleattrs=(weight=bold size=10);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SEE PLOT3&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508451#M17313</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2018-10-29T18:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508455#M17314</link>
      <description>&lt;P&gt;The variables on your BY statement in your PROC SUMMARY are in the wrong order:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;by music sidobs;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should be:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;by sidobs music;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That's because you are using sidobs as your X var, but music (group) is changing within each X.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try that and see what you get.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508455#M17314</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-10-29T18:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508458#M17315</link>
      <description>&lt;P&gt;Thank you, it is giving me the means at each point, but I wish to have mean at 0, 25, 50, 75, 100, 125. I do not know how to do.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;See attached Improved plot 4&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508458#M17315</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2018-10-29T18:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508468#M17316</link>
      <description>&lt;P&gt;Adding a WHERE clause to either the PROC SUMMARY or the PROC SGPLOT should do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where&amp;nbsp;&lt;SPAN&gt;sidobs in (0, 25, 50, 75, 100, 125);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 19:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508468#M17316</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-10-29T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot and average plots. The problem is with the second code that corresponce to attachment2 pl</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508490#M17317</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 19:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-and-average-plots-The-problem-is-with-the-second-code/m-p/508490#M17317</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2018-10-29T19:46:48Z</dc:date>
    </item>
  </channel>
</rss>

