I have a sas datsset create as below:
input group id sex ;
format sex gender.;
1 133 1
3 134 1
( sas dataset Have)
obs group id sex
1 1 133 male
2 3 134 male
Then I run proc report code as below:
proc report data=have; run;
The output upexpect as below(colum total):
group id sex
4 267 femal
How can I fix this problem? it sounds because format
You do not have any define statements in your PROC REPORT code. GROUP and ID variables are numeric and by default, numeric variables have a usage of SUM. So you have values of 1 and 3 in for your two rows, and 1+3 = 4. You have values of 133 and 134 for ID and 133+134 = 267.
My suggestion is that you review the DEFINE statement. And, as an example of what you need to do, consider this code and output.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.