Hi all,
I am working on relative risk calculations for txgroup * placebo over 3 visits (week 7, 14, and 21). This problem I am having is for some reason, the direction of the rows is switching at week 14.
So say A is row 1, I is row 2; Difference is (Row 1 - Row 2) and computes normally.
This will change to I as row 1 and A as row 2 for week 14.
Resulting Difference is (Row 1 - Row 2) is backwards.
Is there a trick to holding the row positioning constant? the column position is accurate so specifying column=1 does not change anything.
%macro fish1 (tx1, tx2, num, t);
proc sort data = cfrsdx; by avisitn descending avalc; run;
proc freq data = cfrsdx order=data;
by avisitn;
%if &t=0 %then %do;
where avisitn in (7 14 21) and tx in (&tx1, &tx2) & ittfl='Y' ;
%end;
%else %do;
where avisitn=(14) and tx in (&tx1, &tx2) & complfl = "Y";
%end;
table tx * avalc / chisq riskdiff (cl=newcombe) missing;
output out=pdata&num fisher riskdiff1;
ods output PdiffCLs=data#
run;
%mend fish1;
@ ballardw I just tried adding tx to end of my sort, and I think this did the trick!! Sorry, i will try to explain better next time. But thank you!!
Without data to see what is actually going on I suspect you are getting an interaction between the WHERE clauses and the order of TX within avisitn and avalc. I might try adding TX to the sort as well.
If you are going to mention the role of a variable in narrative please make sure that you reference which variable. I don't see a variable "placebo" in your code and have to guess that might be "avalc" mainly because tx is kind of like txgroup.
@ ballardw I just tried adding tx to end of my sort, and I think this did the trick!! Sorry, i will try to explain better next time. But thank you!!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.