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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 434 views
  • 1 like
  • 2 in conversation