BookmarkSubscribeRSS Feed
mihoyoshi
Calcite | Level 5

Hi, I am trying to run proc glm (on SAS 9.4 TS Level 1M5) with a continuous dependent variable (log10biomarker) and 1 continuous independent variable (log10root) and 1 categorical independent variable (Species: either Kanlow or Summer). I would like to test for the separate effects of log10root and Species, but also for the interaction between the two independent variables. I have tried the code (below), specifying that Species is a categorical variable with the statement Class. And no dummy coding was necessary as the dataset lists either "Kanlow" or "Summer" in every cell (i.e. not say, "0" for Kanlow and "1" for Summer). However, the output (attached) shows that the interaction is tested for Kanlow and Summer individually. Instead, I want to simply test the interaction log10root * Species on log10biomarker (i.e. does the effect of log10root on log10biomarker change based on whether the species is Kanlow or Summer).

 

proc glm data=Rootmicr.Initial;
Class Species;
by Group;
model log10biomarker = log10root | Species / solution;
ods output ParameterEstimates=Rootmicr.IniDepthSpecIntxnGLMparmestim;
run;

proc glm species intxn problem.JPG

6 REPLIES 6
PaigeMiller
Diamond | Level 26

This is the correct output when you have an interaction between a class x-variable and a continuous x-variable.


The interaction is statistically significant (Pr > F is less than 0.05), and the area you have highlighted indicates the different slopes of log10root to predict log10biomarker, depending on which species is used.

--
Paige Miller
mihoyoshi
Calcite | Level 5

I see. Any thoughts on why there are no values in the parameter estimates output for when Species=Summer?

PaigeMiller
Diamond | Level 26

That's how SAS has chosen to parameterize the model.

 

I wrote a short description about this (in a slightly different situation, although the same principle applies here)

 

Interpreting Multivariate Linear Regression with Categorical Variables

--
Paige Miller
mihoyoshi
Calcite | Level 5

I ran this:

proc glm data=Rootmicr.Initial;
Class Species;
by Group;
model log10biomarker = log10root | depthnum | Species / solution;
lsmeans Species / stderr pdiff cov out=adjmeans;;
ods output ParameterEstimates=Rootmicr.IniDepthSpecIntxnGLMparmestim;
run;

How does one interpret this part of the output?

The SAS System

The GLM Procedure
Least Squares Means
Species log10biomarker LSMEAN StandardError H0:LSMEAN=0 H0:LSMean1=LSMean2Pr > |t| Pr > |t|KanlowSummer
1.183746310.309347310.00100.2874
1.581131830.19197711<.0001 
Rick_SAS
SAS Super FREQ

Species=Summar is the reference level. Because you've included an intercept term, the GLM can only estimate DIFFERENCES between levels. For the mathematical details, see "Singular parameterizations, generalized inverses, and regression estimates"

StatDave
SAS Super FREQ

There is only a single interaction estimated, and that is the -4.08 value. What is confusing you is just the fact that your Species variable is a CLASS (categorical) predictor and is represented in the model with two dummy-coded (0,1-coded) variables. However, since Species has two levels, it has only 1 degree of freedom and therefore only 1 estimable parameter. The second parameter is restricted to zero. Similarly, the interaction has only 1 degree of freedom (1 for log10root times 1 for Species equals 1). Again, the second is restricted to zero. The significant -4.08 interaction suggests that the effect of log10root differs between the two Species.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 6 replies
  • 1787 views
  • 0 likes
  • 4 in conversation