BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
greengg
Calcite | Level 5

proc anova data= Cluster_1 ;
class Consumer Sample ;
title Cluster_1 ;
model Overall_L Leaf_L Buywant = Consumer Sample ;
means Sample/lsd lines ;
run;

 

---------------------

1

greengg_0-1690526218928.png

 

2

 

greengg_1-1690526416801.png

 

 

I want a data value displayed in letters like on the picture2. However, when analyzing the data in the above method, it is difficult because the line graph comes out like the picture1 . Is there any way to convert a line graph into a table?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

My apologies, @Ksharp , my previous message was not a response to you, and I just clicked reply on your message. It was supposed to be a response to @greengg .

--
Paige Miller

View solution in original post

8 REPLIES 8
sbxkoenk
SAS Super FREQ

Hello ,

 

All output objects in the Results pane (tables, graphs, plots, ...) have underlying data of course.

To capture the underlying data in a data set, use ODS OUTPUT.

 

For the name of the output objects, use ODS TRACE ON; .
The names are listed in the LOG as a result of ODS TRACE ON; .

 

title1 'Nitrogen Content of Red Clover Plants';
data Clover;
   input Strain $ Nitrogen @@;
   datalines;
3DOK1  19.4 3DOK1  32.6 3DOK1  27.0 3DOK1  32.1 3DOK1  33.0
3DOK5  17.7 3DOK5  24.8 3DOK5  27.9 3DOK5  25.2 3DOK5  24.3
3DOK4  17.0 3DOK4  19.4 3DOK4   9.1 3DOK4  11.9 3DOK4  15.8
3DOK7  20.7 3DOK7  21.0 3DOK7  20.5 3DOK7  18.8 3DOK7  18.6
3DOK13 14.3 3DOK13 14.4 3DOK13 11.8 3DOK13 11.6 3DOK13 14.2
COMPOS 17.3 COMPOS 19.4 COMPOS 19.1 COMPOS 16.9 COMPOS 20.8
;

ODS trace on;
ODS exclude BoxPlot;
ODS output LinesPlot=work.LinesPlot;

proc anova data=Clover;
   class Strain;
   model Nitrogen = Strain;
   means Strain / lsd lines;
run;
QUIT;

ODS TRACE OFF;

proc print data=work.LinesPlot;
run;
/* end of program */

Koen

PaigeMiller
Diamond | Level 26

This is a side issue, but you should not be using PROC ANOVA for two-way ANOVA, unless you have absolutely equal sample sizes in each cell. From the PROC ANOVA documentation:

 

Use PROC ANOVA for the analysis of balanced data only, with the following exceptions: one-way analysis of variance, Latin square designs, certain partially balanced incomplete block designs, completely nested (hierarchical) designs, and designs with cell frequencies that are proportional to each other and are also proportional to the background population. These exceptions have designs in which the factors are all orthogonal to each other.

 

Caution: If you use PROC ANOVA for analysis of unbalanced data, you must assume responsibility for the validity of the results.

Use PROC GLM instead.

--
Paige Miller
Ksharp
Super User
proc glm data= sashelp.class ;
class sex age ;
model height weight  =sex age ;
means age/LINESTABLE lines lsd ;
quit;

Ksharp_0-1690544385112.png

 

PaigeMiller
Diamond | Level 26

Adding to my comment above:

 

If you are doing a two-way ANOVA, I think you want to use LSMEANS and not MEANS (unless you have equal number of observations in each cell)

--
Paige Miller
Ksharp
Super User
It is from OP's original code,
I don't know what OP want to do ,so just copy it .
PaigeMiller
Diamond | Level 26

My apologies, @Ksharp , my previous message was not a response to you, and I just clicked reply on your message. It was supposed to be a response to @greengg .

--
Paige Miller
greengg
Calcite | Level 5

SORRY.. I DONT KNOW WHAT CAN I DO.. 

sbxkoenk
SAS Super FREQ

@greengg wrote:

SORRY.. I DONT KNOW WHAT CAN I DO.. 


Hello @greengg ,

 

Does it bother you that you marked a wrong post as a solution?
There's nothing more you can do about that. You can't reverse that, I guess.
But don't bother with it anymore. It's not a big deal. The question itself is no longer in status "open" and that's the most important thing.

And for the statistics of @PaigeMiller  and @Ksharp , you don't have to correct it either. Those statistics are dizzying anyway. One solution more or less ... they will hardly notice.

 

BR,

Koen

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1167 views
  • 4 likes
  • 4 in conversation