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;
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
I cannot change the response variable. I am comparing it to other models and the response must be consistent across all model types.
@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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.