BookmarkSubscribeRSS Feed
ffgsdf
Obsidian | Level 7

I have a question that it has been proposed that if a treatment causing a censoring, and if there is an unmeasured confounder associated with censoring, as well as the outcome variables.

 

In this case, the censoring becomes a collider, and when we analyze data with only observed participants will cause a selection bias.

 

I provide a figure to show this selection bias.

 

圖片1.png

 

It has been proposed that Inverse probability censoring weighting can be used to create a pseudo population which have all population, I use it to remove the relationship between treatment and censoring. Then based on this idea, because no relationship between treatment and censoring, no selection bias will occur. However, in my results, it still has biased results.

 

Please help me to address this issue and provide me code to obtain a unbiased result.

 

 


data t;
  call streaminit(123);
  do i = 1 to 1000000;
    /* Simulating x with probability p_x */
    p_x = 1/3;
    x = rand("bernoulli", p_x);
    
    /* Simulating u with probability p_u */
    p_u = 1/2;
    u = rand("bernoulli", p_u);

    /* Calculating the linear predictor for c from x and u */
    model_c = 0 + x * 0.811 - 0.5 * u;
    /* Logistic transformation to get probability p_c */
    p_c = exp(model_c) / (1 + exp(model_c));
    /* Simulating c using the calculated probability p_c */
    c = rand("bernoulli", p_c);
    /* Calculating the linear predictor for y from u */
	y = rand ("normal",100,15)+ u * 10;
    output;
  end;
run;

/*correct result no associaiton between x an y*/
/* Unconditional logistic regression of y on x */
proc reg data=t;
  model y = x;
run;

/*bias results*/
/* logistic regression of y on x, conditioned on c=0, a associaiton between x an y */
proc reg data=t;
where c = 0;
  model y = x;
run;

/*IPW for censoring*/
proc psmatch data=t; 
class c;
psmodel c  = x;
output out=z 
atewgt = w_c;
run; 

/*still a unbiased result, a associaiton between x an y */
proc reg data=z;
where c = 1;
model y =x;
weight w_c;
run;

/*pseudo population with all observations with weight*/
proc means sum data=z;
where c = 1;
var w_c;
run;

 

1 REPLY 1
ffgsdf
Obsidian | Level 7
I found that this path cannot be sloved by IPW

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 451 views
  • 0 likes
  • 1 in conversation