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.
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.