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

Hello, 

I am trying to apply linear regression to the data below. Not sure its applicable with the multiple groups in the dosegrp column. Also, I imported the file as CVS. Its original form is excel. Is that why its not working? My file name is HAMA. One of the columns is HAMA. Do I need to change that? I am using SAS 9.4

I have tried using equations in SAS:

proc ree data=work.HAMA;

model dosegrp=hama;

plot dosegrp*hama

 

getting error:  ERROR: Variable dosegrp in list does not match type prescribed for this list.

getting warning:  WARNING: No variables specified for an SSCP matrix. Execution terminating

 

pat_nodosegrpHAMA
101LO21
104LO18
106LO19
112LO28
116LO22
120LO30
121LO27
124LO28
125LO19
130LO23
136LO22
137LO20
141LO19
143LO26
148LO35
103HI16
105HI21
109HI31
111HI25
113HI23
119HI25
123HI18
127HI20
128HI18
131HI16
135HI24
138HI22
140HI21
142HI16
146HI33
150HI21
151HI17
102PB22
107PB26
108PB29
114PB19
117PB33
118PB37
122PB25
126PB28
129PB26
133PB31
134PB27
139PB30
144PB25
145PB22
147PB36
149PB32
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Mathematically speaking, linear regression requires a continuous Y variable. Your Y variable is not continuous, it is a category. In terms of SAS, the y-variable in linear regression must be numeric, but it is character. So, you have chosen the wrong mathematical method and the wrong SAS procedure.


What you really want is logistic regression, which is appropriate for categorical Y variables.

 

proc logistic data=work.HAMA;
    model dosegrp=hama;
run;

 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Mathematically speaking, linear regression requires a continuous Y variable. Your Y variable is not continuous, it is a category. In terms of SAS, the y-variable in linear regression must be numeric, but it is character. So, you have chosen the wrong mathematical method and the wrong SAS procedure.


What you really want is logistic regression, which is appropriate for categorical Y variables.

 

proc logistic data=work.HAMA;
    model dosegrp=hama;
run;

 

--
Paige Miller
Joliek44
Calcite | Level 5

Paige Miller, 

Thank you, that is what I was suspecting all along. Its a homework question that i figured was not right. But thank you for the suggestion of logistic regression, I will use that. 

 

Thanks!

Monica 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 418 views
  • 0 likes
  • 2 in conversation