<?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 VLINE with mean and StdDev? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SGPLOT-VLINE-with-mean-and-StdDev/m-p/683891#M32935</link>
    <description>&lt;P&gt;When you want to use an "error" different than is supplied directly by a plot option then you need to calculate the value yourself, placing the upper and/or lower value into a different variable and use an option that allows specifying limit variables, which may mean a different type of plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.temp;
   set sashelp.cars;

   if origin in ("Asia" , "Europe") then group= 1;
   else group= 2;

   if type= "Hybrid" then delete;
run;

proc summary data=work.temp nway;
   class type group;
   var enginesize;
   output out=work.summary
      mean= std= /autoname;
run;

data work.plot;
   set work.summary; 
   es_upper = enginesize_mean+ enginesize_stddev;
   es_lower = enginesize_mean- enginesize_stddev;
run;

proc sgplot data=work.plot ;
   series x=type y=enginesize_mean/group=group;
   scatter x=type y=enginesize_mean/group=group
          yerrorupper=es_upper
          yerrorlower=es_lower
   ;
run;
&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 Sep 2020 08:27:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-09-15T08:27:00Z</dc:date>
    <item>
      <title>SGPLOT VLINE with mean and StdDev?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SGPLOT-VLINE-with-mean-and-StdDev/m-p/683870#M32933</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to draw vlines with mean and standard deviation, instead of standard errors. The below code gives me the vline with StdErr. Could anybody help me with this?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
* Plot ;
	data temp;
		set sashelp.cars;

		if origin in ("Asia" , "Europe") then group= 1;
		else group= 2;

		if type= "Hybrid" then delete;
		run;



	proc sgplot data= temp;
		vline Type / 
			response= EngineSize 
			stat= mean 
			markers
			limitstat= stderr
			group= group;
			;
		run;


* Summary Stat ;
	proc sort data= temp; by type group ;
		run;

	proc means data= temp n sum mean std;
		class type group ;
		var EngineSize;
		run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 06:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SGPLOT-VLINE-with-mean-and-StdDev/m-p/683870#M32933</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-09-15T06:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VLINE with mean and StdDev?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SGPLOT-VLINE-with-mean-and-StdDev/m-p/683891#M32935</link>
      <description>&lt;P&gt;When you want to use an "error" different than is supplied directly by a plot option then you need to calculate the value yourself, placing the upper and/or lower value into a different variable and use an option that allows specifying limit variables, which may mean a different type of plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.temp;
   set sashelp.cars;

   if origin in ("Asia" , "Europe") then group= 1;
   else group= 2;

   if type= "Hybrid" then delete;
run;

proc summary data=work.temp nway;
   class type group;
   var enginesize;
   output out=work.summary
      mean= std= /autoname;
run;

data work.plot;
   set work.summary; 
   es_upper = enginesize_mean+ enginesize_stddev;
   es_lower = enginesize_mean- enginesize_stddev;
run;

proc sgplot data=work.plot ;
   series x=type y=enginesize_mean/group=group;
   scatter x=type y=enginesize_mean/group=group
          yerrorupper=es_upper
          yerrorlower=es_lower
   ;
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 08:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SGPLOT-VLINE-with-mean-and-StdDev/m-p/683891#M32935</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-15T08:27:00Z</dc:date>
    </item>
  </channel>
</rss>

