SAS GLIMMIX subject specific estimates

I am trying to analyze a dataset where each subject has 12 repeated measures (quarterly, over 3 years). I want to extract subject specific estimates of the time slope to evaluate if the subjects are changing significantly over time.

The code I currently have consistently suggests that each subject is demonstrating a highly significant increase over time. This seems unlikely but I'm not sure how to adjust my syntax to run a more accurate model. Does anyone know how/why this model would find the slope coefficient for time significant for ALL subjects?

A quick description of the study: We are creating a trending report which should flag procedure codes (subjects) that are showing a significant increase in the number of times it was billed over the time period being analyzed (3 years, by quarter). The outcome variable is being treated as a count (bounded at 0 but not necessarily whole numbers).

%macro Zeroes(numzeroes);

%local i;
%do i = 1 %to %eval(&numzeroes-1);

%macro EstimateStatement(numsubjects=);

%local i;

proc glimmix data=procdata;
class subject;
model billing_count=period_count / dist=NB link=log
solution ddfm=betwithin;
random intercept period_count / sub=subject type=AR(1);
random _residual_;

%do i = 1 %to &numsubjects;

estimate "Slope for Code &i" period_count 1 | period_count 1 / subject %Zeroes(&i);


ods output estimates=sscoeff;


Any help on making this model more accurate and efficient would be greatly appreciated!

Last edited:


Omega Contributor
I probably wont be much help, but if period_count is significant and its test statistic value is positive - isn't that evidence of a positive trend? Because you could rename the variable time and it would mean the same thing, correct.

Have you plotted the subjects as well, count value at each time point. Not sure how many subjects you have, but many times you can also see the positive trend with these plots.
It is evidence of a positive trend but I think it is unlikely that ALL of my subjects demonstrate a significant increase over time.

I have a very large number of subjects so evaluating the slope individually isn't very feasible.

I've modified my original post to make my question clearer. Thanks for your feedback!


Omega Contributor
Hmm, I haven't work much with longitudinal data nor longitudinal data via glimmix.

How do you define "demonstrating a highly significant increase over time"? Would a slope not equal to zero with a positive test statistic work? If so, I wonder if you can add an estimate or contrast statement to your code comparing a subject to a null value?