From my log (again - Windows 10, SAS/STAT 14.1)
42 PROC FREQ data=counts; 43 44 WEIGHT count; 45 46 EXACT RELRISK RISKDIFF; 47 48 49 50 TABLE trt*response/riskdiff; 51 52 ods output RelRisk1ExactCL=relrisk; 53 54 ods output RiskDiffCol1=riskdiff; 55 56 RUN; NOTE: Writing HTML Body file: sashtml1.htm WARNING: Computing exact confidence limits for this problem may require much time and memory. Press the system interrupt key to terminate exact computations. NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables. NOTE: The data set WORK.RELRISK has 9 observations and 5 variables. NOTE: There were 4 observations read from the data set WORK.COUNTS. NOTE: PROCEDURE FREQ used (Total process time): real time 27.77 seconds cpu time 27.34 seconds
Again, under 30 seconds. At least the log gives a warning about time and memory. This may be a case where you don't have adequate memory set aside for the exact algorithm to enumerate possible outcomes with fixed marginal totals.
SteveDenham
This may be as simple as forgetting the semi-colon on your run; statement.
SteveDenham
I have a semi-colon on my run; statement.
Show us the full code of your PROC FREQ. Since the dataset has only 4 observations, please show us the data as well.
I don't know why it is taking so long. Your code runs PROC FREQ in under 5 seconds on my computer.
74 DATA COUNTS; input TRT RESPONSE COUNT; 75 cards; NOTE: The data set WORK.COUNTS has 4 observations and 3 variables. NOTE: Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit): real time 0.00 seconds cpu time 0.00 seconds 80 ; 81 82 ODS select none; 83 84 PROC FREQ ; 85 WEIGHT COUNT; 86 EXACT RELRISK RISKDIFF; 87 TABLE TRT*RESPONSE/riskdiff; 88 ods output RelRisk1ExactCL=relrisk; 89 ods output RiskDiffCol1=riskdiff; 90 RUN; NOTE: The default method for EXACT RELRISK is now METHOD=SCORE. To use the previous default method (in SAS/STAT 14.2 and earlier releases), you can specify EXACT RELRISK(METHOD=NOSCORE). NOTE: The default method for EXACT RISKDIFF is now METHOD=SCORE. To use the previous default method (in SAS/STAT 14.2 and earlier releases), you can specify EXACT RISKDIFF(METHOD=NOSCORE). NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables. NOTE: The data set WORK.RELRISK has 9 observations and 5 variables. NOTE: There were 4 observations read from the data set WORK.COUNTS. NOTE: Verwendet wurde: PROZEDUR FREQ - (Gesamtverarbeitungszeit): real time 3.64 seconds cpu time 3.61 seconds
University Edition on a 2015 MacBook Pro.
Here is my time on this one (Windows 10, SAS/STAT 14.1)
1 DATA COUNTS; input TRT RESPONSE COUNT; 2 cards; NOTE: The data set WORK.COUNTS has 4 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 7 ; 8 9 ODS select none; 10 11 PROC FREQ ; 12 WEIGHT COUNT; 13 EXACT RELRISK RISKDIFF; 14 TABLE TRT*RESPONSE/riskdiff; 15 ods output RelRisk1ExactCL=relrisk; NOTE: Writing HTML Body file: sashtml.htm 16 ods output RiskDiffCol1=riskdiff; 17 RUN; NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables. NOTE: The data set WORK.RELRISK has 9 observations and 5 variables. NOTE: There were 4 observations read from the data set WORK.COUNTS. NOTE: PROCEDURE FREQ used (Total process time): real time 0.98 seconds cpu time 0.70 seconds 18 19 ODS select all;
Less than a second in total real time. That is why I suspect what @ballardw came up with.
SteveDenham
Anki9my dataset:
trt response count
1 1 5
1 2 296
2 1 2
2 2 150
all 3 variables are format best12.
my procedure is below which is running forever:
ODS select none;
PROC FREQ data=counts;
WEIGHT count;
EXACT RELRISK RISKDIFF;
TABLE trt*response/riskdiff;
ods output RelRisk1ExactCL=relrisk;
ods output RiskDiffCol1=riskdiff;
RUN;
;
ODS select all;
So you are not just doing simple counts. You have asked for it to do exact statistical calculations.
You might want to share your data with SAS support and see if your particular data combination is confusing that algorithm and putting into some type of infinite loop.
From my log (again - Windows 10, SAS/STAT 14.1)
42 PROC FREQ data=counts; 43 44 WEIGHT count; 45 46 EXACT RELRISK RISKDIFF; 47 48 49 50 TABLE trt*response/riskdiff; 51 52 ods output RelRisk1ExactCL=relrisk; 53 54 ods output RiskDiffCol1=riskdiff; 55 56 RUN; NOTE: Writing HTML Body file: sashtml1.htm WARNING: Computing exact confidence limits for this problem may require much time and memory. Press the system interrupt key to terminate exact computations. NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables. NOTE: The data set WORK.RELRISK has 9 observations and 5 variables. NOTE: There were 4 observations read from the data set WORK.COUNTS. NOTE: PROCEDURE FREQ used (Total process time): real time 27.77 seconds cpu time 27.34 seconds
Again, under 30 seconds. At least the log gives a warning about time and memory. This may be a case where you don't have adequate memory set aside for the exact algorithm to enumerate possible outcomes with fixed marginal totals.
SteveDenham
Or, you don't even have a RUN; statement, this would cause the appearance of "running forever".
@PaigeMiller wrote:
Or, you don't even have a RUN; statement, this would cause the appearance of "running forever".
Or the code has the RUN; but was not submitted such as highlighting and submitting only the lines above the 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.