Hello,
i have to Make a demographic table with three different groups. I’m having trouble with the age group. I used Proc Univariate to then transpose. I don’t understand why I keep getting this error message. Am I missing something obvious? Sorry but I’m new to all this! Thank you in advance for your help.
You forgot the semicolon at the end of your BY statement, so SAS thinks VAR is another variable, not a new statement.
@SasStudent2 wrote:
Hello,
i have to Make a demographic table with three different groups. I’m having trouble with the age group. I used Proc Univariate to then transpose. I don’t understand why I keep getting this error message. Am I missing something obvious? Sorry but I’m new to all this! Thank you in advance for your help.
@SasStudent2 Kindly mark @Reeza'ssolution as answered and close the thread. Although, nice of you to acknowledge the help with a "thank you"
Answer me one question first if you will, is taking a photo of your screen and uploading pictures to the forum easier than simply copy and pasting some text?
@SasStudent2 wrote:
Hello,
i have to Make a demographic table with three different groups. I’m having trouble with the age group. I used Proc Univariate to then transpose. I don’t understand why I keep getting this error message. Am I missing something obvious? Sorry but I’m new to all this! Thank you in advance for your help.
What specific trouble are you having with the agegroup?
If the whole purpose of this exercise is to make a report table consider one of the report procedures like Proc Tabulate or Proc Report which will both do simple statistics and grouping.
It is always a good idea to provide a little example data so we know what variables you have, what type they are and the structure of your data set.
Guessing here but I might start with
proc tabulate data=demog; class trt; class race; class gender; var age; table (race gender)*(n mean std max min), trt* age ; run;
Grouping is done by values of the class variables in proc tabulate, so each value of race and gender in this example, will have the statistics calculated for age under a column for each level of the trt variable. Different orders of values can be accomplished with moving class variables from row to column and the group of statistics.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.