官术网_书友最值得收藏!

  • Minitab Cookbook
  • Isaac Newton
  • 348字
  • 2021-07-16 12:29:20

Coding a numeric column to text values

In the pulse worksheet, the Activity column lists the usual level of activity of the students in the study, where 1 denotes slight activity, 2 is moderate activity, and 3 stands for a lot of activity.

We will change the numeric values of Activity from 1, 2, and 3 into Slight, Moderate, and High.

Getting ready

Use File and Open Worksheet to open the pulse.mtw dataset worksheet from the sample Minitab data folder.

How to do it…

The following instructions will convert the values of 1, 2, and 3 in the Activity column to Slight, Moderate, and High:

  1. In the Data menu, navigate to Code | Numeric to Text.
  2. Enter the Activity column into Code data from columns.
  3. Enter the Activity column into the section Store coded data in columns.
  4. In the Original values section, enter 1 in the first line, 2 in the second line, and 3 in the third line, as shown in the following screenshot:
  5. In the New section, enter Slight in the first line, Moderate in the second line, and High in the third line.
    How to do it…
  6. Click on OK.

How it works…

The code tools work like an IF statement. The code tools cannot be set as an updating formula in the worksheet like the IF statements can be set from the calculator.

In this example, we are replacing the numeric values in the Activity column and putting the new results back into the same column. This will change the data type of the Activity column from Numeric to Text.

There's more…

Ranges of numbers can be entered using colons. If we wish to change the values from 0 to 30 as low, 30 to 60 as medium, and 60 and above as high, then we would enter these as shown in the following screenshot:

There's more…

The code tool does not accept symbols such as >, <, or =, and therefore, we can use a large number, such as 100000, to create a greater than statement.

See also

  • The Calculator – using an if statement recipe
主站蜘蛛池模板: 那坡县| 陵川县| 安阳市| 闻喜县| 大同市| 霍州市| 东阳市| 郧西县| 田东县| 遂平县| 南溪县| 德格县| 西和县| 连山| 永定县| 包头市| 西藏| 大名县| 读书| 西吉县| 石泉县| 永吉县| 南涧| 乌拉特中旗| 青海省| 玉林市| 泸溪县| 抚顺市| 华亭县| 贵溪市| 桑植县| 鄂托克前旗| 博湖县| 龙游县| 吉林市| 庄浪县| 太康县| 柏乡县| 越西县| 扶余县| 镇雄县|