Help using Base SAS procedures

PROC MIXED doesn't recognize all levels of class

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

PROC MIXED doesn't recognize all levels of class

The problem:

In PROC MIXED, I defined several classes under 'class'.

One of them, called 'Status', has two levels, coded as '1' and '2' (i.e. the column for these data consists of ones and twos).

When I run the program, the output states that the class 'Status' has one level, and that it's value is '2'

This happens even though I have several other classes with two levels coded as '1' and '2', (i.e., as for Status, the data are columns of ones and twos), for which the output correctly states that each of these classes has two levels, with the values '1' and '2'.

Anyone know how I can fix this?

PS: The data come from an Excel file, which I opened in SPSS and then saved with the .sas7bdat extension

PPS: I've already tried removing the entire 'Status' column in Excel and rewriting it. I've also tried coding the levels as letters (e.g. 'C' and 'P'), but the problem remains.


Accepted Solutions
Solution
‎05-23-2014 11:17 AM
Super User
Posts: 10,460

Re: PROC MIXED doesn't recognize all levels of class

Many of the modeling procs will exclude records if any of the independent variables are missing. By any chance are other variables, alone or in combination, in the model missing for all of records with Status=2?

One of the output tables should also mention how many records were used. Does this match the number in your input data set?

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: PROC MIXED doesn't recognize all levels of class

One quick check would be to do a proc freq and see if it gives two values.  My initial guess is that all of one category is being excluded, either in a data step prior to analysis or by use of a WHERE statement.

Steve Denham

Solution
‎05-23-2014 11:17 AM
Super User
Posts: 10,460

Re: PROC MIXED doesn't recognize all levels of class

Many of the modeling procs will exclude records if any of the independent variables are missing. By any chance are other variables, alone or in combination, in the model missing for all of records with Status=2?

One of the output tables should also mention how many records were used. Does this match the number in your input data set?

New Contributor
Posts: 3

Re: PROC MIXED doesn't recognize all levels of class

"By any chance are other variables, alone or in combination, in the model missing for all of records with Status=2?"

This was indeed the case. Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 170 views
  • 0 likes
  • 3 in conversation