DATA Step, Macro, Functions and more

Proc Freq and Chisq - how "to keep" just what is needed

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 142
Accepted Solution

Proc Freq and Chisq - how "to keep" just what is needed

Hi all,

 

I have the following code:

proc freq data=titanicX;
	tables class*survived / chisq ;
	output out=sampleX chisq (keep=_PCHI_ P_PCHI_); 
run;

I need to keep just Chisq and p-value in the output file. The option 'keep' above is not functioning. Could you please help with the issue. Thank you!


Accepted Solutions
Solution
‎08-30-2017 02:29 AM
Frequent Contributor
Posts: 142

Re: Proc Freq and Chisq - how "to keep" just what is needed

Posted in reply to WarrenKuhfeld

Thank you, Warren. You are completely right, it was the showstopper Robot Mad  )

 

proc freq data=sample&i noprint;
			tables class*survived / chisq;
			output out=sampleX&i (keep=_PCHI_ P_PCHI)chisq;
		run;

View solution in original post


All Replies
SAS Super FREQ
Posts: 305

Re: Proc Freq and Chisq - how "to keep" just what is needed

Posted in reply to DmytroYermak

(KEEP=...) is a data set option.  You have to put it right after the data set name.

Solution
‎08-30-2017 02:29 AM
Frequent Contributor
Posts: 142

Re: Proc Freq and Chisq - how "to keep" just what is needed

Posted in reply to WarrenKuhfeld

Thank you, Warren. You are completely right, it was the showstopper Robot Mad  )

 

proc freq data=sample&i noprint;
			tables class*survived / chisq;
			output out=sampleX&i (keep=_PCHI_ P_PCHI)chisq;
		run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 99 views
  • 2 likes
  • 2 in conversation