BookmarkSubscribeRSS Feed
sks521
Quartz | Level 8

Hi folks,

 

I am doing difference-in-differences analysis by using Proc Mixed as follow;

 

PROC MIXED DATA = diff1;
CLASS POST EXPOSED;
MODEL VISIT=POST|EXPOSED / SOLUTION ;
LSMEANS POST|EXPOSED / DIFF;
ESTIMATE 'D-I-D' EXPOSED*POST 1 -1 -1 1;
REPEATED /SUBJECT=PKID TYPE=UN ;
FORMAT EXPOSED STATUS. POST PERIOD.;
TITLE2 "RANDOM INTERCEPT MODEL FOR PRE/POST GP Visits by EXPOSURE GROUP";
TITLE3 "UNADJUSTED: INCLUDING LEAST-SQUARES MEANS ESTIMATES";
RUN;

 

But I am getting the following log;

 

{334 PROC MIXED DATA = diff1;
335 CLASS POST EXPOSED;
336 MODEL VISIT=POST|EXPOSED / SOLUTION;
337 LSMEANS POST|EXPOSED / DIFF;
338 ESTIMATE 'D-I-D' EXPOSED*POST 1 -1 -1 1;
339 RANDOM INT/SUBJECT=PKID TYPE=UN ;
340 FORMAT EXPOSED STATUS. POST PERIOD.;
341 TITLE2 "RANDOM INTERCEPT MODEL FOR PRE/POST ADHERENCE by EXPOSURE GROUP";
342 TITLE3 "UNADJUSTED: INCLUDING LEAST-SQUARES MEANS ESTIMATES";
343 RUN;

NOTE: Convergence criteria met but final Hessian is not positive definite.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.07 seconds
cpu time 0.06 seconds

}

 

And it's not giving any p-values in the output tables.

 

Can someone have a look and advise please?

 

Thanks

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Go to your favorite search engine and type in

 

Hessian not positive definite

--
Paige Miller
sks521
Quartz | Level 8

Actually I did that before posting the query on here.

 

It brings me to this forum where someone has posted a reply saying that either the model doesn't fit or the sample size is too small.

 

I am assuming my sample size is not too small (depending on what 'too small' means).

 

Not sure how to assess model fit?

 

 

So, I thought to post it on here.

 

Thanks.

Rick_SAS
SAS Super FREQ

For an overview of this issue, see

"Convergence in mixed models: When the estimated G matrix is not positive definite"

which includes tips and links to papers and SAS Notes that you can read for more information.

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 850 views
  • 0 likes
  • 3 in conversation