BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
saza
Quartz | Level 8

1) Also using the SASHELP.IRIS dataset, use PROC REPORT to generate a table with the mean petal width (variable = PetalWidth) for each iris species (variable = Species). Your output should look something like this:

saza_0-1647986397004.png

 

My code. I'm using the "Thirty Three Tricks with PROC REPORT: A Quick Introduction to the Powerful REPORT Procedure" to help write my code.

proc report data= sashelp.iris;
columns Iris species, petelwidth;
define Iris species 'setosa';
define Iris species 'versicolor';
define Iris species 'virginica';
define petelwidth analysis mean species/petelwidth;
run;

 

saza_0-1647986352246.png

This is my errors 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

 

You should use the variable name in your code (and NOT the label of the variable) :

 

Something like this :

proc report data = sashelp.iris;
columns Species (Sum Min Max Range Mean Std),PetalWidth;
define Species    / group;
define PetalWidth / analysis mean;
run;

 

Koen

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

You should use the variable name in your code (and NOT the label of the variable) :

 

Something like this :

proc report data = sashelp.iris;
columns Species (Sum Min Max Range Mean Std),PetalWidth;
define Species    / group;
define PetalWidth / analysis mean;
run;

 

Koen

saza
Quartz | Level 8
idk why I was typing out the species. thank you!

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 574 views
  • 1 like
  • 2 in conversation