Hi, I am running a Cox proportional hazard model evaluating the association of a binary predictor x on outcome Y. My objective is to apply varying sensitivity/specificity definitions of x to account for potential misclassification. To do this, I would like to randomly select a pre-specified sample size from the population and change their value for x. I would like to obtain a hazard ratio in this hypothetical population. I would then like to repeat this process several hundred/thousand times to obtain an average. Below is the code that will accomplish this task once. I need help with a macro to have this process repeated several hundred/thousand times and obtain an average from those simulations. Any help is very much appreciated! data new; set data_original; x_new=x; ran=ranuni(); /* random number between 0 and 1 */ if ran<=0.1 and x=0 then x_new=1; /* if random number <= 0.1 (misclassification probability) and original x. = no, then new x. = yes */ run; proc phreg data = new …. …. …. run;
... View more