Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- LSD in Proc Mixed

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-07-2013 05:39 PM

Can someone help me update this code for SAS 9.2 or suggest better. I found it on the web in Google Groups from 1998.

*****************

Proc mixed doesn't compute lsd directly, but it can be done using info. generated by the make statement. Look at this example:

proc mixed;

...

make "diffs" out=diffs;

quit;

data calc_lsd;

set;

lsd=_se_*tinv(1-.05/2,_df_);

**************

Thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cken

02-11-2013 09:26 AM

Replace the old make statement with an ODS OUTPUT statement:

ods output diffs=diffs;

And then use:

data calc_lsd;

set diffs;

lsd=stderr*tinv(1 -0.5/2,df);

run;

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-11-2013 12:43 PM

Thank you very much!

The program ran the code, but produced no output.

Can you provide code to generate output?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cken

02-12-2013 07:56 AM

Add a proc print.

proc print data=calc_lsd;

var lsd estimate stderr df;

run;

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

05-15-2013 09:20 AM

Many thanks for this.

Different values of LSD have been printed. which one to consider. The min of all the LSD?

Thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to gaston

05-16-2013 10:00 AM

You probably have different values for the standard error of the differences, as a result of unequal observations in the effects you are comparing. Consequently, the LSD will differ from case to case. Sharing some more code, especially your PROC MIXED code, and some info on the design could help clarify this.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

05-17-2013 09:52 AM

Many thanks Steve.

below is the dode:

Proc mixed;

class block variety;

model yield=variety;

random block;

lsmeans variety/pdiff;

ods output Diffs=d;

run;

This is an augmented design where 200 varieties and 5 checks have been tested in an Augmented randomized complete block design. The 200 varieties have been unreplicated in 20 blocks of 10 plots each. Each block has been completed by the 5 checks. Hence a total of 300 plots (200+5*20). Thanks

Gaston

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to gaston

05-17-2013 10:44 AM

So in the lsmeans table, are the standard errors of the varieties all equal? If not, then there is probably some missing data (variety within a block), so that the standard error of the difference is not constant. Also, are the 5 checks all identical check varieties? This also leads to unequal replication, unequal standard errors of the differences, and consequently, different LSDs.

Also, in a design of this type, block by variety is often included, since not all varieties are seen in each block, but the check varieties are, and this may represent a better source of residual error. Emphasis on the word may, there.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

05-18-2013 05:57 PM

Thanks and well noted. The 5 checks are all identical, but some missing data. Then in this case, it makes sense to have different LSDs. many thanks again. Gaston

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to gaston

11-24-2015 09:35 AM - edited 11-24-2015 09:39 AM

hi is the above code used for LSD at 0.05 or 0.1 ? I would like to obtain the LSD value at 0.1 thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ALSU

11-30-2015 01:00 PM

In the equation

lsd=_se_*tinv(1-.05/2,_df_);

the value 0.05 represents the significance level, often denote by "alpha." So the answer to your question is that the LSD is for alpha=0.05. Use alpha=0.1 to get the LSD value that you are asking for.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-17-2016 12:27 PM

Hi Steve, Please is the 0.05 in the lsd equation for 5% significant level?, can it be changed to lsd=stderr*tinv(1-0.1/2,df). Thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Olanike

02-18-2016 09:47 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-18-2016 11:56 AM

Thanks!!!

##- Please type your reply above this line. Simple formatting, no

attachments. -##

##- Please type your reply above this line. Simple formatting, no

attachments. -##