Programming the statistical procedures from SAS

Categorical variables have an identical level

Reply
Frequent Contributor
Posts: 131

Categorical variables have an identical level

I have a tricky question regarding a dataset. The dataset has 4 categorical variables with various categories. The trick thing is that they have one identical level (ie. 100% percectly correlated for this level).

This caused a problem for running a linear model. SAS said the matrix is singular and the estimate is not unique.

Is there any good idea to deal with this level?

Thanks in advance.

PROC Star
Posts: 7,417

Categorical variables have an identical level

Are you saying that, for one variable, every record has the same value and/or that everyone in the same group has the same value?  If so, why not just drop that variable from your analysis?

Frequent Contributor
Posts: 131

Categorical variables have an identical level

Thanks for your suggestion, art297.

The variables are not 100% perfectly correlated. Just a level of them. So I cannot remove variables.

I found a way to deal with that:

1) recode the levels of variables into 0, -1, 1 (effect coding);

2) Only keep one of the correlated levels in the final model.

SAS Super FREQ
Posts: 3,556

Categorical variables have an identical level

I'm going to guess that all variables in the model are class variables and that the "problem" is a note that says:

Note:The X'X matrix has been found to be singular, and a generalized inverse was used to solve the normal equations. Terms whose estimates are followed by the letter 'B' are not uniquely estimable.

If so, there's nothing wrong with your model or data. You just need to understand how to interpret the parameter estimates. See this usage note: http://support.sas.com/kb/22/585.html

If this isn't the problem, post the error message that you get.

Ask a Question
Discussion stats
  • 3 replies
  • 147 views
  • 3 likes
  • 3 in conversation