Programming the statistical procedures from SAS

Reporting T-values in LSMEANS Statement in PROC GLM

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Reporting T-values in LSMEANS Statement in PROC GLM

I'm trying to get SAS to spit out t-values for my contrasts in LSMEANS. Is there any way to achieve this? It just reports p-values for each comparison.

My code is

LSMEANS species*wax / pdiff stderr;


Accepted Solutions
Solution
‎06-22-2015 11:34 AM
Valued Guide
Valued Guide
Posts: 684

Re: Reporting T-values in LSMEANS Statement in PROC GLM

I think you should switch to PROC MIXED (or GLIMMIX). Much better functionality, and you get the t values and df (using many different possible df methods).

View solution in original post


All Replies
SAS Super FREQ
Posts: 3,547

Re: Reporting T-values in LSMEANS Statement in PROC GLM

In general, if p is a probability for a t-distributed statistic, then you can recover the t value by using the QUANTILE function. You can use the OUT= option on the LSMEANS statement to produce an output data set, or you can use ODS OUTPUT.

However, you have to know the degrees of freedom for the pairwise comparison and the significance level of the test. A discussion with formulas is in the doc: SAS/STAT(R) 13.1 User's Guide

I am not an expert in multiple comparisons, but I know that they can be tricky, which might be why the procedure does not output the degrees of freedom.

Solution
‎06-22-2015 11:34 AM
Valued Guide
Valued Guide
Posts: 684

Re: Reporting T-values in LSMEANS Statement in PROC GLM

I think you should switch to PROC MIXED (or GLIMMIX). Much better functionality, and you get the t values and df (using many different possible df methods).

Respected Advisor
Posts: 2,655

Re: Reporting T-values in LSMEANS Statement in PROC GLM

I agree with , but if you must use GLM, make the following your LSMEANS statement:

LSMEANS species*wax /tdiff pdiff stderr;

Steve Denham


Occasional Contributor
Posts: 8

Re: Reporting T-values in LSMEANS Statement in PROC GLM

Thanks all.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 362 views
  • 9 likes
  • 4 in conversation