Coding a text variable into a numeric variable
Minitab can be used to translate or "code" a column of text values into another column of numeric values.
Minitab Procedure
Note: if you have more than one text variable to create, you have to code each one separately. |
ExampleThe data set birthsmokers2.txt contains data on the birthweight (y = Wgt), gestation length (x_{1} = Gest) and mother's smoking status (x_{2} = Smokes, yes or no) of babies born to 32 mothers. If you wanted to fit a multiple regression model that included smoking status, you'd first have to create a numeric variable in your worksheet, dummy say, that equals 1 if Smokes = yes and equals 0 if Smokes = no. Create the dummy variable in your worksheet. |
Minitab Dialog Box Resulting Minitab Worksheet |