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;
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!
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
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)?
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
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.