<?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 do I calculate stabilized inverse probability weights for a cohort study? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-stabilized-inverse-probability-weights-for-a/m-p/668354#M31916</link>
    <description>&lt;P&gt;I've never done anything like this, so take what I suggest with a swimming pool of salt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you just scale your SW after calculating the mean?&amp;nbsp; For instance if you get a mean of 1.4, divide all the stabilized weights you have calculated by 1.4 and then rerun.&amp;nbsp; The other possibility here is there may be a missing factor.&amp;nbsp; Whenever I see 1.4, I immediately think of two possibilities - square root of 2 (the remainder is lost to round off) or square root of the normal variate for .975 (=1.96).&amp;nbsp; If either of those is a possibility, check your sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 12:50:21 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-07-10T12:50:21Z</dc:date>
    <item>
      <title>How do I calculate stabilized inverse probability weights for a cohort study?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-stabilized-inverse-probability-weights-for-a/m-p/668295#M31910</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate inverse probability weights for loss-to-followup in my cohort study. From what I've read, my stabilized weights should have a mean of 1 and the sum of the unstabilized weights should be double the sum of the stabilized weights, however, the average of my stabilized weights is 1.4. I tried two methods below (with the tables ipw22 and ipw44) I am not sure where the error in my code could be, it would be greatly appreciated if someone could help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I had some missing data with the covariates, so I imputed with the mean or mode) so as not to lose too many subjects in the logistic regression.&lt;/P&gt;&lt;P&gt;**I am not sure which version of SAS I am on because I use SAS through EMACS, but I think it is 9.3**&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Part1: Estimate conditional probabilities for denominator using pooled logistic regression*/&lt;BR /&gt;proc logistic data=tables.ipw;&lt;BR /&gt;class &amp;lt;covariates&amp;gt;;&lt;BR /&gt;model dropout= &amp;lt;covariates&amp;gt;/lackfit;&lt;BR /&gt;output out=d_data (keep=n_ident d) p=d; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Part2: Calculate cumulative probabilities for stabilized weights (sw)*/&lt;BR /&gt;proc sort data=tables.ipw; by n_ident; run;&lt;BR /&gt;proc sort data=n_data; by n_ident; run;&lt;BR /&gt;proc sort data=d_data; by n_ident; run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;data ipw22;&lt;BR /&gt;merge tables.ipwsimple n_data d_data;&lt;BR /&gt;by n_ident;&lt;BR /&gt;if dropout=1 then do;&lt;BR /&gt;uw=1/d; /*unstabilized weight*/&lt;BR /&gt;sw=n/d; /*stabilized weight*/&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;else if dropout=0 then do;&lt;BR /&gt;uw=1/(1-d); /*unstabilized weight*/&lt;BR /&gt;sw=(1-n)/(1-d); /*stabilized weight*/&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ipw44;&lt;BR /&gt;merge tables.ipw n_data d_data;&lt;BR /&gt;by n_ident;&lt;BR /&gt;if dropout=1 then do;&lt;BR /&gt;uw=1/d; /*unstabilized weight*/&lt;BR /&gt;sw=(1195/2002)/d; /*(eligible population/total population) stabilized weight*/&lt;BR /&gt;end;&lt;BR /&gt;else if dropout=0 then do;&lt;BR /&gt;uw=1/(1-d);&lt;BR /&gt;sw=(1-(1195/2002))/(1-d);&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;predict=log(d/(1-d))*log(d/(1-d)); run; /*Create term to check verifications after*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*----------------------------------------------------&lt;BR /&gt;*Assess distribution of SW&lt;BR /&gt;*Mean should be=1&lt;BR /&gt;*UW range should be greater than SW range&lt;BR /&gt;*UW sum should be twice the sum of SW sum&lt;BR /&gt;*----------------------------------------------------;&lt;/P&gt;&lt;P&gt;proc means data=ipw22 mean sum min max; var uw sw; run;&lt;BR /&gt;proc means data=ipw44 mean sum min max; var sw uw; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 08:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-stabilized-inverse-probability-weights-for-a/m-p/668295#M31910</guid>
      <dc:creator>courtney889</dc:creator>
      <dc:date>2020-07-10T08:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate stabilized inverse probability weights for a cohort study?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-stabilized-inverse-probability-weights-for-a/m-p/668354#M31916</link>
      <description>&lt;P&gt;I've never done anything like this, so take what I suggest with a swimming pool of salt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you just scale your SW after calculating the mean?&amp;nbsp; For instance if you get a mean of 1.4, divide all the stabilized weights you have calculated by 1.4 and then rerun.&amp;nbsp; The other possibility here is there may be a missing factor.&amp;nbsp; Whenever I see 1.4, I immediately think of two possibilities - square root of 2 (the remainder is lost to round off) or square root of the normal variate for .975 (=1.96).&amp;nbsp; If either of those is a possibility, check your sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-stabilized-inverse-probability-weights-for-a/m-p/668354#M31916</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-10T12:50:21Z</dc:date>
    </item>
  </channel>
</rss>

