<?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: Standardizing a variable and specifying a minimum and maximum in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502524#M25871</link>
    <description>&lt;P&gt;PROC &lt;STRONG&gt;STDIZE &lt;/STRONG&gt;may have a method that will suite you.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 21:03:32 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2018-10-08T21:03:32Z</dc:date>
    <item>
      <title>Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502514#M25869</link>
      <description>&lt;P&gt;I have some data that I'd like to standardize but can i also set a minimum and/or maximum value? Let's say in my example below that i wanted the minimum to be at least 0.25, is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc standard data =sashelp.Baseball out=Baseball_Normalized 
mean=0 std=1;
	var CrAtBat;
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, 08 Oct 2018 20:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502514#M25869</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2018-10-08T20:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502524#M25871</link>
      <description>&lt;P&gt;PROC &lt;STRONG&gt;STDIZE &lt;/STRONG&gt;may have a method that will suite you.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 21:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502524#M25871</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-08T21:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502540#M25873</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have some data that I'd like to standardize but can i also set a minimum and/or maximum value? Let's say in my example below that i wanted the minimum to be at least 0.25, is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc standard data =sashelp.Baseball out=Baseball_Normalized 
mean=0 std=1;
	var CrAtBat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;While I think I understand the request when you want the MAXIMUM to be 0.25, and there is the MAXABS method of PROC STDIZE (which is a form of standardizing, but it might not have mean zero and would not have a variance of 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you specified you want the MINIMUM to be 0.25, and that doesn't make any mathematical sense to me. Minimum of what? Can you explain further, and even provide a small example?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 22:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502540#M25873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-08T22:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502684#M25882</link>
      <description>&lt;P&gt;I have survey weights that I need to transform such&amp;nbsp; that they sum to the number of observations and have a minimum of .25 and a maximum of 4 (if possible). Here is a small example of my dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;			
data Have;
	input HH_Weight 8.;
	datalines;
213
2161
973
1870
1335
2087
2002
312
2076
2226
484
669
1190
972
711
1874
1773
2291
2213
1582
1584
1581
2182
2329
382
158
1567
183
1171
2485
12
1283
1008
1283
1631
1206
2399
871
1892
1475
876
1373
2357
285
971
229
545
1800
1137
1390
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Oct 2018 13:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502684#M25882</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2018-10-09T13:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502723#M25883</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have some data that I'd like to standardize but can i also set a minimum and/or maximum value? Let's say in my example below that i wanted the minimum to be at least 0.25, is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc standard data =sashelp.Baseball out=Baseball_Normalized 
mean=0 std=1;
	var CrAtBat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am wondering what you will do with the resulting values.&lt;/P&gt;
&lt;P&gt;Are you looking for a sampling probability?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 14:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502723#M25883</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-09T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502751#M25884</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have survey weights that I need to transform such&amp;nbsp; that they sum to the number of observations and have a minimum of .25 and a maximum of 4 (if possible). Here is a small example of my dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;			
data Have;
	input HH_Weight 8.;
	datalines;
213
2161
973
1870
1335
2087
2002
312
2076
2226
484
669
1190
972
711
1874
1773
2291
2213
1582
1584
1581
2182
2329
382
158
1567
183
1171
2485
12
1283
1008
1283
1631
1206
2399
871
1892
1475
876
1373
2357
285
971
229
545
1800
1137
1390
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay, this isn't really standardizing, is it? And I'm not sure you can get all of the conditions you specify to hold at the same time, min of 0.25, max of 4 and sum to the number of observations. Has this actually been done in other applications, getting all three of the conditions to hold at the same time, or is it something you have decided you need for this application?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The part where you want them to sum to the total number of observations is relatively easy. I am skeptical that you can then take the result and set the min to 0.25 and max to 4 and get the same sum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get them to sum to the number of observations, count the number of observatrions (let's call this N) and find the sum of all observations (let's call this SUM), and then each value would be multiplied by (N/SUM). After that, I don't see a path forward.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 15:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502751#M25884</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-09T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Standardizing a variable and specifying a minimum and maximum</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502879#M25889</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no &lt;EM&gt;linear&lt;/EM&gt; transformation that satisfies all three conditions. So, if the condition "transformed values&amp;nbsp;&lt;SPAN&gt;sum to the number of observations" is mandatory, you can obtain &lt;EM&gt;either&lt;/EM&gt; a minimum of .25&amp;nbsp;&lt;EM&gt;or&lt;/EM&gt; a maximum of 4:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trans1;
set have;
a=0.75/1321.18;
b=1-1333.18*a;
HH_Weight_t=a*HH_Weight+b;
run;

proc means data=trans1 sum min max;
var HH_Weight_t;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;         Sum         Minimum         Maximum
--------------------------------------------
  50.0000000       0.2500000       &lt;FONT color="#FF0000"&gt;1.6538587&lt;/FONT&gt;
--------------------------------------------
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Same with&amp;nbsp;a=3/1151.82 (and again b=1-1333.18*a):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;         Sum         Minimum         Maximum
--------------------------------------------
  50.0000000      &lt;FONT color="#FF0000"&gt;-2.4411106&lt;/FONT&gt;       4.0000000
--------------------------------------------&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Or a compromise between these two (using least squares)? (a=0.0014472809)&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;         Sum         Minimum         Maximum
--------------------------------------------
  50.0000000      &lt;FONT color="#FF9900"&gt;-0.9121186&lt;/FONT&gt;       &lt;FONT color="#FF9900"&gt;2.6670071&lt;/FONT&gt;
--------------------------------------------&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, there are &lt;EM&gt;non-linear&lt;/EM&gt; transformations&amp;nbsp;which&amp;nbsp;satisfy all three conditions. Would this make sense? Unfortunately, there is no&amp;nbsp;suitable&amp;nbsp;&lt;EM&gt;quadratic&lt;/EM&gt; transformation (t(x)=ax²+bx+c) -- in spite of three free parameters. Reason: It would not be &lt;EM&gt;monotone&lt;/EM&gt;, hence there would be no&amp;nbsp;unique&amp;nbsp;inverse transformation!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But how about an &lt;EM&gt;exponential&lt;/EM&gt; transformation (t(x)=a exp(bx)+c), which is of course monotone?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trans;
retain a 0.01556848794537
       b 2.20865846733238e-3
       c 0.2340133696564;
set have;
HH_Weight_t=a*exp(b*HH_Weight)+c;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Result of PROC MEANS:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;         Sum         Minimum         Maximum
--------------------------------------------
  &lt;STRONG&gt;&lt;FONT color="#008000"&gt;50.0000000       0.2500000       4.0000000&lt;/FONT&gt;&lt;/STRONG&gt;
--------------------------------------------&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Oct 2018 20:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standardizing-a-variable-and-specifying-a-minimum-and-maximum/m-p/502879#M25889</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-09T20:04:42Z</dc:date>
    </item>
  </channel>
</rss>

