BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

Hi all, today, when I try to run a regression by using PROC GLM, I face this problem

ERROR: Number of levels for some effects > 32767.

My code is

libname input 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\leniency & operating\datasas' access=readonly;
proc copy inlib=input outlib=work mt=data;
run;

proc glm data=work.merge_treat_con;
    class type yr;
    model wtot_ass_tur = pt type yr/solution ss3;
run;
quit;

I am wondering what does this mean regarding the word "levels" mean in this error? And how come we overcome this limitation or any alternative solution?

 

Warmest regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
CLASS statement is for categorical variables. It's saying one of your categorical variables, type or YR has more than 32k unique values which means it's likely not categorical and doesn't belong in the CLASS statement.

When learning a procedure, first work through the examples in the documentation, then search on lexjansen.com for that procedure and the term workshop or tutorial to learn about it.

View solution in original post

7 REPLIES 7
StatDave
SAS Super FREQ
The "levels" of a variable just means the distinct values of the variable in the data. From this and your previous post about "fixed effects" I assume you mean a model which avoids estimation of parameters for the many levels in that variable. You can do that using the ABSORB statement. Details on this and other fixed effects models are in the book "Fixed Effects Regression Methods for Longitudinal Data Using SAS" (Allison, P., SAS Institute, 2005).
Phil_NZ
Barite | Level 11

Hi @StatDave 

 

Thank you for your reply. However,is there any accessible source online for this book (like SAS documents) or I need to buy this book, I try to search from my school's library but there is no book like this available.

 

My97_0-1613689315565.png

 

I did search via your link previously from this discussion(https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/td-p/171442)

but it does not work now 

My97_0-1613689776438.png

 

 

Warm regards.

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
StatDave
SAS Super FREQ
I believe you can still find it if you do an internet search
Phil_NZ
Barite | Level 11

Hi @StatDave 

I promise that I already searched for a while but there is no pdf version available.

Is there any help from the SAS community...I really want to learn and broaden my knowledge.

 

Warmest regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
StatDave
SAS Super FREQ
That's the one.
Reeza
Super User
CLASS statement is for categorical variables. It's saying one of your categorical variables, type or YR has more than 32k unique values which means it's likely not categorical and doesn't belong in the CLASS statement.

When learning a procedure, first work through the examples in the documentation, then search on lexjansen.com for that procedure and the term workshop or tutorial to learn about it.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 7 replies
  • 1086 views
  • 5 likes
  • 3 in conversation