BookmarkSubscribeRSS Feed
joachimg
Obsidian | Level 7

Hi all. Running logistic regression with proc surveylogistic and I'm having trouble setting my references for the different variables. This is my code:

 

proc surveylogistic data=masks1;
weight wt_multi;
class d_age_cat2(ref=”0”) d_gender (ref=”MALE”) d_race (ref=”NH White”) d_politics(ref=”DEM“) d_religion2(ref=”NOTHING”) vaxxed(ref=”0”);
model b2_m_always (descending) = age gender race politics religion vaxxed;
run;

 

And the error message I'm getting:

 

103
104 proc surveylogistic data=masks1;
105 weight wt_multi;
106 class d_age_cat2(ref=”0”) d_gender (ref=”MALE”) d_race (ref=”NH White”) d_politics(ref=”DEM“)
_______ __________ _____ _________
_____________
22 22 22 22
22
202 202 202 202
202
106 ! d_religion2(ref=”NOTHING”) vaxxed(ref=”0”);
106 class d_age_cat2(ref=”0”) d_gender (ref=”MALE”) d_race (ref=”NH White”) d_politics(ref=”DEM“)
106 ! d_religion2(ref=”NOTHING”) vaxxed(ref=”0”);
_______
22
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, FIRST, LAST.
 
ERROR 202-322: The option or parameter is not recognized and will be ignored.
 
106 class d_age_cat2(ref=”0”) d_gender (ref=”MALE”) d_race (ref=”NH White”) d_politics(ref=”DEM“)
106 ! d_religion2(ref=”NOTHING”) vaxxed(ref=”0”);
_______
202
ERROR 202-322: The option or parameter is not recognized and will be ignored.
 
NOTE: PROCEDURE SURVEYLOGISTIC used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 1830.65k
OS Memory 28324.00k
Timestamp 08/30/2021 11:42:09 PM
Step Count 63 Switch Count 0
Page Faults 0
Page Reclaims 243
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
NOTE: The SAS System stopped processing this step because of errors.
107 model b2_m_always (descending) = age gender race politics religion vaxxed;
108 run;
109
110
111 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
121
 
Any help is much appreciated. Proc surveylogistic has really been messing with me......anyways. Thanks in advance. 
1 REPLY 1
ballardw
Super User

First thing: best practice is to copy/paste text from log into a text box opened on the forum using the </> icon at the top of the message window. This will preserve the text as created. The message windows on this forum will reformat text, such as moving the locations of the diagnostic characters like the underscores that appear under the place SAS determined an error occurs.

 

Second:

Look very closely at your posted code:

106 class d_age_cat2(ref=0) d_gender (ref=”MALE”) d_race (ref=”NH White”) d_politics(ref=”DEM“)
_______ __________ _____ _________
 
This is the typical programming double quote character: " The quotes you are using are the "smart quotes" that use curly tails and are not recognized as a valid quote for programming in SAS. Change them. Everywhere.
 
Likely sources of non-programming quotes are if you copied code from a word processor or web page, or used a word processor to create a code file.
 
I didn't check to see if had bad single quotes but they can occur as well.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 368 views
  • 0 likes
  • 2 in conversation