<?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: Applying Inverse Probability Weights to  a Covariate (Not Primary Predictor) in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Applying-Inverse-Probability-Weights-to-a-Covariate-Not-Primary/m-p/852411#M2674</link>
    <description>&lt;P&gt;With the model that you have outlined that standard approach would be to apply the propensity weight as a WEIGHT variable in SAS.&amp;nbsp; May would also argue that you could use either (1) the predicted probability from the initial Logistic model, or (2) the predictors in the initial Logistic&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;agevisit1 gender edu drink&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as additional predictors in the final logistic to make it "doubly robust."&amp;nbsp; &amp;nbsp;On the simple face of it -- without really knowing enough about your work -- this would be my recommendation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 22:43:21 GMT</pubDate>
    <dc:creator>djmangen</dc:creator>
    <dc:date>2023-01-05T22:43:21Z</dc:date>
    <item>
      <title>Applying Inverse Probability Weights to  a Covariate (Not Primary Predictor)</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Applying-Inverse-Probability-Weights-to-a-Covariate-Not-Primary/m-p/852171#M2671</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I created an propensity score and subsequently inverse probability weights for the variable "Autopsy", which indicates whether study participants underwent an autopsy or not. My primary predictor is cataracts (yes/no), and my outcome is amyloid resistant (yes/no).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering if I needed to include the variable Autopsy in my model when I anaylzed catarcts in relation to amyloid resistance, or if I just needed to include the weights. Thank you very much in advance!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Create dataset with probability score;
proc logistic data=aut_path;
class gender edu drink;
model autopsy (event='1')= agevisit1 gender edu drink;
output out=outps(drop =_level_) prob=ps xbeta=xbeta;
run;

data lw_ps;
set outps;
if autopsy=1 then treated_ps=ps; else treated_ps=.;
if autopsy=0 then untreated_ps=ps; else untreated_ps=.;
run;

*Calculate mean propensity score;
proc means data=outps N MIN Q1 MEDIAN MEAN Q3 MAX STD;
class autopsy;
var ps;
output out=ps_mean mean=marg_prob;
run;

data _null_;
set ps_mean;
call symput ('marg_prob',marg_prob);
run;

*Create inverse probability weight and stabalized weight;
data res_analysis;
set outps;
if autopsy=1 then iptw=1/ps; else if autopsy=0 then iptw=1/(1-ps);

if autopsy=1 then siptw=&amp;amp;marg_prob/ps;
else if autopsy=0 then siptw=(1-&amp;amp;marg_prob)/(1-ps);

label ps='Propensity Score'
	  iptw = "Inverse Probability of Treatment Weight"
 	  siptw = "Stabilized Inverse Probability of Treatment Weight";
run;

*Include people with autopsy only;
data aut;
set res_analysis;
if autopsy=1;
run;

proc logistic data=aut;
id id;
weight iptw;
class cataract (ref='0')  ;
model amyloid (event='1')= cataract ;
oddsratio cataract;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2023 18:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Applying-Inverse-Probability-Weights-to-a-Covariate-Not-Primary/m-p/852171#M2671</guid>
      <dc:creator>zaldarsa</dc:creator>
      <dc:date>2023-01-04T18:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Inverse Probability Weights to  a Covariate (Not Primary Predictor)</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Applying-Inverse-Probability-Weights-to-a-Covariate-Not-Primary/m-p/852411#M2674</link>
      <description>&lt;P&gt;With the model that you have outlined that standard approach would be to apply the propensity weight as a WEIGHT variable in SAS.&amp;nbsp; May would also argue that you could use either (1) the predicted probability from the initial Logistic model, or (2) the predictors in the initial Logistic&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;agevisit1 gender edu drink&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as additional predictors in the final logistic to make it "doubly robust."&amp;nbsp; &amp;nbsp;On the simple face of it -- without really knowing enough about your work -- this would be my recommendation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 22:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Applying-Inverse-Probability-Weights-to-a-Covariate-Not-Primary/m-p/852411#M2674</guid>
      <dc:creator>djmangen</dc:creator>
      <dc:date>2023-01-05T22:43:21Z</dc:date>
    </item>
  </channel>
</rss>

