Hi .
What is the correct code using Proc GLM to test a 2-groups one-sided hypothesis where the hypothesis is H0: Difference between groups <= 4, H1: Difference between groups > 4? The model will include baseline and site as covariates.
Thanks.
See this note on one-sided testing and using a non-zero null value. For example, you can PROC ORTHOREG which is the modern regression procedure that has the most up-to-date capabilities available, including the LSMESTIMATE statement that allows you to estimate and compare means and to specify a null value other than zero (TESTVALUE=) and one-sided tests (UPPER and LOWER). See the ORTHOREG documentation for details. For example, the following tests whether the difference between the F and A drugs exceeds 4.
data DrugTest;
input Drug $ PreTreatment PostTreatment @@;
datalines;
A 11 6 A 8 0 A 5 2 A 14 8 A 19 11
A 6 4 A 10 13 A 6 1 A 11 8 A 3 0
D 6 0 D 6 2 D 7 3 D 8 1 D 18 18
D 8 4 D 19 14 D 8 9 D 5 1 D 15 9
F 16 13 F 13 10 F 11 18 F 9 5 F 21 23
F 16 12 F 12 5 F 12 16 F 7 1 F 12 20
;
proc orthoreg data=DrugTest;
class Drug;
model PostTreatment = Drug PreTreatment;
lsmestimate Drug 'F-A>4' -1 0 1 / testvalue=1 upper;
run;
See this note on one-sided testing and using a non-zero null value. For example, you can PROC ORTHOREG which is the modern regression procedure that has the most up-to-date capabilities available, including the LSMESTIMATE statement that allows you to estimate and compare means and to specify a null value other than zero (TESTVALUE=) and one-sided tests (UPPER and LOWER). See the ORTHOREG documentation for details. For example, the following tests whether the difference between the F and A drugs exceeds 4.
data DrugTest;
input Drug $ PreTreatment PostTreatment @@;
datalines;
A 11 6 A 8 0 A 5 2 A 14 8 A 19 11
A 6 4 A 10 13 A 6 1 A 11 8 A 3 0
D 6 0 D 6 2 D 7 3 D 8 1 D 18 18
D 8 4 D 19 14 D 8 9 D 5 1 D 15 9
F 16 13 F 13 10 F 11 18 F 9 5 F 21 23
F 16 12 F 12 5 F 12 16 F 7 1 F 12 20
;
proc orthoreg data=DrugTest;
class Drug;
model PostTreatment = Drug PreTreatment;
lsmestimate Drug 'F-A>4' -1 0 1 / testvalue=1 upper;
run;
Thank you.
This looks great - thank you.
I compared the estimates to the estimates of the Proc GLM and they were the same.
(In the code below, Should the testvalue=4 in the lsmestimate line?)
All good. Thank you so much for your help.
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.