BookmarkSubscribeRSS Feed
edasdfasdfasdfa
Quartz | Level 8

Hello,

 

Here is my code. The response variable is L_Status and it is binary (0,1) but I keep getting an error in regards to event=1 and ref=1.

Error code is below.

 

 

 proc logistic data = traina;
class Gender Married N_Dependents Self_Employed Property Education (ref='1')/ param = ref;
model L_Status (event='1') = Credit_History N_Dependents Self_Employed L_Amount_Term Gender Married Property L_Amount Education Applicant Co_Applicant;
run;

 

ERROR: Class event parameter "1" not known.
NOTE: Procedure logistic step took :
real time : 0.002
cpu time : 0.000


351 quit; run;
352 ODS _ALL_ CLOSE;
353 ODS _ALL_ CLOSE;
354 FILENAME WPSWBHTM TEMP;
NOTE: Writing HTML(WBHTML) BODY file C:\Users\ededic84\AppData\Local\Temp\WPS Temporary
Data\_TD576\#LN00015
355 ODS HTML(ID=WBHTML) BODY=WPSWBHTM GPATH="C:\Users\...
355 ! orary Data\_TD576";
356 proc logistic data = traina;
357 class Gender Married N_Dependents Self_Employed Property Education (ref='1')/ param =
357 ! ref;
358 model L_Status (event='1') = Credit_History N_Dependents Self_Employed L_Amount_Term
358 ! Gender Married Property L_Amount Education Applicant Co_Applicant;
359 run;
ERROR: Class event parameter "1" not known.

11 REPLIES 11
Rajesh3
Obsidian | Level 7

The error, I suspect is for your 'Education' variable in the class statement.

 

Thanks,

Rajesh.

edasdfasdfasdfa
Quartz | Level 8

Hi Rajesh,

 

That is not it. I still get the same error.

 

Not sure why that would have been a problem?

 

 

Rajesh3
Obsidian | Level 7

You can also try this code instead if your outcome is coded as a numeric variable with 0 and 1.

 

 proc logistic data = traina desc;
class Gender Married N_Dependents Self_Employed Property Education (ref='1')/ param = ref;
model L_Status = Credit_History N_Dependents Self_Employed L_Amount_Term Gender Married Property L_Amount Education Applicant Co_Applicant;
run;

Thanks,

Rajesh.

edasdfasdfasdfa
Quartz | Level 8
Sorry. That does not work. That is tough pretty much the same as my code.
Rajesh3
Obsidian | Level 7

So you mean, you got the same error when using the code I posted?

 

I removed event='1' from your code and added 'desc' option in the first statement.

 

Thanks,

Rajesh.

edasdfasdfasdfa
Quartz | Level 8

Hi Rajesh,

 

When I remove event='1' it says Class reference parameter 1 not known.

 

Basically, it is now complaining about the  (ref='1')/ param =
ref; part

ballardw
Super User

@edasdfasdfasdfa wrote:

Hello,

 

Here is my code. The response variable is L_Status and it is binary (0,1) but I keep getting an error in regards to event=1 and ref=1.

Error code is below.

 

 

 proc logistic data = traina;
class Gender Married N_Dependents Self_Employed Property Education (ref='1')/ param = ref;
model L_Status (event='1') = Credit_History N_Dependents Self_Employed L_Amount_Term Gender Married Property L_Amount Education Applicant Co_Applicant;
run;

 

ERROR: Class event parameter "1" not known.
NOTE: Procedure logistic step took :
real time : 0.002
cpu time : 0.000


351 quit; run;
352 ODS _ALL_ CLOSE;
353 ODS _ALL_ CLOSE;
354 FILENAME WPSWBHTM TEMP;
NOTE: Writing HTML(WBHTML) BODY file C:\Users\ededic84\AppData\Local\Temp\WPS Temporary
Data\_TD576\#LN00015
355 ODS HTML(ID=WBHTML) BODY=WPSWBHTM GPATH="C:\Users\...
355 ! orary Data\_TD576";
356 proc logistic data = traina;
357 class Gender Married N_Dependents Self_Employed Property Education (ref='1')/ param =
357 ! ref;
358 model L_Status (event='1') = Credit_History N_Dependents Self_Employed L_Amount_Term
358 ! Gender Married Property L_Amount Education Applicant Co_Applicant;
359 run;
ERROR: Class event parameter "1" not known.


What are the actual values of your EDUCATION variable?

edasdfasdfasdfa
Quartz | Level 8

Figured it out. For some reason my response variable was still character. I just converted it to numeric.

ballardw
Super User

@edasdfasdfasdfa wrote:

Figured it out. For some reason my response variable was still character. I just converted it to numeric.


Class variables can be character you just need to address the reference level correctly, such as the full text of a value or use keywords FIRST or LAST, though sort order of character may not yield the desired order until familiar with character sorting.

edasdfasdfasdfa
Quartz | Level 8

Hello ballardw,

 

Can you give me an example of what you mean? (how it can be handled another way).

 

also, is it ok how I addressed it? (converting it?)

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 1746 views
  • 0 likes
  • 3 in conversation