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

My codes are:

DATA Ch2_14; 

INPUT ratio $ viscosity; 

CARDS; 

1.0 0.45 

0.9 0.20 

0.8 0.34 

0.7 0.58 

0.6 0.70 

0.5 0.57 

0.4 0.55 

0.3 0.44 

; 

RUN; 

proc Reg data = CH2_14;
	model  ratio = viscosity;
 run;

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

How to fix my code?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Ratio is a character variable, as seen by the $ when you INPUT ratio. You can't perform a linear regression on character variables.

 

Remove the $ and try your code again.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Ratio is a character variable, as seen by the $ when you INPUT ratio. You can't perform a linear regression on character variables.

 

Remove the $ and try your code again.

--
Paige Miller
data_null__
Jade | Level 19
Get rid of the $sign in the INPUT statement.
Reeza
Super User
You're reading in Ratio with a $ which means SAS will read that in as a character variable. SAS will not use character variables in regression because that doesn't make sense. Remove the $ to read it in as a numeric and you should be fine.