BookmarkSubscribeRSS Feed
jvgatto89
Calcite | Level 5

I am writing code to run a repeated measures linear mixed model.  One of the linear predictors needs a fixed slope set to 1. The other predictor variable and the autocorrelation coefficient are estimated by the model. I have done something similar in PROC REG where there is a RESTRICT statement.  Is there an equivalent to RESTRICT in PROC MIXED where I can restrict the slope to a constant?

 

 

Below is the code:

 

ODS OUTPUT FITSTATISTICS=FIT_RICKER2;
ODS OUTPUT CovParms=RICKER_PARMS2;
PROC MIXED METHOD=REML ALPHA=.05 NOITPRINT NOINFO DATA=FISH_DENSITY;
BY REGION SITE SPECIES;
CLASS TIME;
MODEL LOG_Nt=LOG_Nt_Minus1 Nt_Minus1/ s outp=pred_RICKER;
RANDOM TIME;
REPEATED / TYPE=AR(1) SUBJECT=INTERCEPT;
ESTIMATE 'INTERCEPT' INTERCEPT 1;
RUN;

3 REPLIES 3
PaigeMiller
Diamond | Level 26

If you have to restrict the slope on a variable (let's just arbitrarily pick x2) to exactly 1, then you could write the fixed portion of the model

 

y = x0 + beta1*x1 + 1*x2 + beta3*x3 + ...

 

which is equal to

 

y–x2 = x0 + beta1*x1 + beta3*x3 + ...

 

so it would seem that you could fit a model to y–x2

--
Paige Miller
jvgatto89
Calcite | Level 5

I cannot change the response variable.  I am comparing it to other models and the response must be consistent across all model types.

PaigeMiller
Diamond | Level 26

@jvgatto89 wrote:

I cannot change the response variable.  I am comparing it to other models and the response must be consistent across all model types.


You can fit the model, and then "un-transform" the response variable, so you can compare it to other models.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 922 views
  • 0 likes
  • 2 in conversation