Giacomo Rosaspina
Giacomo Rosaspina

Reputation: 111

How to change percent type in proc freq (SAS)

I'm computing conditional frequency of two variables in a dataset with this:

proc freq data=input noprint;
tables VAR1 * VAR2 / out=output; 
run;

I want to know if for every VAR1-i there are more than one type of VAR2-i. But in the output there is count that count how many times VAR2-i is present for VAR-1-i (as I want) while percent is the percent of count on the total number of records of the dataset instead I want the percent on the total of records of VAR1-i.

How can I fix?

Upvotes: 0

Views: 195

Answers (1)

Jetzler
Jetzler

Reputation: 797

You are missing the outpct option.

proc freq data=input noprint;
   tables VAR1 * VAR2 / out=output outpct; 
run;

Upvotes: 1

Related Questions