<?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: Proc means summary statistics, join etc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405082#M98502</link>
    <description>Read the documentation of array statement, it explains how to define an array. If you want a list of variables to be mapped by an array, you have to list every variable if they don't have the same prefix and end with a number.</description>
    <pubDate>Wed, 18 Oct 2017 02:04:40 GMT</pubDate>
    <dc:creator>error_prone</dc:creator>
    <dc:date>2017-10-18T02:04:40Z</dc:date>
    <item>
      <title>Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404647#M98355</link>
      <description>&lt;P&gt;Ok, so here is the situation-&lt;/P&gt;
&lt;P&gt;I have a dataset called Fish which has data on&amp;#12;fish in 120 lakes, detailed in 120 rows and 15 columns including lake name. The scope of&amp;nbsp;my project is to compare each lake to other similar lakes to see whether there are&amp;nbsp;differences in eight numeric characteristics (mercury level, number of&amp;#12;fish, elevation, surface area, depth, drainage area, runoff&amp;nbsp; factor, and flushing rate). Because&amp;nbsp;not much is known about the distribution of the values&amp;nbsp;we want to compare a lake's value to both the mean and median of all other lakes in the data set with the same value of lake type (LT) and dam status (DAM).&lt;/P&gt;
&lt;P&gt;The first step is to use PROC MEANS to calculate the mean and median for each of the remaining numeric variables (all eight of&lt;BR /&gt;them) separately for each combination of LT and DAM. Lakes that don't have a value of LT or DAM reported need to&lt;BR /&gt;be included in this analysis. I need to use ODS to save the results to a data set named STATZ and ensure the results are not&lt;BR /&gt;printed to any other destination. Here is my code to do this task and I believe its correct, but just wanted to confirm from you guys.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc means data = fish ;
class lt/missing; class dam/missing;
var hg n elv sa z da rf fr ;
output out = statz1 mean = median = /autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The next step is to combine these summary statistics with the original data set using an appropriate&amp;nbsp;data step merge/join&amp;nbsp;technique. This new data set is&amp;nbsp;FISH2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Im confused here as Im not sure on what exactly I have to join summary dataset and original one on?&lt;/P&gt;
&lt;P&gt;The final step, after the data sets are joined, but in the same DATA step , I need to do the following using arrays.&lt;BR /&gt;Compute the following for each 8 variables. &lt;BR /&gt;{ Difference from the mean [variable - mean.of.variable]&lt;BR /&gt;{ Percent difference from the mean [(variable - mean.of.variable)/mean.of.variable]&lt;BR /&gt;{ Difference from the median [variable - median.of.variable]&lt;BR /&gt;{ Percent difference from the median [(variable - median.of.variable)/median.of.variable]&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 01:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404647#M98355</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T01:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404655#M98357</link>
      <description>&lt;P&gt;Merging data&lt;/P&gt;
&lt;P&gt;&lt;A href="http://video.sas.com/detail/videos/sas-analytics-u/video/4572997800001/merging-sas-tables-in-a-data-step?autoStart=true&amp;amp;page=0" target="_blank"&gt;http://video.sas.com/detail/videos/sas-analytics-u/video/4572997800001/merging-sas-tables-in-a-data-step?autoStart=true&amp;amp;page=0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Arrays:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40777"&gt;@devsas&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Ok, so here is the situation-&lt;/P&gt;
&lt;P&gt;I have a dataset called Fish which has data on&amp;#12;fish in 120 lakes, detailed in 120 rows and 15 columns including lake name. The scope of&amp;nbsp;my project is to compare each lake to other similar lakes to see whether there are&amp;nbsp;differences in eight numeric characteristics (mercury level, number of&amp;#12;fish, elevation, surface area, depth, drainage area, runoff&amp;nbsp; factor, and flushing rate). Because&amp;nbsp;not much is known about the distribution of the values&amp;nbsp;we want to compare a lake's value to both the mean and median of all other lakes in the data set with the same value of lake type (LT) and dam status (DAM).&lt;/P&gt;
&lt;P&gt;The first step is to use PROC MEANS to calculate the mean and median for each of the remaining numeric variables (all eight of&lt;BR /&gt;them) separately for each combination of LT and DAM. Lakes that don't have a value of LT or DAM reported need to&lt;BR /&gt;be included in this analysis. I need to use ODS to save the results to a data set named STATZ and ensure the results are not&lt;BR /&gt;printed to any other destination. Here is my code to do this task and I believe its correct, but just wanted to confirm from you guys.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc means data = fish ;
class lt/missing; class dam/missing;
var hg n elv sa z da rf fr ;
output out = statz1 mean = median = /autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The next step is to combine these summary statistics with the original data set using an appropriate&amp;nbsp;data step merge/join&amp;nbsp;technique. This new data set is&amp;nbsp;FISH2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Im confused here as Im not sure on what exactly I have to join summary dataset and original one on?&lt;/P&gt;
&lt;P&gt;The final step, after the data sets are joined, but in the same DATA step , I need to do the following using arrays.&lt;BR /&gt;Compute the following for each 8 variables. &lt;BR /&gt;{ Difference from the mean [variable - mean.of.variable]&lt;BR /&gt;{ Percent difference from the mean [(variable - mean.of.variable)/mean.of.variable]&lt;BR /&gt;{ Difference from the median [variable - median.of.variable]&lt;BR /&gt;{ Percent difference from the median [(variable - median.of.variable)/median.of.variable]&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 01:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404655#M98357</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T01:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404656#M98358</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc summary data=FISH missing nway;
  class LT DAM;
  var HG N ELV SA Z DA RF FR ;
  output out=SUM mean= median= /autoname;
run;
proc sql;&lt;BR /&gt;  create table FISH2 as
  select LAKENAME
        ,HG-HG_MEAN   as DIFF_AVG_HG
        ,HG-HG_MEDIAN as DIFF_MED_HG
        ,etc
  from FISH
         left join
       SUM
         on HAVE.LT=SUM.LT and HAVE.DAM=SUM.DAM ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 01:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404656#M98358</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-17T01:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404666#M98363</link>
      <description>&lt;P&gt;Looks like you could do the whole thing with a single SQL query (I added a macro to save on typing)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro stats(v);
	&amp;amp;v. - mean(&amp;amp;v.) as &amp;amp;v._err,
	(&amp;amp;v. - mean(&amp;amp;v.)) / mean(&amp;amp;v.) as &amp;amp;v._err_pct format=percent7.1,
	&amp;amp;v. - median(&amp;amp;v.) as &amp;amp;v._diff,
	(&amp;amp;v. - median(&amp;amp;v.)) / median(&amp;amp;v.) as &amp;amp;v._diff_pct format=percent7.1
%mend stats;

proc sql;
create table fish2 as
select 
	*,
	%stats(hg),
    %stats(n),
    %stats(elv),
    %stats(sa),
    %stats(z),
    %stats(da),
    %stats(rf),
    %stats(fr)
from fish
group by lt, dam;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 03:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404666#M98363</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-10-17T03:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404874#M98426</link>
      <description>&lt;P&gt;Thanks so much! I see that proc summary&amp;nbsp;gets pretty much the same results&amp;nbsp;as my code using proc means do, except that _type_ = 3 is the only one in your results. Can you please explain the significance of that and how can I get the same result using proc means?&lt;/P&gt;
&lt;P&gt;I believe I will do the merge using the data step and use arrays for repetitive statements.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404874#M98426</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T16:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404876#M98427</link>
      <description>&lt;P&gt;Thanks PGSTATS, your solution works too, its just that for this exercise I want to do it using proc means and arrays only to understand these better.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404876#M98427</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T16:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404877#M98428</link>
      <description>&lt;P&gt;Then you need to post what you're using/trying.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect you're missing the NWAY option in PROC MEANS. Note that MEANS/SUMMARY/UNIVARIATE are all very similar in how they work and in a situation like yours pretty much interchangeable.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 16:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404877#M98428</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T16:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404949#M98457</link>
      <description>&lt;P&gt;Ok, I tried doing it with data step and arrays, but got stuck again. Here is my data step merge code, not sure how can I integrate array statement here to calculate mean, median differences and percent differences?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fish2_ (keep = name hg n elv sa z da rf fr hg_mean n_mean elv_mean sa_mean z_mean da_mean rf_mean fr_mean hg_median n_median elv_median sa_median z_median da_median rf_median fr_median) ;
 merge fish (in = x) statz2 (in = y);
 by lt dam;
 if x = 1;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404949#M98457</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T19:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404952#M98460</link>
      <description>&lt;P&gt;Yes, thanks&amp;nbsp;you are right. I used the nway option and got the same results. Im still trying to understand though what it means. Doing some reading, but still not clear.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404952#M98460</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T19:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404957#M98464</link>
      <description>&lt;P&gt;The documentation is pretty clear.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;H5 class="xis-option"&gt;&lt;A class="ng-scope" tabindex="0" href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n1qnc9bddfvhzqn105kqitnf29cp.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n10z5tfgi3j0h9n19pq7bbgn9tve" rel="nofollow" data-docset-id="proc" data-docset-version="9.4" data-original-href="#n10z5tfgi3j0h9n19pq7bbgn9tve"&gt;NWAY&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescription"&gt;limits the output statistics to the observations with the highest _TYPE_ value.&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="xis-shortDescription"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;_TYPE_ is defined when you use CLASS statements. You can also control the levels reported using the WAYS and TYPES statements.&amp;nbsp;&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;I suggest searching PROC MEANS on the LexJansen website and see what it's capable of, its a really powerful procedure.&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=n1qnc9bddfvhzqn105kqitnf29cp.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=n1qnc9bddfvhzqn105kqitnf29cp.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/404957#M98464</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T19:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405017#M98488</link>
      <description>&lt;P&gt;Ok, so it seems I have nailed the first two steps using proc means and data step merge, but the last step using arrays im still not getting it. Here is my complete code-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc means data = fish missing nway noprint ;
class lt/missing; class dam/missing;
var hg n elv sa z da rf fr ;
output out = statz2 mean = median = /autoname;
run;

data fish2_ (keep = name hg n elv sa z da rf fr hg_mean n_mean elv_mean sa_mean z_mean da_mean rf_mean fr_mean hg_median n_median elv_median sa_median z_median da_median rf_median fr_median) ;
 merge fish (in = x) statz2 (in = y);
 by lt dam;
 if x = 1;
  run;

*using arrays to calculate mean difference only;
  data fish_f;
set fish2_;
array all{*} hg n elv sa z da rf fr;
array all_mean{*} hg_mean n_mean elv_mean sa_mean z_mean da_mean rf_mean fr_mean ;
do i=1 to dim(all);
diff[i]= all_mean{i} - all{i};
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please note that I only want to use data step and arrays to solve this problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405017#M98488</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-17T20:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405021#M98489</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;diff&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Where did you define a DIFF array. I'm sure your log has errors....read the log. ALWAYS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 21:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405021#M98489</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-17T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405077#M98499</link>
      <description>&lt;P&gt;Yes, that was a mistake. But I defined it now and still get errors-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fish_f;
set fish2_;
array all{*} hg n elv sa z da rf fr;
array all_mean{*} hg_mean n_mean elv_mean sa_mean z_mean da_mean rf_mean fr_mean ;
array diff{*} diff_all_mean-diff_all;
do i=1 to dim(all);
diff[i]= all_mean{i} - all{i};
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 01:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405077#M98499</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-18T01:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405080#M98500</link>
      <description>Posting the log would be really helpful.</description>
      <pubDate>Wed, 18 Oct 2017 01:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405080#M98500</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-10-18T01:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405081#M98501</link>
      <description>&lt;PRE&gt;319  array diff{*} diff_all_mean-diff_all;
ERROR: Missing numeric suffix on a numbered variable list (diff_all_mean-diff_all).
WARNING: Defining an array with zero elements.
320  do i=1 to dim(all);
&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 01:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405081#M98501</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-18T01:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405082#M98502</link>
      <description>Read the documentation of array statement, it explains how to define an array. If you want a list of variables to be mapped by an array, you have to list every variable if they don't have the same prefix and end with a number.</description>
      <pubDate>Wed, 18 Oct 2017 02:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405082#M98502</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-10-18T02:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405087#M98505</link>
      <description>&lt;P&gt;I did read it and tried to follow that, and this is what I have come up so far. I appreciate your response, but its not really helpful. Its only when&amp;nbsp;I hit the wall after trying all methods, I come here as I understand everyone's time is precious.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 02:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405087#M98505</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-18T02:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405098#M98510</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43025"&gt;@error_prone&lt;/a&gt;&amp;nbsp;mentioned you need to list all the variables for an array.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use variable lists, but your definition isn’t a valid variable list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the variable list requirements here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0wphcpsfgx6o7n1sjtqzizp1n39.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0wphcpsfgx6o7n1sjtqzizp1n39.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 04:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405098#M98510</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-18T04:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405272#M98572</link>
      <description>&lt;P&gt;I believe in this case there is no clean way to define them in arrays since variable names are so different and if I have to write 8 statements to define each difference, what's the point of arrays here. Sorry its beyond me.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405272#M98572</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-18T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means summary statistics, join etc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405355#M98604</link>
      <description>&lt;P&gt;Ok, so I finally got it, though im not sure this is the most efficient way as there is so much typing still involved.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  data test;
set fish2_;
array all{*} hg n elv sa z da rf fr;
array all_mean{*} hg_mean n_mean elv_mean sa_mean z_mean da_mean rf_mean fr_mean ;
array all_median{*} hg_median n_median elv_median sa_median z_median da_median rf_median fr_median ;
array diff{*} hg_diff n_diff elv_diff sa_diff z_diff da_diff rf_diff fr_diff  ;
array diffM{*} hg_diff_me n_diff_me elv_diff_me sa_diff_me z_diff_me da_diff_me rf_diff_me fr_diff_me ;
do i=1 to dim(all);
diff[i]= all_mean{i} - all{i};
diffM[i]= all_median{i} - all{i};
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 21:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-summary-statistics-join-etc/m-p/405355#M98604</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-10-18T21:01:19Z</dc:date>
    </item>
  </channel>
</rss>

