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

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
主站蜘蛛池模板: 桦甸市| 财经| 阿合奇县| 通榆县| 宣恩县| 方城县| 永川市| 武陟县| 曲阜市| 江西省| 七台河市| 乐清市| 石楼县| 太白县| 保靖县| 台湾省| 九龙坡区| 迁安市| 新丰县| 沁水县| 新宁县| 金华市| 黔西县| 南和县| 崇仁县| 攀枝花市| 龙井市| 通江县| 永济市| 兰考县| 万州区| 武隆县| 中江县| 新竹县| 景宁| 巨鹿县| 页游| 龙岩市| 永善县| 呼和浩特市| 金阳县|