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_no | dosegrp | HAMA |
101 | LO | 21 |
104 | LO | 18 |
106 | LO | 19 |
112 | LO | 28 |
116 | LO | 22 |
120 | LO | 30 |
121 | LO | 27 |
124 | LO | 28 |
125 | LO | 19 |
130 | LO | 23 |
136 | LO | 22 |
137 | LO | 20 |
141 | LO | 19 |
143 | LO | 26 |
148 | LO | 35 |
103 | HI | 16 |
105 | HI | 21 |
109 | HI | 31 |
111 | HI | 25 |
113 | HI | 23 |
119 | HI | 25 |
123 | HI | 18 |
127 | HI | 20 |
128 | HI | 18 |
131 | HI | 16 |
135 | HI | 24 |
138 | HI | 22 |
140 | HI | 21 |
142 | HI | 16 |
146 | HI | 33 |
150 | HI | 21 |
151 | HI | 17 |
102 | PB | 22 |
107 | PB | 26 |
108 | PB | 29 |
114 | PB | 19 |
117 | PB | 33 |
118 | PB | 37 |
122 | PB | 25 |
126 | PB | 28 |
129 | PB | 26 |
133 | PB | 31 |
134 | PB | 27 |
139 | PB | 30 |
144 | PB | 25 |
145 | PB | 22 |
147 | PB | 36 |
149 | PB | 32 |
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;
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,
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.