10-02-2015 04:11 PM
I have the following cancersitecategories in the "Cancersitecat" variable.
How do I create a new subcategory of variable called Breast total to sum both the breast categories?
breast invasive female
Lung and bronchus
10-03-2015 11:33 PM
You could create a super category (CancerType) and get totals within each super category. With proc Tabulate as a summarizing procedure, it would be something like
data myNewData; set myData; if CancerSiteCat in ("breast insitu female", "breast invasive female") then CancerType = "breast"; else CancerType = "other"; run; proc tabulate data=myNewData; class CancerType CancerSiteCat; table CancerType*(CancerSiteCat all="Total") all="Grand Total", n; run;