Recently in the SAS Community Library: SAS' @AndyRavenna publishes the second of two posts that uses statistics and machine-learning objects in SAS Visual Analytics to address real-world business problems.
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;
... View more
Hello, In SAS Studio, I had saved code in a SAS program. I had saved it, logged in and out a couple of times and it was still there. The last time I logged in, the file became empty. Please is there a way to recover the code? Thank you, Hiya
... View more
I ran a logistic regression model with only one independent variable. The c statistic was .5 which means that the model is no better than random chance. When I looked at the cross tabulation between the dependent and independent variable and ran a chi-square i got an x2 value of 931 with my chi squared value 3.84. It showed to be significant. The odds ratio was 2.83. My question is that if it is significant then why does the model report .5 which seems like it would be only on chance. Is the model not appropriate for that specific independent variable since it shows only .5 for the c-statistic or is the c-statistic not that important? There are 61000 rows of data. I have 10 variables that I'm looking at but have run them all in the regression analysis and have also looked at them independently to see if there are effects when others are added. Which there is. Odds ratios change minorly when other varaialbes are added. All independent variables are binary.
... View more
First, let me say that I'm a fan of the Reddit community. I've used it to learn tricks about all types of topics, including home improvement and video game secrets. I've also answered SAS questions in some subreddits. However, over the past several months we've seen many old Reddit topics that are copy/pasted into new threads here on the SAS Community.
This isn't Reddit's fault and has nothing to do with the original authors of the topics. Instead, it's an approach by spammers to create what seems like a legitimate topic on the forums, get some credibility for their profile, and then follow it up with other replies that link to unrelated commercial sites.
The trick they use is to select some of the more provocative topics on Reddit, like "why is SAS so difficult" or "Should I learn SAS instead of Python, what do you guys think." We have no objection to authentic questions like these from community members, but we do not allow this inauthentic approach to generating engagement for misleading commercial purposes.
Ours is not the only community that experiences this. Many of our industry peers who manage other communities are reporting that they see the same thing on their forums.
When we spot cases like these we take action. We mark the topic as Spam (to remove it from view) and then we ban the user account that posted it. How can we tell the content came from Reddit? There is a trick you can use with Google search: copy a unique phrase from the post and paste it into a Google search field in quotation marks to find the exact phrase in other internet sites.
In a recent example, a thread contained the phrase "SAS seems astonishingly unintuitive and overly rigid". A search for this exact phrase yielded a single result: a Reddit thread from 2019. That's all I needed to confirm that this was not an authentic post for our community, but an effort to leverage the popularity of our site for an unrelated purpose.
If you see a community post that seems provocative like this, think twice before you respond. Many community members are quick to jump in and advocate for SAS and encourage the original poster to stick with it and learn more...but we'd hate for you to invest time in a reply that gets deleted because the topic was not genuine.
If you see/suspect spam topics like these, use the Report Inappropriate Content menu item on the message to let us know. We can investigate and then take action as needed.
As always, thank you for your advocacy and for helping fellow SAS users on the community!
... View more
Hello ,
How could i find dependency/importance/weightage between Dependent variables in SAS?
Example:
Var1 Var2 Result
1 2 5
3 2 7
in the above example weigtage of var2 is higher because the formala is result=var1+2var2
Thanks,
Mushy
... View more