<?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: Recoding to Center Variable Referencing Variable Mean in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114013#M31552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Astounding is referring to PROC STDIZE to accomplish this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another method, but still more manual is using proc sql&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table new_data as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *, weight-avg(weight) as centered_weight_by_sex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by sex;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2012 18:09:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-05-14T18:09:53Z</dc:date>
    <item>
      <title>Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114011#M31550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many times, I create a new variable that transposes the responses of a variable to 'center' them. The only way that I know to do this so far, i need to run a proc univariate for the mean of the value then, in the data step, create the centered variable by referencing the output of the proc univariate. This seems like a lot of work that is not easily transferable between projects, or if the values of a mean change due to re-framing my sample. Additionally, I can only reference the mean to as many digits as SAS reports in the output.&amp;nbsp; Is there an easier way, perhaps by having a code that directly references the mean value of the responses to a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of the code that I currently use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate; var &lt;SPAN style="text-decoration: underline;"&gt;INCOME&lt;/SPAN&gt;; run;&lt;/P&gt;&lt;P&gt;data &lt;SPAN style="text-decoration: underline;"&gt;NEWSET&lt;/SPAN&gt;; set &lt;SPAN style="text-decoration: underline;"&gt;OLDSET&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;centeredINCOME&lt;/SPAN&gt;=&lt;SPAN style="text-decoration: underline;"&gt;INCOME &lt;/SPAN&gt;- 1.58762368; (this number I reference from the output of proc univariate)&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 16:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114011#M31550</guid>
      <dc:creator>jtambure</dc:creator>
      <dc:date>2012-05-14T16:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114012#M31551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would PROC STANDARD be the right tool for the job?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 17:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114012#M31551</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-14T17:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114013#M31552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Astounding is referring to PROC STDIZE to accomplish this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another method, but still more manual is using proc sql&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table new_data as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *, weight-avg(weight) as centered_weight_by_sex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by sex;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 18:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114013#M31552</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-05-14T18:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114014#M31553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with the stdize procedure. Would this simply transpose the values so that the distribution is centered at a value of zero, or would it redistribute the variables to a regular distribution? I am looking simply to do the first, but not the second.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 17:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114014#M31553</guid>
      <dc:creator>jtambure</dc:creator>
      <dc:date>2012-05-16T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114015#M31554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;jtambure,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really meant PROC STANDARD.&amp;nbsp; Take a look at the online documentation.&amp;nbsp; I'm not a statistician, but I would guess this does what you want.&amp;nbsp; If you specify MEAN=0, and omit the STD= option it uses the standard deviation of the incoming variable.&amp;nbsp; But I really don't know if that means you get exactly what you are looking for.&amp;nbsp; You could always test it out and see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 18:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114015#M31554</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-16T18:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114016#M31555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This does the same thing as my method, but it's no more easy and it requires me to create a new dataset in the process as well. Still, thanks. I'm sure that this might be useful, especially when I need to do this to more than one variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 18:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114016#M31555</guid>
      <dc:creator>jtambure</dc:creator>
      <dc:date>2012-05-16T18:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding to Center Variable Referencing Variable Mean</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114017#M31556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's also useful if you haven't already run a PROC UNIVARIATE.&amp;nbsp; You don't need to know the means ahead of time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 18:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recoding-to-Center-Variable-Referencing-Variable-Mean/m-p/114017#M31556</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-16T18:19:43Z</dc:date>
    </item>
  </channel>
</rss>

