Hello,
I am attempting to use the results of two count if functions in one calculation by storing the result of the first in a local macro. Here is an example of what I am attempting to do:
However, when I run the second count if, it replaces the value stored in the macro tot_date with the new value of r(N). How can I save the first value of r(N) into a macro in a way that it will not be overwritten when I run count if for a second time? Or is there a better method than using macros to save the results of the first count if?
I am attempting to use the results of two count if functions in one calculation by storing the result of the first in a local macro. Here is an example of what I am attempting to do:
Code:
count if PROCEDURE_DATE <18993 local tot_date "`r(N)'" count if PROCEDURE_DATE <18993 & DOSE2==. display "Time Range: " %td 18638 " - " %td 18993 display "% missing dose info: " (r(N)/`tot_date')*100 "%"
Comment