BookmarkSubscribeRSS Feed
4 REPLIES 4
ballardw
Super User

What line? You haven't given us any example "lines" to look at.

 

You may also need to define exactly what you mean by 'difference between means for letters'. Typically letters are character variables and such would not have a mean which is a numeric statistic.

 

Example data in the form of a data step of what you have, code that you have tried and example of what the result should be should accompany questions.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

CookieMonster
Fluorite | Level 6

Thx for your reply ballardw. 

 

I have 72 observations and 4 variables. Two groups (control vs. experimental), repeated measures (6 moments) and 12 animals (6/group).

 

I ran a PROC GLM with a split-plot design

 

PROC MEANS N MIN MAX MEAN STD VAR;
    VAR IRON;
    BY GROUP TIME;
	RUN;
	PROC GLM data=SHEEP.IRON;
	CLASS ANIMAL GROUP TIME;
	MODEL IRON=GROUP ANIMAL(GROUP) TIME GROUP*TIME/SS3;
	TEST H=GROUP E=ANIMAL(GROUP);
	MEANS GROUP TIME/tukey lines;
	MEANS GROUP/TUKEY lines E=ANIMAL(GROUP);
	lsmeans GROUP*TIME/slice=GROUP pdiff adjust=tukey;
    lsmeans GROUP*TIME/slice=TIME pdiff adjust=tukey;
	MEANS TIME/TUKEY;
	output out=DE STUDENT=IRONE;
	RUN;
PROC UNIVARIATE DATA=DE PLOT NORMAL;
	VAR IRONE;
	TITLE 'SERUM IRON CONCENTRATION';
RUN;

TITLE 'INTERACTION EFFECTS';
PROC SORT;
BY GROUP; RUN;
PROC GLM;
CLASS TIME ANIMAL;
MODEL IRON=TIME/SS3;
MEANS TIME/TUKEY;
BY GROUP;
RUN;
PROC SORT;
BY TIME; RUN;
PROC GLM;
CLASS GROUP ANIMAL;
MODEL IRON=GROUP/SS3;
MEANS GROUP/TUKEY;
BY TIME;
RUN;

In older versions of SAS University Edition, tukey lines presented results of means followed by the same LETTER are not significantly different.

 

In the last versions os SAS UE, tukey lines presents results of means follwed by the same BAR (colored lines) are not significantly different.

 

For few variables and repeated measures, no problem. It's pretty fast to figure that out and use LETTERS to indicate significance in tables for scientific papers.

 

However, when there is interaction effect between groups (more than 2) and repeated measures (time=9 moments or more) it is boring and time consuming to do this.

 

Is there a command line that I could use to change the results presentations back to SAS showing LETTERS to indicate significance between means?

 

Thx

 

Here is the log you asked me for.

 

data WORK.IRON;
   infile datalines dsd truncover;
   input Group:$8. Animal:32. Time:$8. Iron:32.;
 datalines;
 C 1 M0 28.73
 C 2 M0 10.29
 C 3 M0 23.91
 C 4 M0 22.4
 C 5 M0 21.65
 C 6 M0 16.44
 C 1 M1 19.71
 C 2 M1 7.2
 C 3 M1 22.85
 C 4 M1 23.55
 C 5 M1 21.79
 C 6 M1 12.9
 C 1 M2 22.27
 C 2 M2 14.94
 C 3 M2 25.32
 C 4 M2 17.54
 C 5 M2 20.02
 C 6 M2 12.5
 C 1 M3 22.01
 C 2 M3 19.22
 C 3 M3 20.42
 C 4 M3 23.16
 C 5 M3 24.97
 C 6 M3 16.13
 C 1 M4 25.15
 C 2 M4 21.61
 C 3 M4 18.91
 C 4 M4 19.44
 C 5 M4 18.43
 C 6 M4 19.66
 C 1 M5 26.38
 C 2 M5 25.06
 C 3 M5 28.5
 C 4 M5 20.11
 C 5 M5 21.12
 C 6 M5 14.89
 E 1 M0 25.01
 E 2 M0 24.66
 E 3 M0 33.45
 E 4 M0 31.91
 E 5 M0 24.26
 E 6 M0 23.51
 E 1 M1 19.49
 E 2 M1 18.47
 E 3 M1 28.15
 E 4 M1 22.67
 E 5 M1 20.59
 E 6 M1 9.67
 E 1 M2 15.42
 E 2 M2 9.41
 E 3 M2 17.94
 E 4 M2 7.86
 E 5 M2 12.72
 E 6 M2 8.66
 E 1 M3 18.47
 E 2 M3 13.61
 E 3 M3 23.38
 E 4 M3 8.84
 E 5 M3 8.79
 E 6 M3 9.67
 E 1 M4 25.37
 E 2 M4 25.76
 E 3 M4 32.53
 E 4 M4 18.43
 E 5 M4 15.69
 E 6 M4 26.43
 E 1 M5 25.01
 E 2 M5 23.91
 E 3 M5 31.42
 E 4 M5 24.22
 E 5 M5 27.53
 E 6 M5 17.72
 ;;;;
ballardw
Super User

Likely the information can be placed into a data set. I am not exactly sure which output you need as I may be running slightly older version and don't see anything related to BAR in the output.

A general solution to this is to start with a clean log and use the option ODS TRACE to get a list of generated tables such as:

ods trace on;
PROC GLM data=work.IRON;
	CLASS ANIMAL GROUP TIME;
  	MODEL IRON=GROUP ANIMAL(GROUP) TIME GROUP*TIME/SS3;
	TEST H=GROUP E=ANIMAL(GROUP);
	MEANS GROUP TIME/tukey lines;
	MEANS GROUP/TUKEY lines E=ANIMAL(GROUP);
	lsmeans GROUP*TIME/slice=GROUP pdiff adjust=tukey;
    lsmeans GROUP*TIME/slice=TIME pdiff adjust=tukey;
	MEANS TIME/TUKEY;
	output out=DE STUDENT=IRONE;
RUN;
quit;
ods trace off;

The log will contain entries such as:

Output Added:
-------------
Name:       ClassLevels
Label:      Class Levels
Template:   STAT.GLM.ClassLevels
Path:       GLM.Data.ClassLevels
-------------

Output Added:
-------------
Name:       NObs
Label:      Number of Observations
Template:   STAT.GLM.NObsNotitle
Path:       GLM.Data.NObs
-------------

Output Added:
-------------
Name:       OverallANOVA
Label:      Overall ANOVA
Template:   stat.GLM.OverallANOVA
Path:       GLM.ANOVA.Iron.OverallANOVA
-------------

That will correspond the output tables generated. You can compare the results to this list to match the table name with the output though it is going to be easier with fewer options.

I am going to guess that you are looking for one of the MCLINES or MCLINESINFO.

You can generate a data set with the desired output by adding an ODS OUTPUT tablename= datasetname; to the procedure code.

So perhaps adding

 

ods output mclines=work.linesdata;

You might want other tables as well but that is the approach to get some of the displayed information into data sets. Then you can use data steps to manipulate the results, such as selecting needed records, merging with other data or what have you.

CookieMonster
Fluorite | Level 6

Hi ballardw, thx for the tip. However it continues to show differences between means with lines not letters.

 

😞

 

Screen Shot 2019-07-23 at 9.04.24 AM.pngScreen Shot 2019-07-23 at 9.03.53 AM.png

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

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
  • 4 replies
  • 2480 views
  • 1 like
  • 2 in conversation