Help using Base SAS procedures

Non linearity in regression

Reply
Contributor
Posts: 69

Non linearity in regression

Hello

 

I try to check nonlinearity in the regression by using square in one of my variable (fownff)

 

My code is:

proc glm data=sasuser.sasfile060716;

class firmno sector year industry;

model roa = fownff fownff**2 salesGro RDAssets LTassets LNAssetsindustry year

/solution;

run;

 

But the log I got is:

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, *, -, /, @, _CHARACTER_, _CHAR_, _NUMERIC_, |.

ERROR 200-322: The symbol is not recognized and will be ignored.

 

As far as I know, this is the way to check linearity.

 

I appreciate your help to explain what is my mistake

 

Thanks a lot!

 

 

 

 

Super User
Posts: 10,046

Re: Non linearity in regression


model roa = fownff    fownff*fownff   salesGro RDAssets LTassets LNAssetsindustry year


I suggest you check PROC LOESS 
Contributor
Posts: 69

Re: Non linearity in regression

Thanks for your reply, but I got the same LOG answer with your proposal

 

Respected Advisor
Posts: 4,934

Re: Non linearity in regression

X*Y is accepted in proc reg model specification as a polynomial effect. @Ksharp's suggestion should work. Please post your log.

PG
Super User
Posts: 19,870

Re: Non linearity in regression

Your code should look like the following. Note that you have variables in your CLASS statement that are not in your model statement. Not sure why you have them present. 

 

proc glm data=sasuser.sasfile060716;
class firmno sector year industry;
model roa = fownff fownff*fownff salesGro RDAssets LTassets LNAssetsindustry year
/solution;
run;

As stated, if something doesn't work please post the code and log. We can't help with 'things don't work'. 

Ask a Question
Discussion stats
  • 4 replies
  • 259 views
  • 3 likes
  • 4 in conversation