简体   繁体   English

如何在proc freq(SAS)中更改百分比类型

[英]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 . 我想知道每个VAR1-i是否有不止一种类型的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 . 但是在输出中,有一个count可以统计VAR-1-i存在VAR2-i次数(如我所愿),而percentcountdataset记录总数中所占的百分比,而我希望该百分比在VAR1-i的记录总数。

How can I fix? 我该如何解决?

You are missing the outpct option. 您缺少outpct选项。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM