Programming the statistical procedures from SAS

ANOVA with Covariate = slope test

Reply
Occasional Contributor
Posts: 5

ANOVA with Covariate = slope test

I'm an applied statistics student trying to get help understanding some SAS output and how to correct a problem I'm having.  This is based on a hw problem I'm answering, but I promise if you answer I promise this doesn't violate any academic dishonesty policy or anything, the hw is not graded I just need to turn it in, but I want to try and get it correct and understand it before I do. Anyhow...

This is based on based on Design and Analysis of Experiments by Angela Dean and Daniel Voss.  In an example in that text they describe how an equality of slopes test can be run on a covariate using the code:

Proc GLM;

CLASS COLOR;

MODEL INFTIME=COLOR X COLOR*X;

RUN;

and the results:

SourceDFSum of SquaresMean SquareF ValuePr > F
Model7273.206730139.02953295.970.0004
Error24157.03201996.5430008
Corrected Total31430.2387500

R-SquareCoeff VarRoot MSEINFTIME Mean
0.63501212.635652.55792920.24375

SourceDFType I SSMean SquareF ValuePr > F
COLOR3127.661250042.55375006.500.0022
X1120.8353249120.835324918.470.0002
X*COLOR324.71015528.23671841.260.3108

SourceDFType III SSMean SquareF ValuePr > F
COLOR3119.548331239.84944376.090.0031
X1132.2254691132.225469120.210.0001
X*COLOR324.71015528.23671841.260.3108

and that

/*The interaction term X*COLOR will be significantly different from zero if the

linear run order trends are not the same for each TRTMT.  (X is for run order)*/

Now, since the p-value for X*COLOR is 0.3108, the interpretation is that interaction is not significantly different from zero so the run order trends are the same for each TRTMT, meaning the equal slopes model can be used.

My main problem is that I'm trying to run this same test on a different data set but when I run the test I have no error df and thus I get no F or p-values.  My code is:

Proc GLM;

class TRTMT;

model ABSORB=TRTMT RATE TRTMT*RATE;

run;

my results are:

SourceDFSum of SquaresMean SquareF ValuePr > F
Model110.384639760.03496725..
Error00.00000000.
Corrected Total110.38463976

R-SquareCoeff VarRoot MSEABSORB Mean
1.000000..0.466583

SourceDFType I SSMean SquareF ValuePr > F
TRTMT50.316145100.06322902..
RATE10.040553380.04055338..
RATE*TRTMT50.027941280.00558826..

SourceDFType III SSMean SquareF ValuePr > F
TRTMT50.033170640.00663413..
RATE10.002213430.00221343..
RATE*TRTMT50.027941280.00558826..

and then I can't make any conclusion.  How do I adjust in order to have error df.  My only thought is to also assign TRTMT as a covariate and then I get:

Proc GLM;

class ;

model ABSORB=TRTMT RATE TRTMT*RATE;

run;

and

SourceDFSum of SquaresMean SquareF ValuePr > F
Model30.178988190.059662732.320.1517
Error80.205651570.02570645
Corrected Total110.38463976

R-SquareCoeff VarRoot MSEABSORB Mean
0.46534034.363060.1603320.466583

SourceDFType I SSMean SquareF ValuePr > F
TRTMT10.005513840.005513840.210.6556
RATE10.115433320.115433324.490.0669
TRTMT*RATE10.058041030.058041032.260.1713

SourceDFType III SSMean SquareF ValuePr > F
TRTMT10.059910670.059910672.330.1654
RATE10.114606430.114606434.460.0677
TRTMT*RATE10.058041030.058041032.260.1713

ParameterEstimateStandard Errort ValuePr > |t|
Intercept4.3487584871.812913612.400.0433
TRTMT-0.7800156440.51094274-1.530.1654
RATE-1.9156245800.90724987-2.110.0677
TRTMT*RATE0.3850529170.256255911.500.1713

and I can interpret that again in this data set interaction is not significant and thus the equal slopes model would be correct to use.  But, I don't think this is correct because TRTMT isn't supposed to be a covariate and by assigning it as such I think I'm completely changing the model.

Thanks for any help you can give!

Grand Advisor
Posts: 16,850

ANOVA with Covariate = slope test

TRT is a covariate in both models, but in the first it is treated as a categorical variable and in the second it is treated as a continuous variable.

Two things to check:

1) Run a proc freq of your data for trt*rate such as

proc freq data=have;

table trtmt*rate;

run;

2) a Proc means on the rate variable and see the output

proc means data=have;

class trtmt;

var rate;

run;

I'm guessing one of those will show what's wrong with your model.

Valued Guide
Posts: 2,108

ANOVA with Covariate = slope test

Jacob,

The problem here

Proc GLM;

class TRTMT;

model ABSORB=TRTMT RATE TRTMT*RATE;

run;

is that TRTMT has 6 levels and you only have twelve observations.  Therefore your model is overparameterized to check for equality of slopes across all treatments.  I would generally consider the first model to be overparameterized as well, just not so much as to be mathematically degenerate (You fail to reject the equal slopes assumption, but you have so little power that you really can't accept it either).  Harrell, in his regression modelling strategies book, recommends at least 15 observations per degree of freedom tested in a linear model to have a chance to obtain stable results.

Doc Muhlbaier

Duke

Occasional Contributor
Posts: 5

ANOVA with Covariate = slope test

Thank you, that was a very helpful explanation.

Ask a Question
Discussion stats
  • 3 replies
  • 266 views
  • 0 likes
  • 3 in conversation