<?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: Computing geometric mean by different cohorts in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683632#M32903</link>
    <description>&lt;P&gt;Try a two-step process.&amp;nbsp; First, log transform realprice1 in a DATA step (for illustration purposes, let's call it lnrealprice1).&amp;nbsp; Then feed it through PROC SURVEYMEANS just as you have the untransformed value.&amp;nbsp; Finally, using the output dataset, exponentiate the mean, SD, confidence bounds, etc.&amp;nbsp; Make sure that you include the sampling weights in the PROC SURVEYMEANS call, using either the WEIGHTS or REPWEIGHTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks go to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp; for the referral to Rick Wicklin's (&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;) blog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2020 12:24:49 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-09-14T12:24:49Z</dc:date>
    <item>
      <title>Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683618#M32896</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been computing mean and medians using the following statement.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data = Quantity_of_Properties_1 nway completetypes;
	;
	format class $class. year_filed year_filed. county_y $county_y.  child_filed $child_filed.;
	class class year_filed county_y  child_filed/mlf;
	var realprice1;
	output out = Table_0_fil (drop=_TYPE_ /*_freq_*/) 
	median= med_price mean=mean_price;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, I would like to compute the geometric mean, but I understand I can only do it through proc surveymeans. Is there anyway to get the same kind of output as above with proc surveymeans?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to the following but it does not work so any help would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYMEANS data=prices geomean;
	format class $class. year_filed year_filed. county_y $county_y.  child_filed $child_filed.;
	class class year_filed county_y  child_filed;
	var realprice1;
	ods output statistics=i;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 11:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683618#M32896</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-09-14T11:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683621#M32897</link>
      <description>&lt;P&gt;Have you read this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/10/02/geometric-mean-deviation-cv-sas.html" target="_self"&gt;Compute the geometric mean, geometric standard deviation, and geometric CV in SAS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 11:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683621#M32897</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-09-14T11:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683622#M32898</link>
      <description>&lt;P&gt;PROC UNIVARIATE also can also be used -- &lt;A href="https://blogs.sas.com/content/iml/2019/10/14/geometric-mean-in-sas.html" target="_self"&gt;see this article&lt;/A&gt;.&amp;nbsp; And &lt;A href="https://blogs.sas.com/content/iml/2019/10/02/geometric-mean-deviation-cv-sas.html" target="_self"&gt;the TTEST procedure&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 11:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683622#M32898</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-09-14T11:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683626#M32900</link>
      <description>&lt;P&gt;Thanks for this. It doesn't look like proc univariate can handle multi level formats though or am I incorrect on this?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 11:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683626#M32900</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-09-14T11:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683632#M32903</link>
      <description>&lt;P&gt;Try a two-step process.&amp;nbsp; First, log transform realprice1 in a DATA step (for illustration purposes, let's call it lnrealprice1).&amp;nbsp; Then feed it through PROC SURVEYMEANS just as you have the untransformed value.&amp;nbsp; Finally, using the output dataset, exponentiate the mean, SD, confidence bounds, etc.&amp;nbsp; Make sure that you include the sampling weights in the PROC SURVEYMEANS call, using either the WEIGHTS or REPWEIGHTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks go to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp; for the referral to Rick Wicklin's (&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;) blog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 12:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683632#M32903</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-09-14T12:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683641#M32907</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;It appears that surveymeans can't handle multilevel formats either. For instance, proc summary /mlf option works, but this doesn't appear to be the case with the other functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would I be correct in this assumption?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 12:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683641#M32907</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-09-14T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683670#M32917</link>
      <description>&lt;P&gt;You could also make a temporary dataset with a new variable equal to the log10(realprice1) or log(realprice1), followed by proc summary with the class statements you want, and adding the new variable to the var statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then take the output dataset&amp;nbsp; TABLE_0_FIL&amp;nbsp; produced by the proc summary, and get the antilog (either 10**x or exp(x)) of the mean of the new variable.&amp;nbsp; You will have the desired subgroup geometric means alongisde the other stats you requested.&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 14:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683670#M32917</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-14T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Computing geometric mean by different cohorts</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683726#M32926</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Steve,&lt;/P&gt;
&lt;P&gt;It appears that surveymeans can't handle multilevel formats either. For instance, proc summary /mlf option works, but this doesn't appear to be the case with the other functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would I be correct in this assumption?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You really should have defined in your initial question that the groups were defined by a &lt;STRONG&gt;multilabel&lt;/STRONG&gt; format, if that is what you mean by "multilevel". Most formats are "multilevel" unless you are mapping all values to a single one. The documentation for Multilabel has the procedures that support the feature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use SURVEYMEANS you would make additional DOMAIN variables for each level and use a DOMAIN statement such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;domain Level1&amp;nbsp; Level1*Level2; to get the combined mean of Level1 and Level2 plus an overall for each Level1 value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 17:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-geometric-mean-by-different-cohorts/m-p/683726#M32926</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-14T17:51:06Z</dc:date>
    </item>
  </channel>
</rss>

