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

Hello,

 

 @Kurt_Bremser and @art297 helped me with some code to define a dummy variable which was 1 if a company's annual return had increased from the previous year and 0 otherwise.

 

I want to interact this term with annual_return in my model so that I can test the hypothesis that executives will be rewarded when the company does well but to be insulated from downturns in performance (if the compensation contract is constructed to encourage risk-taking behavior).

 

Running what I thought to be the appropriate model, however, I ran into two error messages, which I don't understand. Here is the log:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
71
72 ***OLS REGRESSION***
73 title "";
74 ods graphics on;
75 proc reg data=paper.ceo_firm plots(maxpoints=none);
76 model salary = annual_return annual_return*increase/clb acov;
_
22
200
NOTE: The previous statement has been deleted.
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_, {.
ERROR 200-322: The symbol is not recognized and will be ignored.
77 run;
 
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 3410.18k
OS Memory 34752.00k
Timestamp 04/02/2018 02:56:14 PM
Step Count 77 Switch Count 0
Page Faults 0
Page Reclaims 473
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 48
 
 
78 ods graphics off;
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
92
 
 
any help is appreciated!

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

PROC REG does not allow interactions via the X1*X2 syntax.

 

Use PROC GLM instead. (And in PROC GLM, you don't need to create a column of dummy variables, you can use the CLASS statement instead).

--
Paige Miller

View solution in original post

8 REPLIES 8
PaigeMiller
Diamond | Level 26

PROC REG does not allow interactions via the X1*X2 syntax.

 

Use PROC GLM instead. (And in PROC GLM, you don't need to create a column of dummy variables, you can use the CLASS statement instead).

--
Paige Miller
sastuck
Pyrite | Level 9

is there more to do than just substituting reg with glm?

 

here's my new log.

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
71
72 ***OLS REGRESSION***
73 title "";
74 ods graphics on;
75 proc glm data=paper.ceo_firm plots(maxpoints=none);
76 model salary = annual_return annual_return*increase/clb acov;
___
22
202
ERROR: Variable increase not found.
NOTE: The previous statement has been deleted.
ERROR 22-322: Syntax error, expecting one of the following: ;, ALIASING, ALPHA, CLI, CLM, CLPARM, COVBYCLASS, E, E1, E2, E3, E4,
EST, I, INTERCEPT, INVERSE, NOINT, NOUNI, P, PREDICTED, SINGULAR, SOLUTION, SS1, SS2, SS3, SS4, TOLERANCE, X, XPX,
ZETA.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
77 run;
 
78 ods graphics off;
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
92
 
 
and how does the class statement work?
 
Thanks!
PaigeMiller
Diamond | Level 26

The error message says that INCREASE is not a variable in data set paper.ceo_firm.

 

So you can't use INCREASE until you create it in paper.ceo_firm

--
Paige Miller
sastuck
Pyrite | Level 9

Ah, I didn't realize I had to re-run the datastep after logging back into SAS. The other error messages are still present, however. 

PaigeMiller
Diamond | Level 26

Show us the SASLOG so we can see these other error messages after you fixed the first error.

--
Paige Miller
sastuck
Pyrite | Level 9

Here you are:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
71
72 ***OLS REGRESSION***
73 title "";
74 ods graphics on;
75 proc glm data=paper.ceo_firm plots(maxpoints=none);
76 model salary = annual_return annual_return*increase/clb acov;
___
22
202
NOTE: The previous statement has been deleted.
ERROR 22-322: Syntax error, expecting one of the following: ;, ALIASING, ALPHA, CLI, CLM, CLPARM, COVBYCLASS, E, E1, E2, E3, E4,
EST, I, INTERCEPT, INVERSE, NOINT, NOUNI, P, PREDICTED, SINGULAR, SOLUTION, SS1, SS2, SS3, SS4, TOLERANCE, X, XPX,
ZETA.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
77 run;
 
78 ods graphics off;
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
92
 

 

 

PaigeMiller
Diamond | Level 26

there is no CLB or ACOV option in PROC GLM.

 

From now on, please paste code and SASLOGs by first clicking on the "running Man" or "Insert SAS Code" icon. This will preserve spacing and make the code and SASLOGs much easier to read.

--
Paige Miller
sastuck
Pyrite | Level 9

Note taken. Thanks so much for the help!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 8 replies
  • 2035 views
  • 1 like
  • 2 in conversation