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

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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

--
Paige Miller

View solution in original post

3 REPLIES 3
Ksharp
Super User

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

Is it character variable ? Put them in CLASS statement.

Also try PROC ADAPITIVE + CLASS .

John4
Obsidian | Level 7

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 ?

PaigeMiller
Diamond | Level 26

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

--
Paige Miller

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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