- 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
:
- In the Data menu, navigate to Code | Numeric to Text.
- Enter the
Activity
column into Code data from columns. - Enter the
Activity
column into the section Store coded data in columns. - In the Original values section, enter
1
in the first line,2
in the second line, and3
in the third line, as shown in the following screenshot: - In the New section, enter
Slight
in the first line,Moderate
in the second line, andHigh
in the third line. - 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:

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
- 自愿審計動機與質量研究:基于我國中期財務報告審計的經驗證據
- 博弈論及其在經濟管理中的應用
- 項目管理(第二版)
- 注冊會計師全國統一考試專用教材:審計
- Learning Informatica PowerCenter 9.x
- Metabase Up and Running
- 陜西文物年鑒·2015
- 大數據搜索與挖掘及可視化管理方案 :Elastic Stack 5:Elasticsearch、Logstash、Kibana、X-Pack、Beats (第3版)
- 企業內部審計全流程指南
- 政策建模技術:CGE模型的理論與實現
- Learn Power Query
- Implementing VMware Horizon 7.7
- Microsoft Dynamics CRM 2016 Customization(Second Edition)
- INSTANT IBM Lotus Notes 8.5.3 How-to
- 統計原理與實務