Help using Base SAS procedures

Problem with PROC GAM

Accepted Solution Solved
Reply
Contributor
Posts: 36
Accepted Solution

Problem with PROC GAM

Hello,

I apply the Generalized Additive Models to this model : money = year + job

my response variable is continuous (money) and the other variable is not continuous (job). This is what I did with SAS :

 

proc gam data=mydata;
model money = spline(year) spline(job);
output out=estimates p;
run;

But I got this error :

ERROR: Variable JOB in list does not match type prescribed for this list.

How can I fix it ?


Accepted Solutions
Solution
‎04-18-2017 09:30 AM
Trusted Advisor
Posts: 1,611

Re: Problem with PROC GAM

[ Edited ]

If JOB is not contnuous (it's a character variable), you can't fit a spline through it. That is a meaningless idea.

View solution in original post


All Replies
Super User
Posts: 9,676

Re: Problem with PROC GAM

"the other variable is not continuous (job)."

Is it character variable ? Put them in CLASS statement.

Also try PROC ADAPITIVE + CLASS .

Contributor
Posts: 36

Re: Problem with PROC GAM

Yes, Job is a character variable (Credit Analyst, Treasurer, Secretary, ect.).

I edited my SAS code like this

proc gam data=mydata;
class job;
model money = spline(year) spline(job);
output out=estimates p;
run;

I always got this error :

ERROR: Variable JOB in list does not match type prescribed for this list.
ERROR: A MODEL statement is required.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GAM used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

What is PROC ADAPITIVE + CLASS ?

Solution
‎04-18-2017 09:30 AM
Trusted Advisor
Posts: 1,611

Re: Problem with PROC GAM

[ Edited ]

If JOB is not contnuous (it's a character variable), you can't fit a spline through it. That is a meaningless idea.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 183 views
  • 4 likes
  • 3 in conversation