Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Proc Mixed, G matrix warning, remove solutions from replications?

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-22-2019 10:50 AM
(727 views)

I am using SAS 9.4

I am running a proc Mixed and saving the group level residuals for analysis. I am running 1000 replications. Some of the runs result in a estimated G matrix is not positive definite. I understand why this is happening.

Questions:

1. is there a way to report how many of the replications are resulting in the 'estimated G matrix is not positive definite'?

2. is there a way to remove the resulting residual solutions for these cases from the 'solutionr' file?

Is there a way to remove the results from the fit statistics as well?

3. is there a way to continue the replications so the total is 1000 excluding those that result in the non-positive definite matrix?

here is my code (iter=replication number). :

proc mixed data=fulltestdata covtest;

by iter;

class idt idk wave;

model y = wave / noint s residual ;

random wave / sub=idt type=un g gcorr solution;

repeated wave / sub=idk(idt) type=un r rcorr;

ods graphics off; ods output fitstatistics=fit solutionr=MMtchres;

run;

Sample from the log:

NOTE: Convergence criteria met.

NOTE: The above message was for the following BY group:

iter=731

NOTE: Convergence criteria met.

NOTE: The above message was for the following BY group:

iter=732

NOTE: Convergence criteria met.

NOTE: The above message was for the following BY group:

iter=733

NOTE: Convergence criteria met.

NOTE: Estimated G matrix is not positive definite.

NOTE: The above message was for the following BY group:

iter=734

NOTE: Convergence criteria met.

NOTE: The above message was for the following BY group:

iter=735

NOTE: Convergence criteria met.

NOTE: The above message was for the following BY group:

iter=736

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

When you use ODS OUTPUT, it creates a SAS data set which contains "non-printing columns" for the table.

In particular, if you look at the variables in the ConvergenceStatus table (PROC CONTENTS), you will see that one of the variables is

pdG which stands for "positive definite gradient."

This is a binary indicator variable. You can use a WHERE clause such as

WHERE=(pdG = 1)

to obtain only the samples for which the gradient at the solution was positive definite.

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks. The model did converge so the Convergence status table with reasons doesn't help.

The log:

222

223 proc mixed data=fulltestdata covtest;

224 by iter;

225 class idt idk wave;

226 model y = wave / noint s residual ;

227 random wave / sub=idt type=un g gcorr solution;

228 repeated wave / sub=idk(idt) type=un r rcorr;

229

230 ods graphics off; ods output fitstatistics=fit solutionr=MMtchres ConvergenceStatus=CS;

231 run;

NOTE: Convergence criteria met.

NOTE: Estimated G matrix is not positive definite.

NOTE: The above message was for the following BY group:

iter=1

NOTE: Convergence criteria met.

NOTE: Estimated G matrix is not positive definite.

NOTE: The above message was for the following BY group:

iter=2

NOTE: The data set WORK.CS has 2 observations and 5 variables.

NOTE: The data set WORK.MMTCHRES has 90 observations and 9 variables.

NOTE: The data set WORK.FIT has 8 observations and 3 variables.

NOTE: PROCEDURE MIXED used (Total process time):

real time 0.64 seconds

cpu time 0.61 seconds

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

When you use ODS OUTPUT, it creates a SAS data set which contains "non-printing columns" for the table.

In particular, if you look at the variables in the ConvergenceStatus table (PROC CONTENTS), you will see that one of the variables is

pdG which stands for "positive definite gradient."

This is a binary indicator variable. You can use a WHERE clause such as

WHERE=(pdG = 1)

to obtain only the samples for which the gradient at the solution was positive definite.

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

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.