Hello everyone,
I was trying to obtain pvalue using proc freq. But, looks like there are no cross tabulations. Is there any other alternative to obtain the p-values for these variable?
proc freq data = test2;
2082 tables non_femaleacademicprod * male_parent_aca_pro/ chisq;
2083 ods output ChiSq = chsq9(where=(Statistic = "Mantel-Haenszel
2083 ! Chi-Square"));
2084 run;
WARNING: Output 'ChiSq' was not created. Make sure that the output object
name, label, or path is spelled correctly. Also, verify that the
appropriate procedure options are used to produce the requested output
object. For example, verify that the NOPRINT option is not used.
Thanks!
Did you include the ENTIRE log for that Proc Freq?
I know that I can create the same warning with a data set that only has one level of a variable on the Tables statement but that shows a note about that as well.
Here is some code that works. I used a WEIGHT variable so that I would not need to type some many rows of data. I also used 4 categories instead of 5.
data Test2;
input non_femaleacademicprod male_parent_aca_pro Count;
datalines;
1 1 27
1 2 13
1 3 23
1 4 33
2 1 37
2 2 23
2 3 13
2 4 15
3 1 14
3 2 9
3 3 5
3 4 7
4 1 14
4 2 9
4 3 5
4 4 12
;
ods trace on;
proc freq data = test2;
weight Count;
tables non_femaleacademicprod * male_parent_aca_pro/ chisq;
ods output ChiSq = chsq9(where=(Statistic="Mantel-Haenszel Chi-Square"));
run;
proc print data=Chsq9;
run;
Since my code works and yours does not, I suspect you might have a typo in the WHERE clause. First, output the entire data set of statistics by using
ods output ChiSq = chsq9;
Do you see the data? If so, it is your WHERE clause that is incorrect. Make sure there are no extra spaces. If necessary, use a simpler WHERE clause such as
ods output ChiSq = chsq9(where=(Statistic contains "Mantel"));
Did you include the ENTIRE log for that Proc Freq?
I know that I can create the same warning with a data set that only has one level of a variable on the Tables statement but that shows a note about that as well.
My data was not cleaned properly thus giving the error.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.