BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RAVI2000
Lapis Lazuli | Level 10

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

4 REPLIES 4
RAVI2000
Lapis Lazuli | Level 10
Those both variable used in tables statement are ordinal.

1- Large -ve impact
2- Small -ve impact
3- No impact
4- Large + impact
5- Small +ve impact
Rick_SAS
SAS Super FREQ

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"));

 

 

ballardw
Super User

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.

RAVI2000
Lapis Lazuli | Level 10

My data was not cleaned properly thus giving the error.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 887 views
  • 2 likes
  • 3 in conversation