How can I get PROC REPORT in SAS to show values in an ACROSS variable that have no observations?

前端 未结 1 938
情话喂你
情话喂你 2021-01-14 02:52

Using PROC REPORT in SAS, if a certain ACROSS variable has 5 different value possibilities (for example, 1 2 3 4 5), but in my data set there are no observations where that

相关标签:
1条回答
  • 2021-01-14 03:10

    When push comes to shove, you can do some hacks like this. Notice that there are no missing on SEX variable of the SASHELP.CLASS:

    proc format;
      value $sex 'F' = 'female' 'M' = 'male' 'X' = 'other';
    run;
    
    options missing=0;
    proc report data=sashelp.class nowd ;
      column age sex;
      define age/ group;
      define sex/ across format=$sex. preloadfmt;
    run;
    options missing=.;
    /*
                      Sex
        Age  female  male    other
         11       1       1       0
         12       2       3       0
         13       2       1       0
         14       2       2       0
         15       2       2       0
         16       0       1       0
    */
    
    0 讨论(0)
提交回复
热议问题