BookmarkSubscribeRSS Feed
K_Wils15
Obsidian | Level 7

Here is what I am trying to solve for:

Using the data set HW4D1, fit a log-linear negative-binomial regression modeling the number of home runs a player hit in the 1986 season (i.e. variable nhome), with the explanatory variable salary.  

Here is my code:

PROC IMPORT OUT= WORK.BASEBALL
DATAFILE= "C:\Users\kpwil\Downloads\HW4D1 (4).xlsx"
DBMS=EXCEL REPLACE;
RANGE="'HW4D1 (4)$'";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
proc print data= Baseball;
run;

proc logistic data=baseball desc;
model y = nHome ;
run;

 

 

The output has an error: ERROR: VARIABLE Y NOT FOUND

 

It reads the data because I did a proc print and it came out fine, what should I do? 

2 REPLIES 2
CurtisMackWSIPP
Lapis Lazuli | Level 10

Is the variable really named "Y"?

K_Wils15
Obsidian | Level 7

no thanks, that is where I was incorrect there because I took the code from an example and I thought y was used as part of an equation. I actually needed to use proc genmod too. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 774 views
  • 2 likes
  • 2 in conversation