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

Below is the code I am using.  I am specifying a one tailed test for the contrasts in the estimate statement but it is not displaying the upper one tailed p value in the Estimates table.  Looks like it is the default two-tailed p value for the contrasts.  

 

Any ideas as to why?  Thanks, Brad


ods output lsmeans=larvae_order_MEANS_lognormal;
proc print data=larvae_order_MEANS_lognormal;
proc sort data=library.larvae_order_MEANS; by order;
title 'GLIMMIX LOGNORMAL REML - LARVAL ORDER DENSITIES - BLOCKED';
proc glimmix data=library.larvae_order_MEANS method=LAPLACE; by order;
class type subsite pair year;
model MEAN_density_m2=type year year*type / solution dist=lognormal link=identity;
random pair pair*type;
lsmeans year*type / adjust=tukey CL ilink diff=all;
lsmeans type / adjust=tukey CL ilink diff=all;
estimate 'treated restored change - untreated restored change' year*type 0 0 1 -1 -1 1 / upper;
estimate 'treated restored change - reference change' year*type 1 -1 0 0 -1 1 / upper;
estimate 'untreated restored change - reference change' year*type 1 -1 -1 1 0 0;
run;
ods output / reset;

1 ACCEPTED SOLUTION

Accepted Solutions
didymo
Fluorite | Level 6

Oops, they are, but the output could be clearer.  I removed the 'upper' and the p value label is: Pr > |t| with a larger p value!  The one sided is denated 'Pr t' in glimmix I guess versus the output having a label column with upper and both in mixed.  Cheers!

View solution in original post

7 REPLIES 7
sbxkoenk
SAS Super FREQ

Instead of halving the p-value of the two-tailed test (halving method) , the ESTIMATE statement in many procedures can provide the one-sided p-value directly by specifying the UPPER or LOWER option as appropriate.

 

What makes you think you are looking at a two-sided p-value?

 

Usage Note 24094: Testing the null hypothesis that a parameter (or parameters) is equal to, greater than, or less than a constant
https://support.sas.com/kb/24/094.html

 

Thanks,
Koen

StatDave
SAS Super FREQ

For the 2 of 3 of your ESTIMATE statements that have the UPPER option, what makes you think you are not getting a one-sided p-value? Is the p-value label "Pr>z" (for one-sided) or "Pr>|z|" (for two-sided)?

didymo
Fluorite | Level 6

Thanks.  Good point but "Pr t" is all that is provided in the Estimates table, which I assume is two tailed.  Using proc mixed for other response variables, the same estimate statements produce an Estimates table has a column with Upper, Upper, Both, which seems correct, but I can not get glimmix to produce a similar table.  Perhaps it is the method or link I using?  I need the power of the one tailed test for other response variables, not the example below.

 

Unless I am wrong, the contrast statements (e.g.,  0 0 1 -1 -1 1) are not testing a directional difference, but a non-directional difference, right?

 

Thanks

Screen Shot 2023-04-30 at 12.44.11 PM.png

StatDave
SAS Super FREQ
That label reflects the fact that you have some ESTIMATE statements with UPPER and some without. As a result the label cannot indicate one- or two-tailed because you have both. However, the p-values from the statements with UPPER are one-tailed, and the p-value from the statement without UPPER is two-tailed. You can verify by simply rerunning omitting UPPER to see the change in the p-values.
didymo
Fluorite | Level 6

Got it.  Thanks, However, this is not the problem.  GLIMMIX with ESTIMATES statement and '/ upper' does not produce a one tailed p  value, which I am trying to resolve. 

StatDave
SAS Super FREQ
As I mentioned in my previous reply, the ESTIMATE statements with the UPPER option, ARE one-sided. What evidence do you have that they are not?
didymo
Fluorite | Level 6

Oops, they are, but the output could be clearer.  I removed the 'upper' and the p value label is: Pr > |t| with a larger p value!  The one sided is denated 'Pr t' in glimmix I guess versus the output having a label column with upper and both in mixed.  Cheers!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 1157 views
  • 1 like
  • 3 in conversation