<?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 Standard Deviation of All Observations of Multiple Variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42421#M11045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may or may not understand what you are trying to do.&amp;nbsp; Does the following do what you want?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=sashelp.class std;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var _numeric_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 03:50:40 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-08-04T03:50:40Z</dc:date>
    <item>
      <title>Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42420#M11044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to compute Standard Deviation of ALL Observations of MULTIPLE Variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC MEANS can compute std of EACH variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STD function can compute std of EACH observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to compute std of all observations (data points) of multiple variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have 3 variables, var1, var2, var3 and 3 observations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 var2 var3&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC MEANS can compute std of EACH variable and return std1 of (1, 4, 7), std2 of (2, 5, 8), std3 (3, 6, 9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STD function in data step can compute std of EACH observation and return std_1_ of (1,2,3), std_2_ of (4, 5, 6) and std_2_ of (7, 8, 9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to get ONE single standard deviation of all 12 data points, std_all of (1,2,3,4,5,6,7,8,9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 03:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42420#M11044</guid>
      <dc:creator>richard_hu2003</dc:creator>
      <dc:date>2011-08-04T03:33:29Z</dc:date>
    </item>
    <item>
      <title>Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42421#M11045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may or may not understand what you are trying to do.&amp;nbsp; Does the following do what you want?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=sashelp.class std;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var _numeric_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 03:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42421#M11045</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-04T03:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42422#M11046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;art297, thanks. But I think your approach will return multiple std of EACH numeric variable, not ONE std of ALL elements of ALL numberic variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just revised my original post to clarify my question. thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 04:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42422#M11046</guid>
      <dc:creator>richard_hu2003</dc:creator>
      <dc:date>2011-08-04T04:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42423#M11047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc means can not allow you to use all the data to calculate std, you need to make a longitude&amp;nbsp; variable to contain all the value of variables.Such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; var=var1;output;&lt;/P&gt;&lt;P&gt;var=var2;output;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;drop var1-var4.&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a lot of variables ,then use array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 10:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42423#M11047</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-08-04T10:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42424#M11048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a number of ways to do it.&amp;nbsp; I, personally, would use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input var1-var3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; recnum=_n_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;4 5 6&lt;/P&gt;&lt;P&gt;7 8 9&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=need;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by recnum;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=need std;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var col1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 12:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42424#M11048</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-04T12:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42425#M11049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi .. another idea ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* 4,000 values;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;do j=1 to 1000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; a = 100*ranuni(999);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; b = 100*ranuni(999);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; c = 100*ranuni(999);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; d = 100*ranuni(999);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;drop j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* macro variable can hold up to 64K characters;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;select catx(',', a, b, c, d) into :nnn&amp;nbsp; separated by ',' from x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;std = std(&amp;amp;nnn);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;put "STANDARD DEVIATION:&amp;nbsp; " std;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 03:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42425#M11049</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-08-05T03:56:42Z</dc:date>
    </item>
    <item>
      <title>Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42426#M11050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to reshape the data, a roll-your-own approach with a Double DoW can do it. Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; have;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;input&lt;/SPAN&gt; var1-var3;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #0000ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;cards&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;1 2 3&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;4 5 6&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;7 8 9&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #0000ff;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;_null_&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;until&lt;/SPAN&gt; (lastobs) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; have end=lastobs ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n_v +&amp;nbsp;&amp;nbsp; n(of var:) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; sum_v + sum(of var:) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;lastobs = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;until&lt;/SPAN&gt; (lastobs) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; have end=lastobs ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;array&lt;/SPAN&gt; vv&lt;LI&gt; var: ;&lt;/LI&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; j = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;to&lt;/SPAN&gt; dim(vv) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sumsq + ( vv&lt;J&gt; - (sum_v / n_v) )**&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt; ;&lt;/J&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; std = sqrt( sumsq/(n_v-&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;) ) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;put&lt;/SPAN&gt; std= ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;richard_hu2003 wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to compute Standard Deviation of ALL Observations of MULTIPLE Variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC MEANS can compute std of EACH variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STD function can compute std of EACH observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to compute std of all observations (data points) of multiple variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have 3 variables, var1, var2, var3 and 3 observations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 var2 var3&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC MEANS can compute std of EACH variable and return std1 of (1, 4, 7), std2 of (2, 5, 8), std3 (3, 6, 9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STD function in data step can compute std of EACH observation and return std_1_ of (1,2,3), std_2_ of (4, 5, 6) and std_2_ of (7, 8, 9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to get ONE single standard deviation of all 12 data points, std_all of (1,2,3,4,5,6,7,8,9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Aug 2011 02:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42426#M11050</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-08-06T02:02:47Z</dc:date>
    </item>
    <item>
      <title>Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42427#M11051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Howles wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to reshape the data, a roll-your-own approach with a Double DoW can do it.&amp;nbsp; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I think one pass will suffice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(lastobs);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; have end=lastobs;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uss = sum(uss,uss(of var:));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum = sum(sum,of var:);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n&amp;nbsp;&amp;nbsp; = sum(n,n(of var:));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp; std = sqrt((uss-(sum**&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;/n))/(n-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; std=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;stop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Aug 2011 02:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42427#M11051</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-08-06T02:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42428#M11052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi ... got a tip from a friend, down to one PROC ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;data x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;do j=1 to 1000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; a = 100*ranuni(999);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; b = 100*ranuni(999);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; c = 100*ranuni(999);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; d = 100*ranuni(999);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;drop j;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;select catx(',', a, b, c, d) into :nnn&amp;nbsp; separated by ',' from x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;reset print ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;select std(&amp;amp;nnn) "STANDARD DEVIATION" from x(obs=1) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 11:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42428#M11052</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-08-08T11:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation of All Observations of Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42429#M11053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad you posted this as I hadn't realized that one could create and use a macro variable within one proc sql run.&amp;nbsp; However, I believe that the OP wanted the sd per record, not for the entire file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 12:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Standard-Deviation-of-All-Observations-of-Multiple-Variables/m-p/42429#M11053</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-08T12:23:29Z</dc:date>
    </item>
  </channel>
</rss>

