在 proc tabulate (SAS) 的顶列中添加行百分比

Add row percentage within top column in proc tabulate (SAS)

我在 SAS 中使用 Proc tabulate,我想制作一个 table 像这个例子:enter image description here

如您所见,我想计算每年的rowpctn。我的问题是我不知道把rowpctn写在代码的什么地方,在网上找了一个小时也没有找到答案。

我的代码如下所示:

Proc tabulate Data=Have;
class year gender question_1;
table gender, year*question_1;
run;

我必须在哪里声明 rowpctn 以获得所需的结果?

在等待回复的过程中,我一直在网上搜索答案,我自己也找到了解决办法。

代码如下:

Proc tabulate Data=Have;
class year gender question_1;
table gender*pctn<question_1>, year*question_1;
run;