# SAS proc mixed Degree of freedom

I have a dataset in this format:

Factor A is a between subject factor (with 2 levels - High and Low). Factor B is a within subject factor (with 3 levels - High , Moderate and Low).

I want to run a mixed model with nested random effects factor.

The code that I am using is:

proc mixed data=data.mydata;
class FactorA FactorB;
model DV = FactorA|FactorB;
random FactorB(FactorA) FactorB*FactorA(FactorA);
lsmeans FactorA|FactorB;
run;


The log states: Estimated G matrix is not positive definite. I also do not get any of the p-values (only a '.' is displayed).

Furthermore in the output tables, I see that DF = 0. I have a hunch that this is what is symptomatic of the error. But I have been unable to figure out why this is happening. Any leads will be appreciated. Thanks.

• You have only 9 observations and you are trying to estimate way more than 9 parameters. You need replications or a simpler model. – rvl Jun 26 '18 at 1:00
• I have about 300 observations. The dataset was for reference. I should have mentioned that in the question. – Prometheus Jun 26 '18 at 3:45
• Even so, it looks to me like the model you are trying to fit is too complicated for the data that you have. It isn't even clear to me exactly how you are trying to model this data. You have factor A and B as fixed effects with an interaction, but also as nested random effects? Factor B is nested in Factor A, and the interaction of Factor A and B is also somehow nested in Factor A? I am struggling to see how your specification of the random statement could be identified. – Ryan Simmons Jun 26 '18 at 13:27
• Perhaps you should back up and be more clear about what your data is and what questions you are trying to answer with this model. Because I can't possibly see how such a random effects specification could make sense. – Ryan Simmons Jun 26 '18 at 13:29
• @RyanSimmons Agreed. I should have more more clearer. I will add it after the required information at the end of my original question. Thanks a lot for your helpful comments. – Prometheus Jun 26 '18 at 15:13

model DV = ;