<?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 TRIM the distribution of a variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535602#M147099</link>
    <description>&lt;P&gt;Thanks for the links!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Feb 2019 14:37:59 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-02-14T14:37:59Z</dc:date>
    <item>
      <title>How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535551#M147081</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS Studio.&lt;/P&gt;&lt;P&gt;I have some weights to use in a regression model and I don't know how to trim the distribution of the weights at the 1st and 99th percentile.&lt;/P&gt;&lt;P&gt;The weight variable is already a column in the dataset but I really have no clue how to trim the distribution.&lt;/P&gt;&lt;P&gt;Does anyone have any idea how to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 11:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535551#M147081</guid>
      <dc:creator>saramanzella</dc:creator>
      <dc:date>2019-02-14T11:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535552#M147082</link>
      <description>&lt;P&gt;What are these weights? Why do you want to trim them? What do you mean by "trim"?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 11:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535552#M147082</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T11:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535556#M147085</link>
      <description>&lt;P&gt;I'm doing mediation analysis with time varying exposure and mediator.&lt;/P&gt;&lt;P&gt;I use the weights to do inverse probability of treatment weighting and avoid the effect of confounding in the estimates of the coefficients of the models that I use to obtain direct and indirect effects.&lt;/P&gt;&lt;P&gt;If the history of exposure and mediator are not very probable the weights can become very big. For this reason and to obtain more stable estimators, many suggest to use as a standard procedure the trimming of the distribution of the weights at the 1st and 99th.&lt;/P&gt;&lt;P&gt;The only problem is that I don't know how to do that in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 11:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535556#M147085</guid>
      <dc:creator>saramanzella</dc:creator>
      <dc:date>2019-02-14T11:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535572#M147088</link>
      <description>&lt;P&gt;So, please clarify&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have weights on the variables? Or do you have weights on the observations?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you show us a portion of the dataset so we can see the weights, the X-variables and the Y-variables?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 13:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535572#M147088</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T13:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535587#M147093</link>
      <description>&lt;P&gt;In the picture there's a part of the dataset. I have weights on the observations.&lt;/P&gt;&lt;P&gt;One of the two models is benessere = ses + fisico and each observation has a different weight.&lt;/P&gt;&lt;P&gt;It's a model in which the wellbeing is regressed on the socio economic status and the physical health.&lt;/P&gt;&lt;P&gt;The weights are obtained as a ratio of probabilities so that we can take into account the effect of different confounders such as sex, ethnicity, marital status, ... .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2019-02-14 at 14.45.46.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27147iEA42388CEDD747D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2019-02-14 at 14.45.46.png" alt="Screenshot 2019-02-14 at 14.45.46.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 13:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535587#M147093</guid>
      <dc:creator>saramanzella</dc:creator>
      <dc:date>2019-02-14T13:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535593#M147095</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
    var weight;
    output out=_stats_ p1=p1 p99=p99;
run;

data want;
     if _n_=1 then set _stats_;
     set have;
     if weight&amp;lt;p1 then weight=p1;
     if weight&amp;gt;p99 then weight=p99;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have never heard of a method that uses weights to reduce the effect of confounders in a regression model. Can you explain this further, or give me a link where I can read about it?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 14:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535593#M147095</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T14:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535600#M147097</link>
      <description>&lt;P&gt;The basic idea comes from propensity score matching techniques and inverse probability of treatment weighting. I think that they're really well explained in this paper: &lt;A href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3144483/" target="_blank" rel="noopener"&gt;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3144483/&lt;/A&gt;&lt;BR /&gt;To study this method I also used: &lt;A href="http://www.stat.cmu.edu/~ryantibs/journalclub/rosenbaum_1983.pdf" target="_blank" rel="noopener"&gt;http://www.stat.cmu.edu/~ryantibs/journalclub/rosenbaum_1983.pdf&lt;/A&gt;&lt;BR /&gt;Those two can give you a basic idea of the methods to take into account confounding without stratifying.&lt;BR /&gt;The thing I'm doing it's a little bit more complicated because it involves mediation analysis but if you're interested in that I suggest you read some of VanderWeele papers or the book he published in 2015 which is called "Explanation in Causal Inference - Methods for Mediation and Interaction".&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the help!&lt;BR /&gt;Sara&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 14:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535600#M147097</guid>
      <dc:creator>saramanzella</dc:creator>
      <dc:date>2019-02-14T14:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to TRIM the distribution of a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535602#M147099</link>
      <description>&lt;P&gt;Thanks for the links!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 14:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-TRIM-the-distribution-of-a-variable/m-p/535602#M147099</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T14:37:59Z</dc:date>
    </item>
  </channel>
</rss>

