<?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: How to weight samples in a &amp;quot;skewed&amp;quot; way?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/919982#M362344</link>
    <description>&lt;P&gt;What rules do you have for "skewwing" the weights? As in how much?&lt;/P&gt;
&lt;P&gt;Lots of ways to do this, many may not make sense.&lt;/P&gt;
&lt;P&gt;Example dummy code:&lt;/P&gt;
&lt;PRE&gt;Proc sort data=have;
   by income;
run;

data reweight;
   set have nobs=sampsize;
   weight = _n_ / sampsize;
run;&lt;/PRE&gt;
&lt;P&gt;Will assign a smaller weight to the smaller incomes and the largest will have a weight of 1.&lt;/P&gt;
&lt;P&gt;Then use Proc Means/Summary or just about any analysis procedure that supports uses of weight variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So do you have any rule(s) about how much you want to skew these values?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 17:58:46 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-03-12T17:58:46Z</dc:date>
    <item>
      <title>How to weight samples in a "skewed" way?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/919956#M362331</link>
      <description>&lt;P&gt;Say I have a sample of 100 people, and have their annual income in last 20 years.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is OK to calculate the average annual income.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOW I like to calculate the "skewed" average income by year.&amp;nbsp; 1) to skew to the high-income side 2) to skew to the low-income side.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to put "meaningful" weights on samples?&amp;nbsp; "meaningful" just need a) skew to the desired side&amp;nbsp; and b) sum to 100%.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 15:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/919956#M362331</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2024-03-12T15:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to weight samples in a "skewed" way?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/919982#M362344</link>
      <description>&lt;P&gt;What rules do you have for "skewwing" the weights? As in how much?&lt;/P&gt;
&lt;P&gt;Lots of ways to do this, many may not make sense.&lt;/P&gt;
&lt;P&gt;Example dummy code:&lt;/P&gt;
&lt;PRE&gt;Proc sort data=have;
   by income;
run;

data reweight;
   set have nobs=sampsize;
   weight = _n_ / sampsize;
run;&lt;/PRE&gt;
&lt;P&gt;Will assign a smaller weight to the smaller incomes and the largest will have a weight of 1.&lt;/P&gt;
&lt;P&gt;Then use Proc Means/Summary or just about any analysis procedure that supports uses of weight variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So do you have any rule(s) about how much you want to skew these values?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 17:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/919982#M362344</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-12T17:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to weight samples in a "skewed" way?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/920003#M362357</link>
      <description>&lt;P&gt;This makes sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In term of how much, that is up to play to find the opt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better off without sorting/indexing/averaging.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, how to do if the values can be negative or positive, say a normal t-distribution randoms, the average is non-zero and unknow.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need skew to left(low-end), without sorting/indexing, how to put weight(just on the value itself) ?!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 19:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/920003#M362357</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2024-03-12T19:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to weight samples in a "skewed" way?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/920013#M362361</link>
      <description>&lt;P&gt;Not seeing much in the way of any rules to use. How much to skew&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which values have to be negative or positive? The input or the output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some information you may want peruse:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings16/7660-2016.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings16/7660-2016.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2022/09/21/noncentral-t.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2022/09/21/noncentral-t.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Skew-Normal-Distributions/td-p/145628" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Skew-Normal-Distributions/td-p/145628&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW setting restriction of not sorting or averaging data is may quite well be impractical to impossible depending on a specific task.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 20:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-weight-samples-in-a-quot-skewed-quot-way/m-p/920013#M362361</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-12T20:12:02Z</dc:date>
    </item>
  </channel>
</rss>

