Manipulating and Calculating Data

Manipulating and Calculating Data Table Of Contents Table Of Contents Calc Menu.......................................................................
Author: Nora Martin
23 downloads 0 Views 381KB Size
Manipulating and Calculating Data

Table Of Contents

Table Of Contents Calc Menu.............................................................................................................................................................................. 5 Overview........................................................................................................................................................................... 5 Calculator ......................................................................................................................................................................... 5 Column Statistics............................................................................................................................................................ 11 Row Statistics ................................................................................................................................................................. 12 Standardize .................................................................................................................................................................... 13 Make Patterned Data...................................................................................................................................................... 14 Make Mesh Data ............................................................................................................................................................ 17 Make Indicator Variables ................................................................................................................................................ 19 Matrices .......................................................................................................................................................................... 20 Random Data and Probability Distributions.................................................................................................................... 22 Data Menu ........................................................................................................................................................................... 45 Manipulating Data Overview .......................................................................................................................................... 45 Subset Worksheet .......................................................................................................................................................... 46 Split Worksheet .............................................................................................................................................................. 50 Merge Worksheets ......................................................................................................................................................... 50 Copy ............................................................................................................................................................................... 56 Unstack Columns ........................................................................................................................................................... 60 Stack/Unstack................................................................................................................................................................. 63 Transpose....................................................................................................................................................................... 68 Sort ................................................................................................................................................................................. 69 Rank ............................................................................................................................................................................... 71 Delete Rows ................................................................................................................................................................... 72 Erase Variables .............................................................................................................................................................. 73 Code ............................................................................................................................................................................... 73 Use Conversion Table .................................................................................................................................................... 76 Change Data Type ......................................................................................................................................................... 77 Extract from Date/Time................................................................................................................................................... 80 Concatenate ................................................................................................................................................................... 81 Display Data ................................................................................................................................................................... 82 Index .................................................................................................................................................................................... 83

Copyright © 2003–2005 Minitab Inc. All rights reserved.

3

Calc Menu

Calc Menu Overview Calculations Overview With the commands in this section, you can: •

calculate mathematical expressions and transformations−see Calculating Mathematical Expressions and Transformations



calculate individual row and column statistics−see Calculating Individual Statistics for Columns and Rows



center and scale columns of data−see Standardizing Data

Calc Menu Calculator - does arithmetic using an algebraic expression, which may contain arithmetic operations, comparison operations, logical operations, and functions Column Statistics - calculates various statistics based on a column you select Row Statistics - calculates various statistics for each row of the columns you select Standardize - centers and scales columns of data Make Patterned Data - provides an easy way to fill a column with numbers or date/time values that follow a pattern. See also Generating Patterned Data Overview for related information. Make Mesh Data - creates a regular (x,y) mesh to use for drawing contour, 3D surface and wireframe plots, with the option to create the z-variable as well Make Indicator Variables - creates indicator (dummy) variables that you can use in regression analysis. See also Generating Patterned Data Overview for related information. Set Base - fixes a starting point for Minitab's random number generator Random Data - displays commands for generating a random sample of numbers, sampled either from columns of the worksheet or from a variety of distributions Probability Distributions - displays commands that allow you to compute probabilities, probability densities, cumulative probabilities, and inverse cumulative probabilities for continuous and discrete distributions Matrices - displays commands for doing matrix operations

Calculator Calculator Calc > Calculator Use the Calculator to do arithmetic operations, comparison operations, logical operations, functions, and column operations. Expressions may include columns, stored constants, numbers, and text, but not matrices. In a calculator expression, you cannot use a hyphen to specify a range of values. For example, Minitab would interpret C1-C4 as C1 minus C4. Note

You can change or access an individual value in a column using the session command LET, documented in Session Command Help. This can be helpful when writing macros. Accessing Individual Elements of a Column describes how to work with a single number in a column.

Dialog box items Store result in variable: Enter a target column or constant where you wish to store the result of the mathematical expression. Expression: Enter the mathematical operation you want Minitab to perform, selecting variables, buttons, and functions to build your expression, observing the Calculator rules. Calculator buttons: For definitions of the calculator buttons, see arithmetic operations (for +, −, ∗, /, **), comparison operations (for =, , , =), and logical operations (for And, Or, Not). Functions: See Calculator Functions for definitions.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

5

Manipulating and Calculating Data

Calculator Functions . Arithmetic

Statistics

Row

Absolute value

Maximum

Maximum (rows)

Ceiling

Mean

Mean (rows)

Floor

Median

Median (rows)

Incomplete gamma

Minimum

Minimum (rows)

Gamma function

N missing

N missing (rows)

Log gamma

N nonmissing

N nonmissing (rows)

MOD

N total

N total (rows)

Partial products

Normal scores

Range (rows)

Partial sums

Std. dev.

Std. dev. (rows)

Round

Sum

Sum (rows)

Signs

Sum of sq.

Sum of sq. (rows)

Date/Time

Trigonometry

Column

Current time

Arccosine

Lag

Date (from text)

Arcsine

Rank

Date (from value)

Arctangent

Sort

Now

Cosine

Time (from text)

Degrees

Log

Time (from value)

Radians

Antilog

Today

Sine

Exponentiate

When (from text)

Tangent

Log 10

Square root Transform count Transform proportion

Natural log

When (from value) Constant e (2.718...) Missing data code Pi (3.141...)

Comparison Operations You can use these comparison operations in the Calculator: =

equal to



not equal to




greater than

=

greater than or equal to

They are all done row-wise, from left to right.

How comparison operations work : 1

If the comparison is true, the result is set to 1. If it is false, the result is set to 0

2

If the input column for = contains a missing value, the result is set to missing.

3

With = and , Minitab can always determine if the comparison is true or false, even if there are missing data, so the result is always 1 or 0.

4

You may use an ∗ (enclosed in single quotes) on the command line with = and .

6

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Logical Operations And

&

Or

|

Not

~

Minitab does logical operations rowwise, in this order: And, Or, Not. (You may type the symbols ~, &, and | if you wish.) The result of a logical operation is 1 if the expression is true, 0 if the expression is false, and ∗ if it cannot be evaluated.

How logical operations work : 1

Input expressions for logical operations are usually true or false (1 or 0) expressions, but they can be any value. Numbers that aren't 0 are treated as if they were 1.

2

If both expressions surrounding And are true, the result is true. Otherwise it is false.

3

If either (or both) expressions surrounding Or is true, the result is true. Otherwise it is false.

4

If an expression is true, a Not in front changes it to false. If it is false, a Not changes it to true.

5

If an input column contains a missing value, and if Minitab can determine that the result must be 0 or 1, the result is set to 0. Otherwise it is set to ∗.

Arithmetic Operations You can use these arithmetic operations in the Calculator: ∗∗

raise to a power



multiplication

/

division

+

addition



subtraction

They are all done rowwise.

How arithmetic operations work : 1

If any element of a row is missing, the result is set to missing.

2

If an operation is impossible, such as division by zero, the result is set to missing.

See Arithmetic session commands if you want to use arithmetic operations as stand-alone commands.

Calculator Rules •

In an expression, you cannot use a hyphen to specify a range of values. For example, Minitab would interpret C1-C4 as C1 minus C4.



Enclose specific text values, such as "green," with double quotes. Indicate missing text values as a pair of double quotes with no space inside, for example: C1 = "".



Indicate missing numbers or date/time values with the missing value symbol '∗' (enclosed with single quotes). You do not need to enclose numbers with any characters.



Operations are done row-wise. When Minitab cannot calculate an expression, for example because the input is a missing value or because you try to compute the square root of a negative number, the result is set to missing. Missing is ∗ for a numeric column, blank for a text column.



Minitab performs operations in the following order: subscripts, functions and column operations, exponentiation, "Not," multiplication and division, addition and subtraction, comparison operations, "And," and "Or." − Operations of equal order are performed from left to right. − You can override the default precedence by using parentheses. Minitab evaluates expressions within ( ) first.



If the last operation evaluated in an expression is a numeric operation (such as minus or MEAN), Minitab stores the result as a number. If the last operation evaluated is a date/time function, such as NOW or WHEN, Minitab stores the result as a date/time value. For example, the result of TODAY() − 30 will be a number since the last operation evaluated is minus, a numeric operation. However, the result of DATE(TODAY() − 30) will be a date value, because the last operation evaluated is DATE, a date/time function. The order in which Minitab performs operations is shown above.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

7

Manipulating and Calculating Data •

In Minitab (as with most spreadsheets), if you operate on a date/time variable with a number, for example NOW() + 30, Minitab assumes the number is in units of days.



Stored constants do not recognize date/time values, only numbers. Since date/time values are stored internally as numbers, date/time values stored in a constant are the numeric equivalent of the corresponding date/time value.

Example using calculator for arithmetic To store the difference between two numeric columns using the Calculator, follow these steps: 1

Open PULSE.MTW.

2

Choose Calc > Calculator.

3

In Store result in variable, type PulseDiff.

4

In the Expression box, enter Pulse1 − Pulse2. (To minimize the chance of error, select variable names, operators and functions with your mouse rather than by typing them in directly.) Click OK.

There is now a new column in the worksheet named PulseDiff, which contains the results of Pulse1 minus Pulse2.

General Expressions with the Calculator To

use this expression,

which stores this result:

Store a number in a column

5

Stores the number 5.

Compute a mathematical expression

MEAN(C10) / STDEV(C1)

Divides the mean of C10 by the standard deviation of C1.

Compute a mathematical expression

K1000 ∗ C1**2

Stores the product of π (in K1000) and C1 squared. (By default, Minitab stores the value of π in K1000, e in K999, and ∗ in K998.)

Compute a mathematical expression

5/9 ∗ (Fahrenheit − 32) Stores Celsius values. (The example assumes that Fahrenheit is the name of a column that contains temperature in degrees Fahrenheit.)

Store a text value in a column

"green"

Stores the text value green. Specific text values must be enclosed with double quotes.

Store a subscript (true/false) column based on values in a text column

C1 = "green"

Stores 0's for false, and 1's for true, where true is any row where C1 equals "green" (Minitab is case sensitive when comparing text values. Thus, rows where C1 equals "Green" or "GREEN" would be considered false.)

Store a subscript (true/false) column based on a logical expression

C1 > C2

Stores 0's for false, and 1's for true, where true is any row where C1 is greater than C2. "Greater than" means "larger than" if C1 and C2 are numeric columns, "later in the alphabet than" if C1 and C2 are text columns, or "later than" if C1 and C2 are date/time columns.

Store a subscript (true/false) column based on a logical expression

(C1 < 10) Or (C1 >= 15) Stores 0's for false and 1's for true, where true is any row where C1 is either less than 10 or greater than or equal to 15.

To calculate a mathematical expression 1

Choose Calc > Calculator.

2

In Store result in variable, enter the column or constant where you want to store the result of the expression. If you are creating a new column, enter a column number, such as C10 or C11, or a name that does not yet exist in the current worksheet. If you are creating a new constant, you must type the constant number, such as K2 or K3. If you type a name, such as MyConstant, Minitab assumes that you want to create a column with that name. Later you can name constants using the NAME session command, as in NAME K2 "MyConstant". See Example of setting a constant.

3

With the cursor in Expression, select variable names, buttons, and functions to build your expression. To set functions to their default values, omit the arguments at the end of the functions. See Calculator functions.

4

Click OK.

8

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Example of the Date Function The When, Date, and Time functions operate similarly. The example below illustrates the Date function. Suppose your worksheet contains these three, equivalent columns. The only difference among these columns is their type: C1 is date/time, C2 is numeric, and C3 is text. Calculating Date (from value) for any one of these columns, for example, DATE(C1), DATE(C2), or DATE(C3), has the same result, as shown below. 1

Open the worksheet DATES2.MTW.

2

Choose Calc > Calculator.

3

In Store result in variable, enter C4.

4

With the cursor in Expression, highlight DATE (from value) in the list of functions.

5

Click Select to begin building your expression with the Date (column or constant) variable.

6

Double-click C2 to enter it into the expression, and click OK.

The new date column appears in the worksheet as follows: C2

C1−D

C3−T

C4-D

1/5/99 08:00

36165.3

1/5/99 8:00

1/5/99

1/6/99 09:00

36166.4

1/6/99 9:00

1/6/99

1/7/99 11:00

36167.5

1/7/99 11:00

1/7/99

Date (from text) works the same way. For example, DATE("1/5/99 8:00") returns the date value 1/5/99. Note

Minitab dialog boxes only accept date/time data in their default formats. These defaults can change depending on the Windows Control Panel Regional Settings. See Default date/time formats for more information.

To calculate the date from a text, numeric, or date/time column To calculate from a numeric or date/time column 1

Choose Calc > Calculator.

2

In Store result in variable, enter the column where you want to store the date values.

3

With the cursor in Expression, double-click DATE (from value) in the list of functions.

4

Within the ( ), enter the numeric or data/time column from which you want to calculate. Click OK.

To calculate from a text column 1

Choose Calc > Calculator.

2

In Store result in variable, enter the column where you want to store the date values.

3

With the cursor in Expression, double-click DATE (from text) in the list of functions.

4

Within the ( ), enter the text column from which you want to calculate. Click OK.

Expressions Using Date/Time Data with the Calculator Note

If the last operation evaluated in an expression is a numeric operation (such as minus (−) or MEAN), Minitab stores the result as a number. If the last operation evaluated is a date/time function, such as NOW or WHEN, Minitab stores the result as a date/time value. Calculator Rules lists the order in which Minitab performs operations.

To

use this expression,

which stores this result:

Subtract two date columns

DateFailed − DateInstalled

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Stores the difference, in days, between DateFailed and DateInstalled.

9

Manipulating and Calculating Data

Subtract 30 TODAY() − 30 days from today, and store the result as a number

Stores the numeric equivalent of today's date minus 30 days.

Subtract 30 DATE(TODAY() − 30) days from today and store the result as a date

Stores the date that equals today's date minus 30 days.

Extract the date DATE(DateFailed) from a date/time column

Suppose the column DateFailed contains dates and times, such as 3/15/03 1:30 PM. This expression, which uses the DATE(from value) function, stores just the date portion, 3/15/03, in the new variable.

Store a WHEN is both date and time: subscript DateFailed = WHEN("3/15/03") (true/false) column, based on the date and time in a date/time column

Stores 0's for false and 1's for true, where true is any row where DateFailed equals 3/15/03 12:00 AM. The WHEN function includes both date and time. Since we did not supply a time within the double quotes, Minitab assumed 12:00 midnight.

Store a subscript (true/false) column, based on the time in a column

This will work:

Uses the TIME(from TimeFailed >= TIME("7:30") And TimeFailed = 7:30 And TimeFailed TODAY() − 30

If you reference a specific time as shown here, Minitab tries to interpret it as a number. Since numbers do not contain colons, Minitab will display an error message. Stores 0's for false and 1's for true, where true is any row where DateHired is later than today's date minus 30 days.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Store a subscript (true/false) column, based on a comparison of date values

This will work: DateHired > DATE("3/15/03") − 30

Uses the DATE(from text) function. This expression stores 0's for false and 1's for true, where true is any row where DateHired is later than 2/13/03. (3/15/03 minus 30 days equals 2/13/03.) Note: The date must be in double quotes and must be in a default format.

This will not work: DateHired > (3/15/03 − 30)

This will not work: DateHired > ("3/15/03" - 30)

If you reference a specific date as shown here, Minitab will interpret the slashes in the date as "divide by" signs. If you reference a specific date as shown here, in double quotes, Minitab will interpret "3/15/03" as a text value. Since it doesn't make sense to subtract 30 from a text value, this will not work.

Note Minitab dialog boxes only accept date/time data in their default formats. These defaults can change depending on the Windows Control Panel Regional Settings. See Default date/time formats for more information.

Example of setting a constant You would like to save the value 1.25 as a constant. 1

Choose Calc > Calculator.

2

In Store result in variable, enter K1.

3

In Expression, enter 1.25.

4

Click OK.

Minitab saved 1.25 as K1.

Accessing Individual Elements of a Column You can access individual elements of a column by using the LET command as shown below: LET C1 = C2(3) ∗ C5 LET C2(3) = 5 + K1 LET C2 = C1(COUNT(C2) − 10) ∗ C4 In the first example, C5 is multiplied by the number in the third row of C2. In the second example, the sum, 5 + K1, is put into row 3 of C2. The rest of C2 remains the same. A subscript need not be an integer, but can be any expression which, when evaluated, produces a positive integer, as the third LET shows. If you type LET C1(15) = 28, and C1 contains only 10 numbers, then rows 11 through 14 are filled with asterisks.

Column Statistics Column Statistics Calc > Column Statistics

Copyright © 2003–2005 Minitab Inc. All rights reserved.

11

Manipulating and Calculating Data You can calculate various statistics on columns or rows. Column statistics are displayed in the Session window, and are optionally stored in a constant. Row statistics are calculated across the rows of the columns specified and stored in the corresponding rows of a new column. You can also calculate column statistics with Calc > Calculator. The main difference is that Calculator just stores the results in the worksheet; Column Statistics displays the results in the Session window.

Dialog box items Statistic: Choose the statistic you want Minitab to calculate for the column indicated in Input variable. Sum Mean Standard deviation Minimum Maximum Range Median Sum of Squares N total N nonmissing N missing Input variable: Select the column you want to analyze. Store result in: (Optional) Enter a storage location which must be a single constant (K). (If you enter a new name, Minitab will automatically name the next available constant accordingly.)

To calculate column statistics 1

Choose Calc > Column Statistics.

2

Under Statistic, choose the statistic you want to calculate.

3

In Input variable, enter the column of data for which you want to calculate statistics.

4

If you like, enter a constant in which to store the result in Store result in. Click OK.

Example of Calculating Column Statistics To calculate the range of numbers in a column using the menu: 1

Choose Calc > Column Statistics.

2

Choose Range.

3

Enter a numeric column in Input variable, and click OK.

The Session window will display the range (the difference between the largest number and the smallest number in the input column).

Row Statistics Row Statistics Calc > Row Statistics Computes one value for each row in a set of columns. The statistic is calculated across the rows of the column(s) specified and the answers are stored in the corresponding rows of a new column.

Dialog box items Statistic: Choose the statistic you want Minitab to calculate for the columns selected in Input variables. Sum Mean Standard deviation Minimum Maximum

12

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Range Median Sum of Squares N total N nonmissing N missing Input variables: Select the columns upon which Minitab should operate. Store result in: Specify a storage column for the computed statistics.

To compute row statistics 1

Choose Calc > Row Statistics.

2

Under Statistic, choose the statistic you want to calculate.

3

In Input variables, enter the series of columns which contain the rows for which you want to calculate statistics.

4

In Store result in, enter a column in which to store the results, then click OK.

Example of Computing Row Statistics To calculate the range of numbers in a row: 1

Enter the following values in C1 and C2: C1

C2

2

3

2

4

1

4

1

6

0

5

2

Choose Calc > Row Statistics.

3

Choose Range.

4

In Input variables, enter at least two numeric columns. In Store result in, type RowRange. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window A new column named RowRange will contain the ranges (the difference between the largest number and the smallest number in each row of the input columns). RowRange looks like: RowRange 1 2 3 5 5

Standardize Standardize Calc > Standardize Standardize centers and scales columns of data. By default, the data is standardized by subtracting the mean and dividing by the standard deviation. See standardization methods for other choices. Centers and scales columns of data.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

13

Manipulating and Calculating Data

Dialog box items Input column(s): Select the column(s) you want to standardize. Store results in: Specify storage column(s) for the standardized scores. Subtract mean and divide by standard deviation: Choose to transform each Input column into a standard score (also called a z score). Subtract mean: Choose to transform each Input column by subtracting its mean. Divide by standard deviation: Choose to transform each Input column by dividing by its standard deviation. Subtract first value, then divide by second: Choose to specify values other than the mean and standard deviation to be used to transform all the column(s). Enter the values below, and Minitab transforms each input column by subtracting the specified value and dividing the result by the second specified value. First: Type the value that will be subtracted from each input column. Second: Type the value that Minitab will use to divide the result of the subtraction. Make range from start to end: Choose to transform the data linearly so that the result has the first value you specify (−1 by default) as a minimum, and the second value you specify (+1 by default) as a maximum. Start: Type the minimum value in the range. End: Type the maximum value in the range. Note

Using the session command CENTER, you can center and scale each column independently. Using the dialog box, the standardizing method you select applies to all input columns.

To standardize your data 1

Choose Calc > Standardize.

2

In Input column(s), enter the columns you want to standardize.

3

In Store results in, enter the columns in which you want to store the standardized data.

4

If you like, choose one of the optional standardization methods, then click OK.

Standardizing Methods Subtract mean and divide by standard deviation (default method) Subtract mean

Subtracts the mean of the column from each value in the column.

Divide by standard deviation

Divides each value in the column by the standard deviation of the column.

Subtract value and divide by value

Subtracts then divides by the values you specify.

Make range from value to value

Transforms the data linearly so that the result has the first value you specify (−1 by default) as a minimum, and the second value you specify (+1 by default) as a maximum.

Note

Using the session command CENTER, you can center and scale each column independently. Using the dialog box, the standardizing method you select applies to all input columns.

Make Patterned Data Make Patterned Data You can use Make Patterned Data to create a variety of data patterns. The Make Patterned Data command is not as quick and interactive as Autofill, but it allows you to more easily create large data sets with repeated values. Calc > Make Patterned Data > Simple Set of Numbers - fill a column with a pattern of equally spaced numbers Arbitrary Set of Numbers - fill a column with a pattern of unequally spaced numbers Text Values - fill a column with a pattern of text values Simple Set of Date/Time Values - fill a column with a series of dates, times, or date/time values

14

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Arbitrary Set of Date/Time Values - fill a column with a pattern of dates, times, or date/time values

Simple Set of Numbers Calc > Make Patterned Data > Simple Set of Numbers Provides an easy way to fill a column with numbers that follow a pattern, such as the numbers 1 through 100, or five sets of 1, 2, and 3. This is very useful for entering factor levels for analysis of variance designs. With this command, you can specify a pattern of equally spaced numbers, such as 10 20 30. To specify an unequally spaced pattern of numbers, such as the numbers 10 20 50, use the Arbitrary Set of Numbers command.

Dialog box items Store patterned data in: Specify a column to store the new data. From first value: Enter the starting point of the sequence. You may enter a number or a stored constant (K). To last value: Enter the end point of the sequence. You may enter a number or a stored constant (K). In steps of: Enter a number if you want to increment the starting value by a specified amount until you reach the end value. Number of times to list each value: Enter the number of times you want each value listed. Number of times to list the sequence: Enter the number of times you want the entire group of numbers listed. Note

Using the session command SET, documented in Session Command Help, you can create data that follow more complicated patters. You can also use SET to import text files and give a user-specified format for the data.

Arbitrary Set of Numbers Calc > Make Patterned Data > Arbitrary Set of Numbers Provides an easy way to fill a column with a pattern of numbers that are not equally spaced, such as the numbers 10 20 50. This is very useful for entering factor levels for analysis of variance designs. (To fill a column with equally spaced numbers, such as 10 20 30, use the Simple Set of Numbers command.)

Dialog box items Store patterned data in: Specify a column to store the new data. Arbitrary set of numbers: Enter any arbitrary set of numbers, separated by spaces. You may use stored constants in place of numbers. You may not use parentheses in this box. Number of times to list each value: Enter the number of times you want each value listed. Number of times to list the sequence: Enter the number of times you want the entire group of numbers listed. Note

Using the session command SET, documented in Session Command Help, you can create data that follow more complicated patters. You can also use SET to import text files and give a user-specified format for the data.

Text Values Calc > Make Patterned Data > Text Values You can fill a column with text that follows a pattern.

Dialog box items Store patterned data in: Enter the column you want to fill. Text values (e.g., red "light blue"): Type the base pattern for the text. If the text contains a blank, surround the entire value by double quotes. Number of times to list each value: Enter the number of times you want to repeat each text value within the sequence. Number of times to list the sequence: Enter the number of times you want to repeat the entire sequence. Note

Using the session command TSET, documented in Session Command Help, you can create data that follow more complicated patterns. You can also use TSET to import text files.

Simple Set of Date/Time Values Calc > Make Patterned Data > Simple Set of Date/Time Values Provides an easy way to fill a column with a series of dates and/or times.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

15

Manipulating and Calculating Data

Dialog box items Store patterned data in: Specify a column to store the new data. Patterned Sequence From first date/time: Enter the initial date, time, or date/time value in a default date/time format that Minitab recognizes. To last date/time: Enter the ending date, time, or date/time value in a default date/time format that Minitab recognizes. Note

Minitab dialog boxes only accept date/time data in their default formats. These defaults can change depending on the Windows Control Panel Regional Settings. See Default date/time formats for more information.

In steps of: Enter a number if you want to increment the date/time data by a specified amount until you reach the end value. Step unit: Choose the date/time unit to increment the data. Number of times to list each value: Enter the number of times you want each value listed. Number of times to list the sequence: Enter the number of times you want the entire group of date/time values listed. Note

Using the session command DSET, documented in Session Command Help, you can use text constants for start and end dates. With DSET, you can also specify a custom format for displaying the new date/time data, or for specifying the start and end date/time values.

Arbitrary Set of Date/Time Values Calc > Make Patterned Data > Arbitrary Set of Date/Time Values You can fill a column with an unequally spaced pattern of dates/times

Dialog box items Store patterned data in: Enter the column you want to fill. Date/Time values (e.g., 8/26/96 "8/26/96 19:58"): Enter the pattern of dates/times. Note

Minitab dialog boxes only accept date/time data in their default formats. These defaults can change depending on the Windows Control Panel Regional Settings. See Default date/time formats for more information.

Number of times to list each value: Enter the number of times you want to repeat each date/time within the sequence. Number of times to list the sequence: Enter the number of times you want to repeat the entire sequence.

Example of Filling a Column with a Simple Set of Numbers Simple Example To create a column named ID that contains the numbers 1, 2, 3, ..., 100, using the menu, follow these steps: 1

Choose Calc > Make Patterned Data > Simple Set of Numbers.

2

In Store patterned data in, type ID.

3

In From first value, type 1. In To last value, type 100. Click OK.

More Examples From first value

4

1

1

1

1

To last value

1

3

2

3

3

In steps of

1

0.5

1

1

1

Number of times to list 1 each value

1

3

1

2

Number of times to list 1 the sequence

1

1

2

2

Stores these numbers: 4, 3, 2, 1

1, 1.5, 2, 2.5, 1, 1, 1, 3 2, 2, 2

1, 2, 3, 1, 2, 3

1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3

Example of Filling a Column with an Arbitrary Set of Numbers To fill a column named PSI with three sets of the numbers 10, 10, 20, 20, 50, 50, follow these steps: 1

16

Choose Calc > Make Patterned Data > Arbitrary Set of Numbers.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu 2

In Store patterned data in, type PSI.

3

In Arbitrary set of numbers, type 10 20 50.

4

In Number of times to list each value, type 2.

5

In Number of times to list the sequence, type 3. Click OK.

See Arbitrary Set of Numbers for more examples.

Example of Filling a Column with a Series of Dates and/or Times To fill a column named January with the dates 1/1/03, 1/2/03, ..., 1/31/03, follow these steps: 1

Choose Calc > Make Patterned Data > Simple Set of Date/Time Values.

2

In Store patterned data in, type January.

3

In From first date/time, type 1/1/03. In To last date/time, type 1/31/03. Use default values for the other fields. (Step by 1 in units of days. List each value and list the whole sequence 1 time each.) Click OK.

Note

Minitab dialog boxes only accept date/time data in their default formats. These defaults can change depending on the Windows Control Panel Regional Settings. See Default date/time formats for more information.

Make Mesh Data Make Mesh Data Calc > Make Mesh Data Creates a regular (x,y) mesh to use for data input to contour plots, and 3-D surface and wireframe plots, with an option to create the z-variable using a function. The simplest way to use Make Mesh Data is to specify your X and Y columns and use the default settings for those columns. If you don't already have a z-column, specify that column as well, and choose the function you want from the function list provided.

Dialog box items Make X and Y Mesh Variables: Meshes of between 7 and 15 points provide a good mix of performance and resolution for contour, surface and wireframe plots. X: These settings allow you to specify the x-positions of the grid. Store in: Enter a storage column for the generated x-values. From: Enter the beginning x-value. To: Enter the ending x-value. Number of positions: You may specify up to 101 positions. More positions gives a finer grid, but takes longer to plot. Y: These settings allow you to specify the y-positions of the grid. Store in: Enter a storage column for the generated y-values. From: Enter the beginning y-value. To: Enter the ending y-value. Number of positions: You may specify up to 101 positions. More positions gives a finer grid, but takes longer to plot. Optional Computation of Z as a Function of X and Y Store Z variable in: Enter a storage column for the generated z-values. Use function example: Choose to select a function example. If you create a 3D graph using the x-, y-, and z-values generated by this dialog box, the graph will look like whichever function is selected. See Example functions and parameters. Use function number: Choose to use a function of your own that you have added to the file USERFUNC.MAC in the \MACROS folder. See Creating Your Own Functions. Function parameters (optional): Enter custom parameters, separated by a space, for the function you have chosen. See Example functions and parameters.

To make mesh data 1

Choose Calc > Make Mesh Data.

2

In Store in, enter the columns in which you want to store the X and Y data.

3

Optionally, in Store Z variable in, enter a column. In Use function example, pick a function from the list.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

17

Manipulating and Calculating Data 4

If you like, choose any available options, then click OK.

Example functions and parameters If you do not already have a column of z-data, you can generate z-data as a function of x and y. Select the function you want to use and enter a column in which to store the z-data. Minitab provides a selection of functions with default parameters. You can change those parameters. You can also create your own functions and parameters. See Creating Your Own Functions. Name

Equation

Parameters (in order)

Bivariate Normal

µ1 = MU1, σ1 = S1, µ2 = MU2, σ2= S2, ρ = RHO (σ1 ≠ 0, σ2≠ 0, -1 < ρ < 1) The following variables are derived from the above variables, as follows:

Bowl

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Cone

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Cowboy Hat

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Egg Carton

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Hemisphere

A, B, C, R (A ≠ 0, B ≠ 0, C ≠ 0, R ≠ 0) where if z < 0, set z = 0

Hill and Dale

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Saddle

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

Wave

A, B, C (A ≠ 0, B ≠ 0, C ≠ 0)

18

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Creating your own functions You can create your own custom functions by adding them to the Minitab macro USERFUNC.MAC. When you add a custom function to the macro, you assign your function a number between 1 and 1000. You will access your function in Calc > Make Mesh Data using this function number. You can allow for optional parameters in the functions you create. You can set values for these parameters in Calc > Make Mesh Data when you create the data. However, you should create reasonable defaults when creating the parameters, in case parameter settings are not entered in Calc > Make Mesh Data.

To add your own functions 1

Start a word processor or text editor, such as Notepad.

2

Open the file USERFUNC.MAC. The file is in the Macros folder of your main Minitab directory.

3

Back up the file by saving it as a different name, such as USERFUNC.BAK. Save the file as plain text (ASCII file).

4

In USERFUNC.MAC, add your own function by following the instructions at the top of the file. In the macro you will assign your function a number between 1 and 1000.

5

Save USERFUNC.MAC as a plain text file.

To execute your custom function 1

Choose Calc > Make Mesh Data.

2

Under Store in X and Store in Y, enter variables.

3

In Use function number, enter the number of your function.

4

If you have parameters in your function, you can enter values for them in the Function Parameters text box. You should enter values in order, separated by a space. Click OK.

Example of Make Mesh Data To create three new columns, named X, Y, and Z to use as data input for a three-dimensional plot, follow these steps: 1

Choose Calc > Make Mesh Data.

2

In the first Store in box, type X. In the second Store in box, type Y. Use default values for the other X and Y fields (from −5 to 5 with 11 positions).

3

In Store Z variabe in, type Z. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Make Indicator Variables Make Indicator Variables Calc > Make Indicator Variables Creates indicator (dummy) variables. A typical use of this command is for regression analysis. You can do a regression analysis on an independent (x) variable, which is a qualitative variable, such as color of package where there are only three colors, if that variable is transformed into dummy variables. This command allows you to create those dummy variables. In textbooks, these are also called binary variables.

Dialog box items Indicator variables for: Enter the column you want to create an indicator variable for. Store results in: Enter as many columns as there are distinct values, excluding missing values, in the input column.

Example of Make Indicator Variables To create indicator (dummy) variables from a column of qualitative data (shown below), follow these steps: 1 Open EYECOLOR.MTW. 2 Choose Calc > Make Indicator Variables. 3

In Indicator variables for, enter Eyecolor.

4

In Store results in, enter C4 -C7. Click OK.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

19

Manipulating and Calculating Data

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Interpreting the results You specified four columns to store the indicator variables because eye color has four distinct values: blue, brown, green, hazel. If Eyecolor contains a missing value, all indicator variables will have the missing value symbol ∗ in the corresponding row. By default, Minitab will process the text values in alphabetical order. C4 contains 1's for the first alphabetical value in Eyecolor, blue, 0's for other rows. C5 contains 1's for the next alphabetical value in Eyecolor, brown, 0's for other rows. C6 contains 1's for the next alphabetical value in Eyecolor, green, 0's for other rows. C7 contains 1's for the last alphabetical value in Eyecolor, hazel, 0's for other rows.

Matrices Matrices Calc > Matrices Minitab matrices, designated as M1, M2, M3, ... , exist in the worksheet in the format you specify using the Calc > Matrices > Read command or as stored by an analysis command. A worksheet column with n entries can be used as an n x 1 matrix. A constant can be used as a 1 x 1 matrix. The Minitab worksheet can contain up to 100 matrices. You can view the contents of a matrix two ways: use Data > Display Data, or use the Data > Copy > Matrix to Columns to copy the matrix to columns and then view the columns in the Data window. Select one of the following commands: Read Transpose Invert Define Constant Diagonal Eigen Analysis Arithmetic

Read Matrix Calc > Matrices > Read Puts numbers into a matrix using the dimensions you specify. You can enter numbers from the keyboard, from the worksheet, or from a text or data file. If you want to enter numbers from a worksheet, see Data > Copy > Matrix to Columns.

Dialog box items Number of rows: Enter a number to define the width of the matrix. Number of columns: Enter a number to define the length of the matrix. Read into matrix: Enter a matrix name or number (M). Read from keyboard: Choose if you will enter the matrix numbers from the keyboard. (You must enable command language before selecting this feature.) Read from file: Choose if you will import the matrix from a file.

Read Matrix From File Calc > Matrices > Read > OK (Opens when you click OK if you are reading from a file rather than the keyboard) Opens file containing data to be inserted into a matrix. To open a file, make sure the correct file type appears in the List Files of Type box. Next, select the file you want to open, browsing through drives and directories as necessary.

20

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Transpose Matrix Calc > Matrices > Transpose Reconfigures a matrix so that rows become columns and columns become rows.

Dialog box items Transpose from: Select the matrix, designated by name or number (M), that you want to transpose. Store result in: Specify a storage matrix, designated by name or number (M).

Invert Matrix Calc > Matrices > Invert Replaces entire matrix with its inverse. The matrix must be square.

Dialog box items Invert from: Select the matrix, designated by name or number (M), that you want to invert. Store result in: Specify a storage matrix, designated by name or number (M).

Define Constant Matrix Calc > Matrices > Define Constant Puts a designated number into every matrix cell.

Dialog box items Store The Same Value In Each Cell: Value: Enter the number you want placed in each matrix cell. Number of rows: Enter a number to define the width of the matrix. Number of columns: Enter a number to define the length of the matrix. Store result in: Specify a storage matrix, designated by name or number (M).

Diagonal Matrix Calc > Matrices > Diagonal Sets values from a designated column into the diagonal of a matrix and vice versa.

Dialog box items Make diagonal matrix: Choose to take a column and place it into the diagonal of a matrix. Zeros will be placed in all other cells. A square matrix will be created. Using column: Select the column to be used as the diagonal. Store result in: Specify a storage matrix, designated by name or number (M). Copy diagonal: Choose to take the diagonal of a matrix and place it in a column. From matrix: Select a matrix, designated by name or number (M). The diagonal of the matrix will be stored in a column. The input matrix must be square. Store result in: Specify a storage column for the diagonal values.

Eigen Analysis Calc > Matrices > Eigen Analysis Calculates eigenvalues (also called characteristic values or latent roots) and eigenvectors for a symmetric matrix.

Dialog box items Analyze matrix: Select a matrix, designated by name or number (M1, M2, etc.) to be analyzed. The matrix must be symmetric. Storage Column of eigenvalues: Specify a storage column for eigenvalues in decreasing order of magnitude down the column. Matrix of eigenvectors: Specify a matrix for storing eigenvectors; Minitab stores them as columns of the matrix. The first column corresponds to the first eigenvalue (largest in magnitude), the second column to the second eigenvalue, and so on.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

21

Manipulating and Calculating Data

Matrix − Arithmetic Calc > Matrices > Arithmetic Performs arithmetic operations on any combination of columns, constants, or matrices.

Dialog box items Add ___+___: Choose to perform addition, then specify the columns, constants, or matrices to add. Use to move between the boxes. Subtract ___-___: Choose to perform subtraction, then specify the columns, constants, or matrices to subtract. Use to move between the boxes. Multiply ___*___: Choose to perform multiplication, then specify the columns, constants, or matrices to multiply. Use to move between the boxes. Store result in: Specify a column, constant, or matrix, whichever is appropriate, for storing the results.

Random Data and Probability Distributions Random Data Probability Distributions and Random Data Overview Use these commands to obtain random samples, generate random data, and calculate probabilities for different distributions. •

Set Base lets you set a starting point for Minitab's random number generator, so you can select the same random sample, or generate the same set of random data more than once. See Set Base.



Random Data can be used to: − Randomly sample rows from 1 or more columns in your worksheet, see Sample From Columns. − Generate random data from 24 different distributions, see Random Data.



Probability Distributions lets you calculate the values of a probability density function (pdf), cumulative probabilities, or inverse cumulative probabilities for 22 different data distributions. See Probabilities Distributions.

You can also use these commands to: •

Calculate a critical value for a hypothesis test, rather than looking it up in a table. See Example of Calculating Critical Values.



Calculate a p-value for a hypothesis test. See Example of calculating p-values.

Random Data Sample From Columns - takes a random sample, with or without replacement You can generate random data from the following distributions: Chi-Square Normal Multivariate Normal F T Uniform Bernoulli Binomial Hypergeometric Discrete Integer Poisson Beta Cauchy Exponential Gamma

22

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Laplace Largest Extreme Value Logistic Loglogistic Lognormal Smallest Extreme Value Triangular Weibull Note

To generate the same random sample on multiple occasions, see Calc > Set Base.

To generate random data You can generate random data from 24 different distributions. You can use Set Base to generate the same set of data more than once. 1

Choose Calc > Random Data > [distribution name]. The dialog box varies with the distribution chosen.

2

In Number of rows of data to generate, enter the number of rows you want to generate.

3

In Store in column(s), enter the column(s) in which you want to store the data.

4

Enter the required parameters. These vary from one distribution to another. In the dialog box shown (Normal Distribution), the parameters are Mean and Standard deviation. Click OK.

Set Base Calc > Set Base You can set a starting point for Minitab's random number generator. This is useful when you want to select the same random sample, or generate the same set of random data more than once. Minitab has a long string of "random" numbers available. If Minitab always started at the beginning of the list, you would always get the same data. To avoid this, Minitab uses the time of day (in seconds or fractions of a second) to choose a "random" starting point in the string. Setting a base tells the random number generator where to start. The generator will continue reading from the point where it left off unless a new base is specified. To generate the identical set of random numbers time after time, set the same base each time you select a random sample, or generate random data. Note If you use the same base on different platforms or different versions of Minitab, you may not get the same random number sequence. Dialog box items Set base of random data generator to: Enter the integer you want to begin the random number sequence.

To set a starting point for Minitab's random number generator 1

Choose Calc > Set Base.

2

In Set base of random data generator to, enter a number to use as the base for the random number sequence. Click OK.

More

You can use the session command BASE, documented in Session command Help, to find out the current base value. Simply type BASE on the command line (without arguments). Minitab will print the base value in the Session window.

Sample From Columns Calc > Random Data > Sample From Columns Randomly samples the same rows from one or more columns. You can sample with replacement (select the same row more than once), or without replacement (select each row only once). To generate the same random sample on multiple occasions, see Calc > Set Base. Dialog box items Number of rows to sample: Specify the number of rows to randomly select. From columns: Enter the column(s) you want to sample from. If you sample from several columns at once, they must all have the same length.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

23

Manipulating and Calculating Data Store samples in: Specify the column(s) where you want to store the sampled values. The number of storage columns must be the same as the number of columns sampled from. Sample with replacement: Check to sample with replacement. Leave unchecked to sample without replacement (sample size must be less than or equal to the length of the columns).

To select a random sample from columns You can randomly sample rows from one or more columns. 1

Choose Calc > Random Data > Sample From Columns.

2

In Number of rows to sample, enter the number of rows you want to sample.

3

In From columns, enter equal-length columns to sample from.

4

In Store samples in, enter the columns in which you want to store the sample data. Click OK.

Beta Distribution Calc > Random Data > Beta Generates random data from a beta distribution. Use beta distributions for random variables between 0 and 1. The beta distribution is often used to model the distribution of order statistics. Use for random variables between 0 and 1. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. First shape parameter: Enter a number for the first shape parameter you want to define the beta distribution. Second shape parameter: Enter a number for the second shape parameter you want to define the beta distribution.

Bernoulli Distribution Calc > Random Data > Bernoulli Generates random data from a Bernoulli distribution. Bernoulli distributions are characterized by outcomes with only the possibility of success or failure. Data from a Bernoulli distribution have the values of 0 or 1. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Probability of success: Enter a number between 0 and 1 for the probability of success, which will be used to define the Bernoulli distribution. Suppose you enter a probability of success of 0.2. The new column will contain 1's (for success) with a probability of 0.2, and 0's (for failure) with a probability of 0.8.

Binomial Distribution Calc > Random Data > Binomial Generates random data from a binomial distribution. The binomial distribution is based on the probability of observing successes in a fixed number of independent trials. Data are integers greater than or equal to 0. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Number of trials: Enter the number of trials you want to define the binomial distribution. Probability of success: Enter a number between 0 and 1 for the probability of success, which will be used to define the binomial distribution.

Cauchy Distribution Calc > Random Data > Cauchy Generates random data from a Cauchy distribution. The Cauchy distribution is symmetric around zero, but the tails approach zero less quickly than do those of the normal distribution. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate.

24

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Store in column(s): Enter storage column(s) for the generated values. Location: Enter a number for the location you want to define the Cauchy distribution. Scale: Enter a number for the scale you want to define the Cauchy distribution.

Chi-Square Distribution Calc > Random Data > Chi-Square Generates random data from a chi-square distribution. Use when random variables are greater than 0. If X has a standard normal distribution, X2 has a chi-square distribution, creating a commonly used sampling distribution. The shape of the chi-square distribution depends on the number of degrees of freedom. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Degrees of freedom: Enter the number of degrees of freedom you want to define the chi-square distribution.

Discrete Distribution Calc > Random Data > Discrete Generates random data from a discrete distribution. A discrete distribution is one that you define yourself. For example, suppose you are interested in a distribution made up of three values −1, 0, 1, with probabilities of 0.2, 0.5, and 0.3, respectively. If you enter these values into the worksheet: Value −1 0 1

Prob 0.2 0.5 0.3

Then you can tell Minitab to use these columns when you are generating random data or calculating probabilities and probability densities. Before generating random data, you must put values and their corresponding probabilities into two columns in the worksheet. Enter those columns in the Values in and Probabilities in boxes. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Values in: Enter the column containing the values you want to be included in the distribution. Probabilities in: Enter the column containing the probabilities that correspond to the discrete numbers in the Values in box.

Exponential Distribution Calc > Random Data > Exponential Generates random data from an exponential distribution. Use the exponential distribution for time series data when the data are constant, such as when units have a constant failure rate. Use when random variables are greater than 0. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Scale: Enter a scale value to define the exponential distribution. The scale parameter equals the mean, when the threshold parameter equals 0. Threshold: Enter a threshold to define the exponential distribution.

F Distribution Calc > Random Data > F Generates random data from an F distribution. The F distribution is a sampling distribution of two independent random variables with chi-square distributions, each divided by its degrees of freedom. It is most commonly used in test of variance. Use when random variables are greater than 0.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

25

Manipulating and Calculating Data

Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Numerator degrees of freedom: Enter the number of degrees of freedom for the numerator. Denominator degrees of freedom: Enter the number of degrees of freedom for the denominator.

Gamma Distribution Calc > Random Data > Gamma Generates random data from a gamma distribution. The gamma distribution is often used to model positively skewed data. Use when random variables are greater than 0. Dialog box items Number of rows of data to generate: Indicate the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Shape parameter: Enter a shape parameter to define the gamma distribution. Scale parameter: Enter a scale parameter to define the gamma distribution. Threshold parameter: Enter a threshold parameter to define the gamma distribution.

Hypergeometric Distribution Calc > Random Data > Hypergeometric Generates random data from a hypergeometric distribution. The hypergeometric distribution is used for samples drawn from relatively small populations, without replacement. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Population size (N): Enter the population size, a positive number Successes in population (M): Enter the number of successes in the population, between 0 and N. Sample size (n): Enter the sample size, between 0 and N.

Integer Distribution Calc > Random Data > Integer Generates random data from an integer distribution, which is a discrete uniform distribution that ranges from the minimum to the maximum integer value specified. Each integer in the range has equal probability. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Minimum value: Enter the beginning integer. Maximum value: Enter the ending integer.

Laplace Distribution Calc > Random Data > Laplace Generates random data from a Laplace distribution (also called the double exponential distribution). The Laplace distribution is used when the distribution is more peaked than a normal distribution. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a number for the location you want to define the Laplace distribution. Scale: Enter a number for the scale you want to define the Laplace distribution.

26

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Largest Extreme Value Distribution Calc > Random Data > Largest Extreme Value Generates random data from a largest extreme value distribution. The largest extreme value distribution is used to model extreme maximum distributions, often in a reliability context. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a location to define the largest extreme value distribution. Scale: Enter a scale to define the largest extreme value distribution.

Logistic Distribution Calc > Random Data > Logistic Generates random data from a logistic distribution. The logistic distribution is used to model binary responses. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a number for the location you want to define the logistic distribution. Scale: Enter a number for the scale you want to define the logistic distribution.

Loglogistic Distribution Calc > Random Data > Loglogistic Generates random data from a loglogistic distribution. The loglogistic distribution is often used in biostatistics to model survival probabilities. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a location to define the loglogistic distribution. Scale: Enter a scale to define the loglogistic distribution. Threshold: Enter a threshold to define the loglogistic distribution.

Lognormal Distribution Calc > Random Data > Lognormal Generates random data from a lognormal distribution. The lognormal distribution is often used for reliability analysis and in financial applications, such as modeling stock behavior. A random variable follows the lognormal distribution if the logarithm of the random variable is normally distributed. Use when random variables are greater than 0. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a location to define the lognormal distribution. Scale: Enter a scale to define the lognormal distribution. Threshold: Enter a threshold to define the lognormal distribution.

Multivariate Normal Distribution Calc > Random Data > Multivariate Generates random data from a multivariate normal distribution. The multivariate normal distribution is an extension of the univariate normal distribution for applications with a group of variables that may be correlated. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

27

Manipulating and Calculating Data Store in column(s): Enter storage column(s) for the generated values. The number of such columns must be an integral multiple of the multivariate dimension. For example, if you have a 3 dimensional multivariate, you can enter 3 columns, 6 columns, 9 columns, etc. Mean column: Enter the column containing the vector of means. Variance-Covariance matrix: Enter the variance-covariance matrix.

Normal Distribution Calc > Random Data > Normal Generates random data from a normal distribution. Use when data follow a bell-shaped curve. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Mean: Enter the mean value you want to use as the center of the normal distribution. Standard deviation: Enter the standard deviation value you want to define the normal distribution.

Poisson Distribution Calc > Random Data > Poisson Generate random data from a Poisson distribution. The Poisson distribution is often used when the probability of an event is small. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Mean: Enter a mean value greater than 0 and less than or equal to 709, which will define the Poisson distribution.

Smallest Extreme Value Distribution Calc > Random Data > Smallest Extreme Value Generates random data from a smallest extreme value distribution. The smallest extreme value distribution is used to model extreme minimum distributions, often in a reliability context. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Location: Enter a location to define the smallest extreme value distribution. Scale: Enter a scale to define the smallest extreme value distribution.

t Distribution Calc > Random Data > t Generates random data from a t distribution. The t distribution is symmetric about zero but has tails that are more spread out than those of the normal distribution. With increasing degrees of freedom, the t distribution looks more like the normal distribution. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Degrees of freedom: Enter the number of degrees of freedom you want to define the t distribution.

Triangular Distribution Calc > Random Data > Triangular Generates random data from a triangular distribution between two points that you designate. Use the triangular distribution for random variables that are between two fixed limits. The distribution peaks at a value between the two limits.

28

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Lower endpoint: Enter a number to define the minimum value for the triangular distribution. Mode: Enter a number to define the mode, the most like observation, for the triangular distribution. Upper endpoint: Enter a number to define the maximum value for the triangular distribution.

Uniform Distribution Calc > Random Data > Uniform Generates random data from a uniform distribution between two points that you designate. Use to model data that range over an interval of equally likely values. Dialog box items Number of rows of data to generate: Enter the number of rows of random data you want to generate. Store in column(s): Enter storage column(s) for the generated values. Lower endpoint: Enter a number to define the minimum value for the uniform distribution. Upper endpoint: Enter a number to define the maximum value for the uniform distribution.

Weibull Distribution Calc > Random data > Weibull Generates random data from a Weibull distribution. The Weibull distribution is useful to model product failures. Dialog box items Number of rows of data to generate: Enter the number of rows of random data to generate. Store in column(s): Enter storage column(s) for the generated values. Shape parameter: Enter a shape parameter to define the Weibull distribution. Scale parameter: Enter a scale parameter to define the Weibull distribution. Threshold parameter: Enter a threshold parameter to define the Weibull distribution.

Example of selecting a random sample To select a random sample of five observations from nine rows of data, as shown: ID

Weight

1

45

2

65

3

54

4

67

5

65

6

88

7

58

8

41

9

50

1

Type the first two columns of data into the worksheet, naming them 'ID' and 'Weight,' as shown.

2

Choose Calc > Random Data > Sample From Columns.

3

In Number of rows to sample, enter 5. In From columns, enter ID Weight.

4

In Store samples in, enter IDSample WeightSample, then click OK.

Note

You will get a different sample data than shown in the table below because sampling is done randomly. Use Calc > Set Base to generate the same random sample more than once.

Data window output Note

This command does not produce output in the Session window. Instead, columns are stored in the worksheet.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

29

Manipulating and Calculating Data

ID

Weight

IDSample

WeightSample

1

45

2

65

2

65

9

50

3

54

3

54

4

67

8

41

5

65

6

88

6

88

7

58

8

41

9

50

Interpreting the results The sample is shown in your Data window. Minitab randomly selected samples 2, 9, 3, 8, and 6; and stored the corresponding weights in your worksheet.

Probability Distributions Probability Distributions and Random Data Overview Use these commands to obtain random samples, generate random data, and calculate probabilities for different distributions. •

Set Base lets you set a starting point for Minitab's random number generator, so you can select the same random sample, or generate the same set of random data more than once. See Set Base.



Random Data can be used to: − Randomly sample rows from 1 or more columns in your worksheet, see Sample From Columns. − Generate random data from 24 different distributions, see Random Data.



Probability Distributions lets you calculate the values of a probability density function (pdf), cumulative probabilities, or inverse cumulative probabilities for 22 different data distributions. See Probabilities Distributions.

You can also use these commands to: •

Calculate a critical value for a hypothesis test, rather than looking it up in a table. See Example of Calculating Critical Values.



Calculate a p-value for a hypothesis test. See Example of calculating p-values.

Probability Distributions You can calculate probabilities, probability densities, cumulative probabilities, and inverse cumulative probabilities for the following distributions: Chi-Square Normal F T Uniform Binomial Hypergeometric Discrete Integer Poisson Beta Cauchy Exponential Gamma Laplace

30

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Largest Extreme Value Logistic Loglogistic Lognormal Smallest Extreme Value Triangular Weibull

To calculate the pdf, cdf, or inverse cdf 1

Choose Calc > Probability Distributions > (distribution name).

2

Do one of the following: • Choose Probability to calculate the pdf. • Choose Cumulative probability to calculate the cdf. • Choose Inverse cumulative probability to calculate the inverse cdf.

3

Enter the required parameters. These vary from one distribution to another.

For example, for the binomial distribution, the parameters are Number of trials and Probability of success. 4

For example, for the binomial distribution, the parameters are Number of trials and Probability of success. Do one of the following: • In Input column, enter the column you want to evaluate. If you like, in Optional storage, enter a column in which to store the probabilities. • In Input constant, enter the stored constant (such as K1) or number (such as 21) that you want to evaluate. If you like, in Optional storage, enter a constant (such as K2) in which to store the probability.

5

Click OK.

Calculating a p-value for a hypothesis test P-values are often used in hypothesis tests where you either reject or fail to reject a null hypothesis. The p-value represents the probability of making a Type 1 error, or rejecting the null hypothesis when it is true. The smaller the pvalue, the smaller is the probability that you would be making a mistake by rejecting the null hypothesis. A cutoff value often used is 0.05, that is, reject the null hypothesis when the p-value is less than 0.05. Minitab automatically displays p-values for most hypothesis tests. But you can also use Minitab to "manually" compute a p-value.

Calculating Probabilities for Different Distributions You can calculate values for probability density functions, cumulative distribution functions, or inverse cumulative probabilities of your data, for the distribution you choose from the menu. •

The probability density function (pdf) is the curve for the distribution. For example, a pdf can describe the distribution of tree diameters in a young forest.



The cumulative distribution function (cdf) for any value x gives the cumulative probability associated with a probability distribution function. Specifically, a cdf gives the cumulative area under the pdf, up to the value you specify. For example, a cdf can tell you the proportion of trees in the young forest that are at least ten inches in diameter.



The inverse cumulative probability (inverse cdf) is the value associated with an area. It is the reverse of the cdf, which is the area associated with a value. For example, an inverse cumulative probability can tell you, How wide are 75% of the trees? Here is a visualization of these concepts:

Copyright © 2003–2005 Minitab Inc. All rights reserved.

31

Manipulating and Calculating Data

Use pdf when you know x and want the corresponding y value on the curve.

Use cdf when you know x and want the area Use inverse cdf when you know the under the curve. cumulative area under the curve and want the x value.

For discrete distributions (binomial, hypergeometric, discrete, integer, and Poisson), Minitab calculates the discrete probability function. For continuous distributions, such as the normal distribution, Minitab calculates the continuous probability density function (often called the density function). If you do not store the results, Minitab displays them in the Session window. If you store the results in a column, you can see them by looking at the column in the Data window. If you store the probability in a constant, such as K2, you can see it in the Constants folder in the Project Manager, or by printing them to the Session window using Data > Display Data.

Why the Inverse Cumulative Probability May Not Exist or May Not Be Unique For all continuous distributions handled by Inverse cumulative probability (inverse cdf), the inverse of the cumulative distribution function exists and is unique if 0 < p < 1. If a density is positive over the entire real line (for example, normal), inverse cdf is not defined for either p = 0 or p = 1. If a density is positive for all values greater than some value (for example, gamma), inverse cdf is defined for p = 0 but not for p = 1. If a density is positive only on an interval (for example, beta), inverse cdf is defined for p = 0 and p = 1. Whenever inverse cdf is not defined, Minitab returns a missing value (∗) for the result. For discrete distributions, the situation is more complicated. Suppose we compute the cdf for a binomial with n = 5 and p = 0.4. In that case, there is no value x such that the cdf is 0.5. For x = 1, the cdf is 0.3370; for x = 2, the cdf jumps up to 0.6826. If the inverse cdf is being displayed in the Session window (i.e., results are not stored), both values of x are displayed. If the inverse cdf is stored, the larger of the two values is stored.

Beta Distribution Calc > Probability Distributions > Beta Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a beta distribution. The beta distribution is often used to model the distribution of order statistics. Use for random variables between 0 and 1. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. First shape parameter: Enter a number for the first shape parameter you want to define the beta distribution. Second shape parameter: Enter a number for the second shape parameter you want to define the beta distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Binomial Distribution Calc > Probability Distributions > Binomial

32

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Calculates probabilities, cumulative probabilities, and inverse cumulative probabilities for a binomial distribution. The binomial distribution is based on the probability of observing successes in a fixed number of independent trials. Data are integers greater than or equal to 0. Dialog box items Probability: Choose to calculate probabilities. Cumulative probability: Choose to calculate the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Number of trials: Enter number of trials you want to define the binomial distribution. Probability of success: Enter number between 0 and 1 for the probability of success, which will be used to define the binomial distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Cauchy Distribution Calc > Probability Distributions > Cauchy Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a Cauchy distribution. The Cauchy distribution is symmetric around zero, but the tails approach zero less quickly than do those of the normal distribution. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a number for the location you want to define the Cauchy distribution. Scale: Enter a number for the scale you want to define the Cauchy distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window. Note

If you do not specify values, Minitab uses location = 0 and scale = 1.

Chi-Square Distribution Calc > Probability Distributions > Chi-Square Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a chi-square distribution. Use when random variables are greater than 0. If X has a standard normal distribution, X2 has a chi-square distribution, creating a commonly used sampling distribution. The shape of the chi-square distribution depends on the number of degrees of freedom. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

33

Manipulating and Calculating Data Degrees of freedom: Enter the number of degrees of freedom you want to define the chi-square distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Discrete Distribution Calc > Probability Distributions > Discrete Calculates probabilities, cumulative probabilities, and inverse cumulative probabilities for a discrete distribution. A discrete distribution is one that you define yourself. For example, suppose you are interested in a distribution made up of three values −1, 0, 1, with probabilities of 0.2, 0.5, and 0.3, respectively. If you enter these values into the worksheet: Value −1 0 1

Prob 0.2 0.5 0.3

Then you can tell Minitab to use these columns when you are generating random data or calculating probabilities and probability densities. Dialog box items Probability: Choose to calculate probabilities. Cumulative probability: Choose to calculate the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Values in: Enter the column containing the values you want to be included in the distribution. Probabilities in: Enter the column containing the probabilities that correspond to the discrete numbers in the Values in box. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Exponential Distribution Calc > Probability Distributions > Exponential Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for an exponential distribution. Use the exponential distribution for time series data when the data are constant, such as when units have a constant failure rate. Use when random variables are greater than 0. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Scale: Enter a scale value to define the exponential distribution. The scale parameter equals the mean, when the threshold parameter equals 0. Threshold: Enter a threshold number to define the exponential distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate.

34

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

Some references use 1/ b for the scale parameter. Minitab uses b. If you do not specify values, Minitab uses scale = 1 and threshold = 0.

F Distribution Calc > Probability Distributions > F Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for an F distribution. The F distribution is a sampling distribution of two independent random variables with chi-square distributions, each divided by its degrees of freedom. It is most commonly used in test of variance. Use when random variables are greater than 0. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter. Numerator degrees of freedom: Enter the degrees of freedom for the numerator. Denominator degrees of freedom: Enter the degrees of freedom for the denominator. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Gamma Distribution Calc > Probability Distributions > Gamma Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a gamma distribution. The gamma distribution is often used to model positively skewed data. Use when random variables are greater than 0. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Shape parameter: Enter a shape parameter to define the gamma distribution. Scale parameter: Enter a scale parameter to define the gamma distribution. Threshold parameter: Enter a threshold parameter to define the gamma distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

Some references use 1/ b for the scale parameter. Minitab uses b.

Hypergeometric Distribution Calc > Probability Distributions > Hypergeometric Calculates probabilities, cumulative probabilities, and inverse cumulative probabilities for a hypergeometric distribution. The hypergeometric distribution is used for samples drawn from relatively small populations, without replacement.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

35

Manipulating and Calculating Data

Dialog box items Probability: Choose to calculate probabilities. Cumulative probability: Choose to calculate the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Population size (N): Enter the population size. This must be a positive number. Successes in population (M): Enter the number of successes in the population. This must be between 0 and N. Sample size (n): Enter the sample size. This must be between 0 and N. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Integer Distribution Calc > Probability Distributions > Integer Calculates probabilities, cumulative probabilities, and inverse cumulative probabilities for an integer distribution, which is a discrete uniform distribution that ranges from the minimum to the maximum integer value specified. Each integer in the range has equal probability. Dialog box items Probability: Choose to calculate probabilities. Cumulative probability: Choose to calculate the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Minimum value: Enter a number to define the lower end point of the discrete uniform distribution. Maximum value: Enter a number to define the upper end point of the discrete uniform distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you choose to store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you choose to store it, look in the Constants folder because the value is not displayed in the Session window.

Laplace Distribution Calc > Probability Distributions > Laplace Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a Laplace distribution. The Laplace distribution is used when the distribution is more peaked than a normal distribution. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a number for the location you want to define the Laplace distribution. Scale: Enter a number for the scale you want to define the Laplace distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate.

36

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window. Note

If you do not specify values, Minitab uses location = 0 and scale = 1.

Largest Extreme Value Distribution Calc > Probability Distributions > Largest Extreme Value Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a largest extreme value distribution. The largest extreme value distribution is used to model extreme maximum distributions, often in a reliability context. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a location to define the largest extreme value distribution. Scale: Enter a scale to define the largest extreme value distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

If you do not specify values, Minitab uses location = 0 and scale = 1.

Logistic Distribution Calc > Probability Distributions > Logistic Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a logistic distribution. The logistic distribution is used to model binary responses. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a number for the location you want to define the logistic distribution. Scale: Enter a number for the scale you want to define the logistic distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window. Note

If you do not specify values, Minitab uses location = 0 and scale = 1.

Loglogistic Distribution Calc > Probability Distributions > Loglogistic Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a loglogistic distribution. The loglogistic distribution is often used in biostatistics to model survival probabilities. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

37

Manipulating and Calculating Data Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a location to define the loglogistic distribution. Scale: Enter a scale to define the loglogistic distribution. Threshold: Enter a threshold to define the loglogistic distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

If you do not specify values, Minitab uses location = 0, scale = 1, and threshold = 0.

Lognormal Distribution Calc > Probability Distributions > Lognormal Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a lognormal distribution. The lognormal distribution is often used for reliability analysis and in financial applications, such as modeling stock behavior. A random variable follows the lognormal distribution if the logarithm of the random variable is normally distributed. Use when random variables are greater than 0. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a location to define the lognormal distribution. Scale: Enter a scale to define the lognormal distribution. Threshold: Enter a threshold to define the lognormal distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

If you do not specify values, Minitab uses shape = 0, scale = 1, and threshold = 0.

Normal Distribution Calc > Probability Distributions > Normal Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a normal distribution. Use when data follow a bell-shaped curve. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Mean: Enter the mean value you want to use as the center point for the normal distribution. Standard deviation: Enter the standard deviation you want to define the normal distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate.

38

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window. Note

If you do not specify values, Minitab uses mean = 0 and standard deviation = 1.

Poisson Distribution Calc > Probability Distributions > Poisson Calculates probabilities, cumulative probabilities, and inverse cumulative probabilities for a Poisson distribution. The Poisson distribution is often used when the probability of an event is small. Dialog box items Probability: Choose to calculate probabilities. Cumulative probability: Choose to calculate the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Mean: Enter a mean value greater than 0 and less than or equal to 709, which will define the Poisson distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Smallest Extreme Value Distribution Calc > Probability Distributions > Smallest Extreme Value Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a smallest extreme value distribution. The smallest extreme value distribution is used to model extreme minimum distributions, often in a reliability context. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Location: Enter a location to define the smallest extreme value distribution. Scale: Enter a scale to define the smallest extreme value distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window. Note

If you do not specify values, Minitab uses location = 0 and scale = 1.

t Distribution Calc > Probability Distributions > t Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a t distribution. The t distribution is symmetric about zero but has tails that are more spread out than those of the normal distribution. With increasing degrees of freedom, the t distribution looks more like the normal distribution. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

39

Manipulating and Calculating Data Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Noncentrality parameter: Enter a positive value to estimate the noncentrality parameter. Degrees of freedom: Enter the number of degrees of freedom you want to define the t distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Triangular Distribution Calc > Probability Distributions > Triangular Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a triangular distribution. Use the triangular distribution for random variables that are between two fixed limits. The distribution peaks at a value between the two limits. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Lower endpoint: Enter a number to define the minimum value for the triangular distribution. Mode: Enter a value to define the mode, or most likely observation, for the triangular distribution. Upper endpoint: Enter a number to define the maximum value for the triangular distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

Uniform Distribution Calc > Probability Distributions > Uniform Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a uniform distribution. Use to model data that range over an interval of equally likely values. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Lower endpoint: Enter a number to define the minimum value for the uniform distribution. Upper endpoint: Enter a number to define the maximum value for the uniform distribution. Input column: Enter the column you want to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. If you store them, look in the specified column in the Data window; they are not displayed in the Session window. Input constant: Enter the number or constant you want to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. If you store it, look in the Constants folder because the value is not displayed in the Session window.

40

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Calc Menu

Weibull Distribution Calc > Probability Distributions > Weibull Calculates the probability densities, cumulative probabilities, and inverse cumulative probabilities for a Weibull distribution. The Weibull distribution is useful to model product failures. Dialog box items Probability density: Choose to calculate the probability densities. Cumulative probability: Choose to compute the cumulative probabilities. Inverse cumulative probability: Choose to compute the inverse of the cumulative probabilities. Whenever this value is not defined, Minitab returns a missing value. Shape parameter: Enter a shape parameter to define the Weibull distribution. Scale parameter: Enter a scale parameter to define the Wiebull distribution. Threshold parameter: Enter a threshold parameter to define the Weibull distribution. Input column: Enter a column to evaluate. Optional storage: Enter a storage column for the generated values. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored values in the Data window, but not the Session window. Input constant: Enter a number or constant to evaluate. Optional storage: Enter a constant to store the generated value. For Inverse, stores the larger of two values if two are displayed. Minitab displays the stored constant in the Constants folder, but not the Session window.

Example of calculating critical values You can use Minitab to calculate a critical value for a hypothesis test instead of looking in a table in a book. Note

The following example is for a chi-square distribution; however, the method is similar for other distributions.

Suppose you want to do a χ2 test with α = 0.02 and 12 degrees of freedom. What is the corresponding critical value? An α of 0.02 corresponds to a cumulative probability value of 1 − 0.02 = 0.98. 1

Choose Calc > Probability Distributions > Chi-Square.

2

Choose Inverse cumulative probability. In Degrees of freedom, enter 12.

3

Choose Input constant and enter 0.98. Click OK.

Session window output Inverse Cumulative Distribution Function Chi-Square with 12 DF P( X Probability Distributions > F.

2

Choose Cumulative probability.

3

In Numerator degrees of freedom, enter 3. In Denominator degrees of freedom, enter 2.

4

Choose Input constant and enter 4.86.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

41

Manipulating and Calculating Data 5

In Optional storage, enter K1. Click OK.

K1 contains the cumulative distribution function. Now you will use the Calculator to subtract the p-value from 1. 6

Choose Calc > Calculator.

7

In Store result in variable, enter P-value.

8

In Expression, enter 1−K1. Click OK.

Data window output Note

This command does not produce output in the Session window. Instead, a column is stored in the worksheet.

Interpreting the results The calculated p-value, as shown in the Data window, is 0.175369. Using the 0.05 cutoff value, you would not conclude statistical significance since 0.175369 is not less than 0.05.

Example of computing the inverse cumulative probability Note

The following example is for a normal distribution; however, the method is similar for other distributions.

In the Example of computing the cumulative probability (cdf), you found the cdf for 27 (the area under the normal curve up to 27) to be 0.1587. Suppose you want to compute the inverse cumulative probability for 0.1587 from the same distribution. This value should be 27. 1

Choose Calc > Probability Distributions > Normal.

2

Choose Inverse cumulative probability.

3

In Mean, enter 28. In Standard deviation, enter 1.

4

Choose Input constant and enter 0.1587, then click OK.

Session window output Inverse Cumulative Distribution Function Normal with mean = 28 and standard deviation = 1 P( X Probability Distributions > Normal.

2

Choose Cumulative probability.

3

In Mean, enter 28. In Standard deviation, enter 1.

4

Choose Input constant and enter 27. Click OK.

Session window output Cumulative Distribution Function Normal with mean = 28 and standard deviation = 1 x 27 Note

P( X Display Data.

Interpreting the results The cdf for 27 is 0.158655. This value gives the area under the normal curve up to 27, shown in black.

Example of using the probability density function (pdf) Note

The following example is for a binomial distribution; however, the method is similar for other distributions.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

43

Manipulating and Calculating Data Suppose you bought four batteries. The package states that 95% of the batteries last at least 100 hours. If this is true, what are the chances that all four of the batteries will last at least 100 hours? That three will last that long? That none will last that long? This is a binomial problem because two outcomes exist for each battery: the battery lasts more than 100 hours, or it does not. 1

Type the numbers 1, 2, 3, and 4 (for each of the four batteries) into a worksheet column named Data.

2

Choose Calc > Probability Distributions > Binomial.

3

Choose Probability.

4

In Number of trials, enter 4. In Probability of success, enter 0.95.

5

Choose Input column and enter Data. Click OK.

Session window output Probability Density Function Binomial with n = 4 and p = 0.95 x 1 2 3 4

P( X = x ) 0.000475 0.013538 0.171475 0.814506

Note

If you specify a storage column, output is not produced in the session window. To see the results, look in the data window or use Data > Display Data.

Interpreting the results The probability that all four of the batteries will last at least 100 hours is 0.814506, and the probability that only three will last that long is 0.171475. The probability that none will last that long is 0.

44

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Data Menu Manipulating Data Overview You can duplicate the results of some of the procedures in this chapter by directly editing cells, rows, and columns, as described in Typing and Editing Data Overview. For example, you could duplicate some of the functionality of the Data > Stack Columns command by selecting cells in one column and pasting them into another. Copying and pasting using the mouse can be quicker and easier than filling out the manipulation dialog boxes. However, the commands in this menu allow you to perform complex actions that would be difficult or tedious to replicate in other ways. For example, not only can Data > Stack Columns stack the contents of multiple columns on top of each other, but the command also allows you to simultaneously create a column of subscripts (identifier codes) so you can see which values in the new column came from which source column. The methods you use−Data window editing commands or manipulation commands−depend on the complexity of your task.

Merging worksheets You can merge two open worksheets into a new worksheet, according to your specifications. You can merge using several options: •

combine the two worksheets in their original format side by side in a new worksheet - see Merging Worksheets.



combine the two worksheets side by side in a new worksheet, according the length and order of specified columns see Using By Columns to standardize merged worksheets.



choose which columns you would like to include in the new worksheet - see Using Include Columns.

Subsetting data You can subset data several ways: •

copy specified rows from the active worksheet to a new worksheet using Subset Worksheet−see Subsetting: Copy Data to a New Worksheet.



split the active worksheet into two or more new worksheets based on one or more "By" variables−see Subsetting: Split the Active Worksheet.

Copying worksheets You can copy the entire contents of the current worksheet to another specified worksheet. See Copy Worksheet to Worksheet.

Sorting, value ordering, and ranking data You can organize your data several ways: •

sorting alphabetizes or numerically orders one or more specified columns, and carries along associated columns. The ordering appears in the worksheet. See Sorting Data.



ranking assigns rank scores to values in a column: 1 to the smallest value in the column, 2 to the next smallest, and so on. Ties are assigned the average rank for that value. Missing values are left as missing. See Ranking Data.



value ordering organizes one or more text columns according to a defined ordering, such as months of the year, or color. The ordering isn't visible in the worksheet, but is used in subsequent statistical analyses. You can choose a standard Minitab ordering, or define your own ordering. See Ordering Text Categories.

Switching columns to rows and rows to columns You can rearrange your data by switching columns to rows (Transpose Columns) or by using the Stack command to switch rows to columns (Stack Rows)

Stacking and unstacking (splitting) columns You can stack and unstack data in the following manner: •

stack one or more columns on top of each other−see Stacking columns.



stack one or more blocks of columns on top of each other−see Stacking blocks of columns.



unstack columns or block of columns into conveniently sorted data −see Unstack blocks of columns.

More

You can also stack rows to create a single column−see Stack Rows. You can also switch columns to rows−see Transpose Columns.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

45

Manipulating and Calculating Data

Copying columns, constants, and matrices You can copy columns, constants, and matrices to/from each other. See Copy Columns to Columns, Copy Column to Constants, Copy Columns to Matrix, Copy Constants to Constants, Copy Constants to Column, Copy Matrices to Matrices, and Copy Matrix to Columns.

Combining text columns You can combine (concatenate) two or more text columns to create a new wider column−see Combining Text Columns Side-by-Side.

Coding data You can replace a value or set of values with new values. •

You can replace numeric, text, or date/time data with the same or a different type of data − see Coding Data.



You can also use a conversion table to code data − see Using a conversion table to code data.

Changing columns from one data type to another In Minitab, there are three types of columns: text, numeric, and date/time. Minitab provides six commands that allow you to change your data from one type to another. See Changing Columns from One Data Type to Another.

Extracting parts of a date/time column You can extract one or more parts of a date/time column, such as the year, the quarter, or the hour, and save that data in either a numeric or a text column. See Extracting Components of a Date/Time Column.

Displaying worksheet data You can display worksheet data (including columns, constants, and matrices) in the Session window. See Displaying Worksheet Data in the Session Window.

Deleting data You can delete individual rows and erase any combination of columns, constants, and matrices (including their names).

Subset Worksheet Subset Worksheet Data > Subset Worksheet Use to copy specified rows from the active worksheet to a new worksheet. You can specify the subset based on row numbers, brushed points on a graph, or a condition such as unmarried males under 50 years old. Split Worksheet splits, or unstacks, the active worksheet into two or more new worksheets based on one or more "By" variables. Subset Worksheet and Split Worksheet always copy data to new worksheets. You can use Copy Columns to replace data in the current worksheet with a subset.

Data Data can be numeric, text, or date/time.

Dialog box items Name of the New Worksheet Name: Enter a name for the new worksheet, which will replace the default name. Include or Exclude Specify which rows to include: Choose to copy specified rows to the new worksheet. Specify which rows to exclude: Choose to omit specified rows from the new worksheet. Specify Which Rows to Include/Exclude Rows that match: Choose to base your subset on an expression. Brushed rows: Choose to base your subset on brushed points on a graph. Row numbers: Choose to base your subset on specific row numbers, then type the row numbers. You may indicate ranges of rows with a colon. For example, if you type 1:4 15 20:22, rows 1, 2, 3, 4, 15, 20, 21, and 22 would be included . If you have columns of different lengths, see Subset Worksheet−Columns.

To subset of your current worksheet to a new worksheet 1

46

Choose Data > Subset Worksheet.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu 2 3

If you like, type a name for the new worksheet (instead of using the default name). Under Include or Exclude, do one of the following: • •

to copy specified rows to the new worksheet, choose Specify which rows to include. to omit the specified rows, choose Specify which rows to exclude.

4

Under Specify Which Rows to Include/Exclude, do one of the following: • to base your subset on an expression, choose Rows that match. Then click Condition, and complete the subdialog box to define the expression. Click OK. (see Subset Worksheet−Condition). • to base your subset on brushed points on a graph, choose Brushed rows. • to base your subset on specific row numbers, choose Row numbers, and type one or more row numbers (for example, 1:10). If you have columns of different lengths see Subset Worksheet−Columns.

5

Click OK.

Exactly what is copied to the new worksheets? Subset Worksheet copies columns to the new worksheet, but not stored constants or matrices. To copy stored constants and matrices as well, use the SUBSET session command. If columns in the active worksheet are all the same length, then Subset Worksheet copies all columns to the new worksheet. But what if columns are not all the same length? If you specify the subset with brushing, then Minitab copies all columns that are the same length as the columns you brushed. If you specify the subset with a condition, then Minitab copies all columns that are the same length as the result of the condition. If any columns are not copied to the new worksheet because of their length, Minitab displays a note to that effect in the Session window. If you specify the subset with row numbers, Minitab will display a dialog box for you to select which columns to copy to the new worksheet.

Subset Worksheet − Columns Data > Subset Worksheet > Specify Which Rows to Include > Row Numbers (when columns are of different lengths) Appears when your worksheet contains columns of different lengths.

Dialog box items Available columns: Lists all available columns. Include these columns: Select columns containing the rows to be included in the subset. Selected columns must be the same length.

Example of subsetting based on row numbers You have collected data on the voltage remaining in camera batteries immediately after a flash (VoltsAfter), versus the time required for the battery to be able to flash again (flash recovery time, FlashRecov). You decide to subset the data for rows 1, 3, 5, 6, 7, and 8 in a worksheet. You only want to include data from selected columns. Note

To subset your worksheet, you can use Data > Subset Worksheet or Data > Copy > Columns to Columns > Subset the Data. This example uses Data > Subset Worksheet, but the dialog box items are the same for both methods.

1

Open the worksheet BATTERIES.MTW.

2

Choose Data > Subset Worksheet.

3

Under Include or Exclude, choose Specify which rows to include.

4

Under Specify Which Rows To Include, choose Row numbers.

5

In Row numbers, enter 1 3 5:8. Click OK.

Note 6

A colon (:) signifies an inclusive range.

In the list box, double-click Cycles, FlashRecov, VoltsAfter, and Formulation. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Minitab creates a new worksheet with six rows and four columns of data.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

47

Manipulating and Calculating Data

Subset Worksheet − Condition Data > Subset Worksheet > Condition Use to create a conditional expression to subset worksheet data.

Dialog box items Condition: Enter the condition to be met by the selected rows. You can use any of the variables, functions, or calculator buttons to build your expression. For general rules on entering expressions, see Calculator Rules. Functions: Choose to select specific functions to include in the conditional expression. For definitions, see Calculator Functions. Calculator buttons: For definitions see: arithmetic operations (for +, –, *, /, **); comparison operations (for =, , < , >, =); logical operations (for And, Or, Not).

Example of subsetting based on a mathematical expression You've collected data on resting (Pulse 1) and post-workout (Pulse 2) pulse rates from a group of college-age students and want examine the data for the students whose pulse rate changed the most. You decide to create a new worksheet with only the data for students whose pulse rates differ by more than 20. Note

1

To subset your worksheet, you can use Data > Subset Worksheet or Data > Copy > Columns to Columns > Subset the Data. This example uses Data > Subset Worksheet, but the dialog box items are the same for both methods.

Open the worksheet PULSE.MTW.

2

Choose Data > Subset Worksheet.

3

Under Include or Exclude, choose Specify which rows to include.

4

Under Specify Which Rows To Include, choose Rows that match. Click Condition.

5

In Condition, enter 'Pulse2' – 'Pulse1' > 20. Click OK in each dialog box.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Minitab creates a new worksheet with 13 rows of data. For each row, Pulse2 - Pulse1 is greater than 20.

Example of subsetting based on a range of dates You are a hospital manager and you want to look at patient satisfaction ratings for a week in January. You decide to create a new worksheet with only the data for the week. Note

1

To subset your worksheet, you can use Data > Subset Worksheet or Data > Copy > Columns to Columns > Subset the Data. This example uses Data > Subset Worksheet, but the dialog box items are the same for both methods.

Open the worksheet HOSPITAL.MTW.

2

Choose Data > Subset Worksheet.

3

Under Include or Exclude, choose Specify which rows to include.

4

Under Specify Which Rows To Include, choose Rows that match. Click Condition.

5

In Condition, enter 'Departure' >= DATE("1/14/01") And 'Departure' Subset Worksheet or Data > Copy > Columns to Columns > Subset the Data. This example uses Data > Subset Worksheet, but the dialog box items are the same for both methods.

Open the worksheet PULSE.MTW.

2

Choose Data > Subset Worksheet.

3

Under Include or Exclude, choose Specify which rows to include.

4

Under Specify Which Rows To Include, choose Rows numbers and enter 3:92/3. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Minitab creates a new worksheet with 30 rows of data (data from every third row).

Example of subsetting based on brushed points in a graph The Example of a Simple Scatterplot, creates a scatterplot of the voltage remaining in camera batteries immediately after a flash (VoltsAfter), versus the time required for the battery to be able to flash again (flash recovery time, FlashRecov). You decide to omit the points with the lowest VoltsAfter from your analysis. Note

To subset your worksheet, you can use Data > Subset Worksheet or Data > Copy > Columns to Columns > Subset the Data. This example uses Data > Subset Worksheet, but the dialog box items are the same for both methods.

1

Make the Graph window active.

2

Choose Editor > Brush.

3

Drag the cursor over the three points with the lowest VoltsAfter values.

4

Choose Data > Subset Worksheet.

5

Under Include or Exclude, choose Specify which rows to exclude.

6

Under Specify Which Rows To Exclude, choose Brushed rows. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Minitab creates a new worksheet excluding the brushed points. Note that only the columns that are the same length as the graphed variables are included.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

49

Manipulating and Calculating Data

Split Worksheet Split Worksheet Data > Split Worksheet Use to split, or unstack, the active worksheet into two or more new worksheets based on one or more "By" variables. For instance, if you split your worksheet based on a By variable that contains the values "Yes" and "No," then Split Worksheet will create two new worksheets, one for the Yes's, and one for the No's. Generally, Split Worksheet is most useful when it will create only a few new worksheets. Although there is no absolute limit to the number of worksheets you can create with Split Worksheet, numerous worksheets can be cumbersome to manage. Use Subset Worksheet to copy specified rows from the active worksheet to a new worksheet. With Subset Worksheet, you can specify the subset based on row numbers, brushed points on a graph, or a condition such as unmarried males under 50 years old. Subset Worksheet and Split Worksheet always copy data to new worksheets. You can use Copy to replace data in the current worksheet with a subset. Note

The maximum number of groups that can be split is 50.

Data Data can be numeric, text, or date/time. By columns must be of equal length.

Dialog box items By variables: Enter at least one variable. Minitab will create as many new worksheets as there are distinct values in the By column(s). By columns must be of equal length. Include missing as a BY level: By default, Split Worksheet ignores rows where the By variable contains a missing value. To treat missing values as an additional distinct value, check Include missing as a BY level.

To split your current worksheet into two or more new worksheets 1

Choose Data > Split Worksheet.

2

In By variables, enter at least one variable. Minitab will create as many new worksheets as there are distinct values in the By variable(s). By columns must be of equal length. Click OK.

Exactly what is copied to the new worksheet? Split Worksheet copies data from columns to the new worksheets, but not stored constants or matrices. To copy stored constants and matrices as well, use the SPLIT session command (documented in Session Command Help). Split Worksheet copies all columns that are the same length as the By variable(s). It ignores columns with lengths not equal to the By variable(s). If any columns are not copied to the new worksheets because of their length, Minitab displays a note to that effect in the Session window.

Merge Worksheets Merge Worksheets Data > Merge Worksheets Use to combine two open worksheets into one new worksheet. Stored constants, matrices, DOE objects, and worksheet descriptions are not transferred into the merged worksheet. You can customize how the worksheets merge. By Columns options allow you to match observations from the two worksheets to be merged. Choose Include Columns to specify the columns from each original worksheet to include. More

To merge one worksheet into another, choose File > Open Worksheet and then choose the Merge Worksheets option. This method simply copies columns from one worksheet to another (placing them after the last column); By Columns and Include Columns options are not available.

Dialog box items Merge: Displays the current worksheet name. The current worksheet is always one of the worksheets to be merged. With: Choose another open worksheet to merge with the current worksheet. Output Worksheet Name: Enter a name for the new worksheet.

50

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

To merge worksheets 1

Open the two worksheets you want to merge and make sure one of them is active.

2

Choose Data > Merge Worksheets.

3

Under With, choose the worksheet that you want to merge with the active worksheet.

4

If you like, under Output worksheet name, type a name for the new worksheet (instead of using the default name).

5

If you like, use any dialog box items, then click OK.

Example of merging worksheets Two people conducted surveys in each of your company's five plants. Each person entered his survey results into a separate worksheet. You would like to combine the results into one worksheet. 1

Open the worksheet SURVEY4.MTW and then open the worksheet SURVEY3.MTW.

2

Choose Data > Merge Worksheets.

3

Under With, click SURVEY4.MTW.

4

Click OK.

Data window Survey4 C1

C2-T

Plant

Code

C3

Survey3 C4

C1

C2-T

Plant

C3

Code

C4

S1

S2

S1

S2

5

E

0.16

0.09

1

A

0.10

0.98

2

B

0.94

0.54

2

B

0.82

0.62

4

D

0.74

0.29

3

C

0.22

0.14

3

C

0.22

0.46

4

D

0.81

0.81

1

A

0.66

0.52

5

E

0.58

0.95

0.07

0.48

Merge Worksheet C1

C2-T

C3

C4

C5

C6-T

C7

C8

Plant:Survey3 Code:Survey3 S1:Survey3 S2:Survey3 Plant:Survey4 Code:Survey4 S1:Survey4 S2:Survey4 1

A

0.10

0.98

2

B

0.82

0.62

2

B

0.94

0.54

3

C

0.22

0.14

4

D

0.74

0.29

4

D

0.81

0.81

3

C

0.22

0.46

5

E

0.58

0.95

1

A

0.66

0.52

0.48

5

E

0.16

0.09

0.07

Interpreting the results All the columns from each worksheet are now in the merged worksheet as they appeared in the separate worksheets. To match values so that each row in the merged worksheet represents the same plant, see Example of merging worksheets with By Columns.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

51

Manipulating and Calculating Data

Merge Worksheets − By Columns Data > Merge Worksheets > By Columns Use to match observations from the two worksheets to be merged. You also can specify whether to include multiple observations, unmatched observations, and missing observations in the merged worksheet.

Dialog box items Available columns: Shows all the columns in each worksheet. By columns: Choose one or more pairs of columns (one column from each worksheet) to use as By Columns. By Column values from each worksheet are matched and placed in ascending order. The rest of the columns are sorted according to the By Columns, so that each row of the merged worksheet contains information for the same group. See Merging Worksheets With the Same Set of Units for more information. Include multiple obs: For each worksheet, check to include in the merged worksheet the observations that are repeated in the By Column for that worksheet. See Merging Worksheets With the Same Set of Units for more information. Include unmatched obs: For each worksheet, check to include in the merged worksheet the rows that do not have matching By Column values in the opposite worksheet. See Merging Worksheets With the Same Set of Units for more information. Include missing as a By level: Check to include in the merged worksheet rows with missing values in the By Columns. The missing observations are treated as distinct values. Missing By Column values from both worksheets are matched. Note

Missing values in text columns are represented by blanks; missing values in numeric and date/time columns are represented by asterisks.

Merging Worksheets With the Same Set of Units If you have information for the same set of units (e.g., cases, subjects, locations) in two different worksheets, you can use the By Columns feature of Merge to combine the information into a single worksheet so that each row contains information for the same unit. Specify a By Column containing the unit information for each worksheet. Minitab matches the By Column values from each worksheet and places them in ascending order. The remaining columns are sorted according to the By Columns. You also have the following options for By Columns: •

Include/exclude multiple observations



Include/exclude unmatched observations



Include/exclude missing observations

Example of merging worksheets using By Columns Suppose your company owns four plants. One worksheet contains net profit information for each plant and another worksheet contains expense information for each plant (or facility). The column Plant in the worksheet NET.MTW and the column Facility in the worksheet COSTS.MTW both refer to the same four locations. When you combine the worksheets, you want the profit and expense information for each location in the same row. Merge Worksheet Worksheet: Net

Worksheet: Costs

Plant

Facility

Profit

Plant:Net Profit:Net Facility:Costs Exp:Costs

Exp

3

23

1

12

1

24

1

12

1

24

4

10

2

29

2

14

2

29

2

14

3

23

3

15

4

30

3

15

4

30

4

10

Worksheet: NET.MTW By Column: Plant

Worksheet: COSTS.MTW By Column: Facility

The merged worksheet has both profit and expense information for each plant in a single row. Notice that the columns are now in ascending order of the values in the By Columns (Plant and Facility).

Requirements for By Columns •

The By Column names for each worksheet can be the same or different.



The By Columns must be the same length. Other columns that are not the same length as the By Columns are excluded from the merged worksheet. A note in the session window documents the columns excluded.



By Columns must have the same data type (numeric, date/time, or text).

52

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu •

With value ordered text, the value orders must be the same for both By Columns. For more information on value ordering, see Ordering Text Categories.

Including/excluding multiple observations You can specify how you want to handle multiple occurrences of a value in By Columns. One or both By Columns may contain a value that is repeated within the column. By default, Minitab creates separate rows for each occurrence in the merged worksheet. Examples of including/excluding multiple observations In the worksheet NET.MTW, the value 2 occurs twice in the Plant By Column. In the worksheet COSTS.MTW, the value 4 occurs twice in the Facility By Column. The following are examples of Merge using various settings for multiple observations.

Merge Worksheet Worksheet: Net

Worksheet: Costs

Plant

Facility

Plant:Net Profit:Net Facility:Costs Exp:Costs Profit

Exp

2

23

1

12

1

24

4

10

2

29

2

14

4

30

4

15

Worksheet: NET.MTW Worksheet: COSTS.MTW By Column: Plant By Column: Facility Include multiple obs: Yes Include multiple obs: Yes

24

1

12

2

23

2

14

2

29

2

14

4

30

4

10

4

30

4

15

Both rows for the value 2 from the Plant By Column are included, and the single corresponding value from the Facility By Column is simply repeated. Likewise, both rows for the value 4 from Facility are included, and the single corresponding value from Plant is repeated.

Merge Worksheet

Worksheet: Costs

Worksheet: Net Plant

1

Profit

Facility

Exp

Plant:Net Profit:Net Facility:Costs Exp:Costs

2

23

1

12

1

24

1

12

1

24

4

10

2

23

2

14

2

29

2

14

4

30

4

10

4

30

4

15

4

30

4

15

Worksheet: NET.MTW By Column: Plant Include multiple obs: No

Worksheet: Net Plant

Worksheet: COSTS.MTW By Column: Facility Include multiple obs: Yes

Both rows for the value 4 from the Facility By Column are included, but only the first occurrence of the value 2 from Plant is included.

Merge Worksheet

Worksheet: Costs

Profit 2

23

1

Facility

Exp

Plant:Net Profit:Net Facility:Costs Exp:Costs

1

12

1

24

1

12

24

4

10

2

23

2

14

2

29

2

14

4

30

4

10

4

30

4

15

Worksheet: NET.MTW Worksheet: COSTS.MTW By Column: Plant By Column: Facility Include multiple obs: No Include multiple obs: No

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Only the first occurrences of 4 in Facility and 2 in Plant are included.

53

Manipulating and Calculating Data

Including/excluding unmatched observations You can specify how you want to handle observations in the By Column of one worksheet that do not have a match in the By Column of the other worksheet. By default, Minitab creates rows for unmatched observations in the merged worksheet and displays missing value symbols where no match exists. Examples of including/excluding unmatched observations In the worksheet NET.MTW, the Plant By Column contains the value 5 which has no match in the Facility By Column. Likewise, in the worksheet COSTS.MTW, the Facility By Column contains the value 6 which has no match in the Plant By Column. The following are examples of Merge using various settings for unmatched observations.

Merge Worksheet Worksheet: Net

Worksheet: Costs

Plant

Facility

Plant:Net Profit:Net Facility:Costs Exp:Costs Profit 1

23

1

12

2

24

2

10

3

29

3

14

4

30

4

15

5

31

6

17

Worksheet: NET.MTW By Column: Plant Include unmatched obs: Yes

Plant

Profit 1

23

2

24

3

29

4 5

23

1

12

2

24

2

10

3

29

3

14

4

30

4

15

5

31

*

*

*

*

6

17

Both unmatched observations (5 in Plant and 6 in Facility) are displayed in the merged worksheet, and missing value symbols (∗) fill the resulting empty cells.

Facility

Exp

Merge Worksheet Plant:Net Profit:Net Facility:Costs Exp:Costs

1

12

1

23

1

12

2

10

2

24

2

10

3

14

3

29

3

14

30

4

15

4

30

4

15

31

6

17

*

*

6

17

Worksheet: NET.MTW By Column: Plant Include unmatched obs: No

Worksheet: COSTS.MTW By Column: Facility Include unmatched obs: Yes

Rows with unmatched By Column values in the worksheet NET.MTW are not included in the merged worksheet.

Worksheet: Costs

Worksheet: Net Plant

Worksheet: COSTS.MTW By Column: Facility Include unmatched obs: Yes

1

Worksheet: Costs

Worksheet: Net

Profit 1

23

2

Facility

Exp

Merge Worksheet Plant:Net Profit:Net Facility:Costs Exp:Costs

1

12

1

23

1

10

24

2

10

2

24

2

12

3

29

3

14

3

29

3

14

4

30

4

15

4

30

4

15

5

31

6

17

Worksheet: NET.MTW By Column: Plant Include unmatched obs: No

54

Exp

Worksheet: COSTS.MTW By Column: Facility Include unmatched obs: No

All unmatched observations are not included in the merged worksheet.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Including/excluding missing values By default, rows with missing values in either By Column are omitted in the merged worksheet. You can include missing values within By Columns for both worksheets. The missing observations are then treated as distinct values. Missing By Column rows in one worksheet are matched with missing By Column rows in the other worksheet.

To merge worksheets using By Columns 1

Open the two worksheets you want to merge and make sure one of them is active.

2

Choose Data > Merge Worksheets.

3

Under With, choose the name of the worksheet that you want to merge with the active worksheet.

4

If you like, under Output worksheet name, type a name for the new worksheet (instead of using the default name).

5

Click By Columns.

6

Under Available columns, click a column name or number for each worksheet to be used as By Columns.

7

Click

8

If you like, use any dialog box items, then click OK in each dialog box.

to move the highlighted columns to By columns.

Example of merging worksheets using By Columns Two people conducted surveys in each of your company's five plants. Each person entered the survey results into a separate worksheet in a different order. You would like to combine the results into one worksheet so that all the information for each plant is in the same row. 1

Open the worksheet SURVEY4.MTW and then open SURVEY3.MTW.

2

Choose Data > Merge Worksheets.

3

Under With, click SURVEY4.MTW.

4

Click By Columns.

5

Under Available columns, clickC1 Plant for both worksheets, then click columns.

6

Click OK in each dialog box.

to move the Plant columns to By

Data window Survey4

Survey3

C1

C2-T

C3

C4

C1

C2-T

C3

C4

Plant

Code

S1

S2

Plant

Code

S1

S2

5

E

0.16

0.09

1

A

0.10

0.98

2

B

0.94

0.54

2

B

0.82

0.62

4

D

0.74

0.29

3

C

0.22

0.14

3

C

0.22

0.46

4

D

0.81

0.81

1

A

0.66

0.52

5

E

0.58

0.95

0.07

Copyright © 2003–2005 Minitab Inc. All rights reserved.

0.48

55

Manipulating and Calculating Data

Merge Worksheet C1

C2-T

C3

C4

C5-T

C6

Plant:Survey3 Code:Survey3 S1:Survey3 Plant:Survey4 Code:Survey4 S1:Survey4 1

A

0.10

1

A

0.66

2

B

0.82

2

B

0.94

3

C

0.22

3

C

0.22

4

D

0.81

4

D

0.74

5

E

0.58

5

E

0.16

Interpreting the results In the merged worksheet, all the rows are now in ascending order by Plant. Note that the S2 columns from both worksheets were excluded from the merged worksheet because they are longer than the By Columns.

Merge Worksheets − Include Columns Data > Merge Worksheets > Include Columns Use to specify the columns to be included in the merged worksheet.

Dialog box items Exclude Columns: Use the arrows or double-click to move the columns you wish to exclude from the merged worksheet to this box. Include Columns: Use the arrows or double-click to move the columns you wish to include in the merged worksheet to this box.

To include/exclude columns while merging worksheets 1

Open the two worksheets you want to merge and make sure one of them is active.

2

Choose Data > Merge Worksheets.

3

Under With, choose the name of the worksheet that you want to merge with the active worksheet.

4

If you like, under Output worksheet name, type a name for the new worksheet (instead of using the default name).

5

Click Include Columns.

6

Under Include Columns, double-click the columns you want to exclude.

7

Click OK in each dialog box.

Copy Copy Columns to Columns Data > Copy > Columns to Columns You can copy data from columns in the current worksheet to columns in a specified worksheet.

Dialog box items Copy from columns: Enter the columns to copy. Store copied data in columns: Choose the target worksheet from the drop-down list. Name (optional): Type the name of the target worksheet. Name the columns containing the copied data: Check to have Minitab automatically name the target columns.

56

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Copy Column to Constants Data > Copy > Column to Constants You can copy data from a column into constants in the same worksheet. The number of rows included in the column must equal the number of constants.

Dialog box items Copy from column: Enter the column to copy. Store Copied Data In current worksheet, in constants: Enter the target constants to contain the copied data. Name the constants containing the copied data: Check to have Minitab automatically name the target constants.

Copy Columns to Matrix Data > Copy > Columns to Matrix You can copy data from columns into a matrix in the current worksheet. Columns must be of equal length.

Dialog box items Copy from columns: Enter the columns to copy. Store Copied Data In current worksheet, in matrix: Enter the target matrix. Name the matrix containing the copied data: Check to have Minitab automatically name the target matrix.

Copy Constants to Column Data > Copy > Constants to column You can copy data from selected constants into a new column in the current worksheet. Constants must be all numeric or all text.

Dialog box items Copy from constants: Enter the constants to copy. Store Copied Data In current worksheet, in column: Enter the target column. Name the column containing the copied data: Check to have Minitab automatically name the target column.

Copy Constants to Constants Data > Copy > Constants to Constants You can copy data from selected constants into new specified constants.

Dialog box items Copy from constants: Enter the constants to copy. Store Copied Data in Constants: Choose the target worksheet from the drop-down list. Name (optional): Type the name of the target worksheet. Name the constants containing the copied data: Check to have Minitab automatically name the target constants.

Copy Matrix to Columns Data > Copy > Matrix to Columns You can copy data in a matrix to specified columns in the current worksheet. The number of rows in the matrix must equal the number of columns.

Dialog box items Copy from matrix: Choose the matrix to copy. Store Copied Data In current worksheet, in columns: Enter the target columns. Name the columns containing the copied data: Check to have Minitab automatically name the target columns.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

57

Manipulating and Calculating Data

Copy Matrices to Matrices Data > Copy > Matrices to Matrices You can copy data in matrices into other specified matrices.

Dialog box items Copy from matrices: Enter the matrices to copy. Store Copied Data in Matrices: Choose the target worksheet from the drop-down list. Name (optional): Type the name of the target worksheet. Name the matrices containing the copied data: Check to have Minitab automatically name the target matrices.

Copy Worksheet to Worksheet Data > Copy > Worksheet to Worksheet You can copy the entire contents of the current worksheet to another specified worksheet.

Dialog box item Store Copied Data: Choose the target location of the copied worksheet from the drop-down list. Name (optional): Type the name of the target worksheet. Name the copied columns, constants, and matrices: Check to have Minitab automatically name the target columns, constants, and matrices.

To copy To copy... Columns to columns

Follow these steps: 1 Choose Data > Copy > Columns to Columns 2 In Copy from columns, enter one or more columns to copy. 3 From Store copied data in columns, choose one of the following: • In new worksheet, then enter the name of the new worksheet to copy the columns to (optional) • In following worksheet, after last column used, then enter the name of the existing worksheet to copy the columns to • In current worksheet, in columns, then enter one or more columns to copy to 4 Click OK.

Constants to constants

1 Choose Data > Copy > Constants to Constants. 2 In Copy from constants, enter one or more constants to copy. 3 From Store copied data in constants choose one of the following: • In new worksheet, then enter the name of the new worksheet to copy the constants to (optional) • In following worksheet, after last constant used, then enter the name of the existing worksheet to copy the constants to • In current worksheet, in constants, then enter one or more constants to copy to 4 Click OK.

Matrices to matrices

1 Choose Data > Copy > Matrices to Matrices. 2 In Copy from matrices, enter one or more matrices to copy. 3 From Store copied data in matrices, choose one of the following: • In new worksheet, then enter the name of the new worksheet to copy the matrices to (optional) • In following worksheet, after last matrix used, then enter the name of the existing worksheet to copy the matrices to • In current worksheet, in matrices, then enter one or more matrices to copy to 4 Click OK.

58

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Column to constants

1 Choose Data > Copy > Column to Constants. 2 In Copy from column, enter a column to copy. 3 In Store copied data in current worksheet, in constants, enter one or more constants to copy the column to. 4 Click OK.

Constants to column

1 Choose Data > Copy > Constants to Column. 2 In Copy from constants, enter one or more constants to copy. 3 In Store copied data in current worksheet, in column, enter the column to copy the constants to. 4 Click OK.

Matrix to columns

1 Choose Data > Copy > Matrix to Columns. 2 In Copy from matrix, enter a matrix to copy . 3 In Store copied data in current worksheet, in columns enter the columns to copy the matrix to. 4 Click OK.

Columns to matrix

1 Choose Data > Copy > Columns to Matrix. 2 In Copy from columns, enter one or more columns to copy. 3 In Store copied data in current worksheet, in matrix enter the matrix to copy the columns to. 4 Click OK.

Worksheet to worksheet

1 Choose Data > Copy > Worksheet to Worksheet. 2 From Store copied data, choose one of the following: • In new worksheet, then enter the name of the new worksheet to copy the worksheet to (optional) • In following worksheet, at the end, then enter the name of the existing worksheet to copy the worksheet to 4 Click OK.

Data − Copy You can copy text, numeric, or date/time values from the current worksheet using Data > Copy. Follow these guidelines, based on the data type and target of the copied data: •

When copying from columns to constants, data must be all numeric or all text and the number of rows in the column must equal the number of target constants. To meet the latter requirement, you can subset the data.



When copying from columns to a matrix, columns must be numeric and of equal length.



When copying from constants to columns, data must be all numeric or all text.



When copying from a matrix to columns, the number of rows in the matrix must equal the number of target columns.

Copy − Subset the Data Data > Copy > Columns to Columns > Subset the Data Data > Copy > Columns to Constants > Subset the Data Data > Copy > Columns to Matrix > Subset the Data You can specify the rows to include or exclude when copying from columns to either columns, constants, or a matrix.

Dialog box items Include or exclude Specify which rows to include: Choose to set conditions for including rows. Specify which rows to exclude: Choose to set conditions for excluding rows. Specify Which Rows to Include/Exclude All rows: Choose to include/exclude all rows. Rows that match: Choose to include/exclude rows matching specified conditions. Click Condition to enter the conditional expression. Brushed rows: Choose to include/exclude all brushed rows.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

59

Manipulating and Calculating Data Row numbers: Choose to include/exclude rows and/or ranges of rows. Enter the values in the active field. Note

When specifying row numbers, use a colon (:) to denote an inclusive range. For example, enter 1 4 6:10 to signify the set 1,4,6,7,8,9,10.

Copy − Subset the Data Data > Copy > Matrices to Matrices > Subset the Data Data > Copy > Matrix to Columns > Subset the Data You can specify which rows to include or exclude when copying from a matrix to columns or to another matrix.

Dialog box items Include rows numbered: Choose to specify certain rows to copy, then enter the rows and/or ranges of rows to include. Exclude rows numbered: Choose to specify certain rows to exclude when copying, then enter the rows and/or ranges of rows to exclude. Note

When specifying row numbers, use a colon (:) to denote an inclusive range. For example, enter 1 4 6:10 to signify the set 1,4,6,7,8,9,10.

Condition − Subset the Data Data > Copy > Columns to Columns > Subset the Data > Condition Data > Copy > Columns to Constants > Subset the Data > Condition Data > Copy > Columns to Matrix > Subset the Data > Condition ... Data Options > Subset > Condition You can create a conditional expression to subset worksheet data.

Dialog box items Condition: Enter the condition to be met by the selected rows. You can use any of the variables, functions, or calculator buttons to build your expression. For general rules on entering expressions, see Calculator Rules. Functions: Choose to select specific functions to include in the conditional expression. For definitions, see Calculator Functions. Calculator buttons: For definitions see: arithmetic operations (for +, –, *, /, **); comparison operations (for =, , < , >, =); logical operations (for And, Or, Not).

Unstack Columns Unstack Columns Data > Unstack Columns Use Unstack Columns to split the contents of a stacked column or block of columns into two or more shorter columns within your current worksheet or copy the split columns to a new worksheet. For instance, you might unstack a data set so that the sales data for each store is stored in a separate column. In the following illustration, the Sales column contains the stacked sales figures from stores in Boston, Denver, and Seattle. Unstack Columns splits this column into three separate columns based on the subscript in the Store column. The data in the Sales column are unstacked (split) into the Sales_Boston, Sales_Denver, and Sales_Seattle columns. The subscripts in the Store column determine where the values are placed. Sales

60

Store

Sales_Boston

Sales_Denver

Sales_Seattle

52

Denver

36

52

63

36

Boston

32

46

71

63

Seattle

35

51

68

46

Denver

29

50

66

32

Boston

71

Seattle

51

Denver

35

Boston

68

Seattle

50

Denver

29

Boston

66

Seattle

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Data Data can be numeric, text, or date/time. Columns must be the same length.

Dialog box items Unstack the data in: Enter the column or block of columns you want to unstack. Using subscripts in: Enter the column(s) containing the subscripts. The values in this column determine how the source column will be unstacked. Include missing as a subscript value: Check to have Minitab create a column for all missing values. Store unstacked data Specify where to store the unstacked columns or block of columns. In new worksheet: Choose to store the unstacked column or blocks of columns in a new worksheet. Name: (Optional) Specify a name for the new worksheet. After last column in use: Choose to place the unstacked column or block of columns in the current worksheet after the last column that contains data. Name the columns containing the unstacked data: Check to name the columns containing the unstacked data. Note

To unstack each value in a column into individual stored constants, use the session command UNSTACK, documented in Session Command Help.

To unstack a column or block of columns into two or more shorter columns 1

Choose Data > Unstack Columns.

2

In Unstack the data in, enter the column or block of columns you want to unstack.

3

In Using subscripts in, enter the column(s) containing the subscripts. The values in the subscript column determine how the columns or block of columns will be unstacked. Under Store unstacked data in, choose the location for the new unstacked columns or block of columns: • choose In new worksheet to place the unstacked columns or block of columns into a separate worksheet • choose After last column in use to place the unstacked columns or block of columns in the current worksheet after the last column that contains data

4

If you like, use any of the dialog box options, then click OK.

Note

To unstack each value in a column into individual stored constants, use the session command UNSTACK, documented in Session Command Help.

Example of unstack one column Suppose you want to see the sales figures for your stores in Boston, Denver, and Seattle. To split the combined sales figures into separate columns for each store, do the following: 1

Open the worksheet SALES2.MTW.

2

Choose Data > Unstack Columns.

3

In Unstack the data in, enter Sales.

4

In Using subscripts in, enter Store.

5

Under Store unstacked data, choose After last column in use to place the unstacked column in the current worksheet after the Store column.

6

Check Name the columns containing the unstacked data and click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

61

Manipulating and Calculating Data

Data Window C2 Sales

C3-T

C4

Store

C5

C6

Sales_Boston

Sales_Denver

52

Denver

36

52

63

36

Boston

32

46

71

63

Seattle

35

51

68

46

Denver

29

50

66

32

Boston

71

Seattle

51

Denver

35

Boston

68

Seattle

50

Denver

29

Boston

66

Seattle

Sales_Seattle

Interpreting the results The figures in the Sales column are split into three new columns. The new columns of data are alphabetically arranged according to the subscripts contained in the Store column.

Example of Unstack a Block of Columns Suppose you want to analyze each store's sales figures by quarter. 1

Open the worksheet SALES2.MTW.

2

Choose Data > Unstack Columns.

3

In Unstack the data in, enter Qtr Sales.

4

In Using subscripts in, enter Store.

5

Under Store unstacked data, choose After last column in use to place the unstacked column in the current worksheet after the Store column.

6

Check Name the columns containing the unstacked data and click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1

C2

Qtr

C3-T

Sales

C4

C5

C6

C7

C8

C9

Store Qtr_Boston Sales_Boston Qtr_Denver Sales_Denver Qtr_Seattle Sales_Seattle

1

52 Denver

1

36

1

52

1

63

1

36 Boston

2

32

2

46

2

71

1

63 Seattle

3

35

3

51

3

68

2

46 Denver

4

29

4

50

4

66

2

32 Boston

2

71 Seattle

3

51 Denver

3

35 Boston

3

68 Seattle

4

50 Denver

4

29 Boston

4

66 Seattle

Interpreting the results The figures in the Qtr and Sales columns are split into six new columns.

62

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Stack/Unstack Stack (Data menu) Data > Stack Stack Columns − stacks a list of columns, one on top of the other, to form a new, longer column Stack Blocks of Columns − stacks blocks of columns, one block on top of the other, to form a new, longer block of columns Stack Rows − switches rows to columns

Stack Columns Data > Stack > Stack Columns Use Stack Columns to move data from two or more columns to one longer column within your current worksheet or to a new worksheet. When you stack columns, you can also create a column of subscripts, or identifier codes, that indicate which column an observation came from. You can use these subscripts to: •

subset your data



create graphs in which data points display differently depending on which group they are from



unstack the columns

In the illustration below, the Sales column shows the combined sales data from stores in Denver, Boston, and Seattle. We know that the values 36, 32, 35, and 29 in the Sales column represent the sales figures from the Boston store because the subscript value (in the Store column) is Boston. The data in the Boston column are stacked below the Denver data and on top of the Seattle data in the new Sales column. C1

C2

C3

C4

C5

C6-T

Quarter

Denver

Boston

Seattle

Sales

1

52

36

63

52

Denver

2

46

32

71

46

Denver

3

51

35

68

51

Denver

4

50

29

66

50

Denver

36

Boston

32

Boston

35

Boston

Store

29

Boston

63

Seattle

71

Seattle

68

Seattle

66

Seattle

The values in the Store column are subscripts that identify which column the value came from. See To stack two or more columns into a new, longer column for detailed instructions on how to stack the data as shown above. It is usually a good idea to store a subscript column so you can identify the data point associated with each group. For example, in this case, you could analyze the data in Sales, using the data in Store as a factor or a grouping variable.

Data Data can be numeric, text, or date/time. Columns are not required to be the same length

Dialog box items Stack the following columns: Enter the columns you want to stack. The first is stacked on top of the second, the second on top of the third, and so on. Store the stacked data in Choose the location for the new stacked data. New worksheet: Choose to store the stacked column in a new worksheet. Name: (Optional): Specify a name for the new worksheet. Column of current worksheet: Choose to store the stacked data in a column of the current worksheet and specify that column.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

63

Manipulating and Calculating Data Store subscripts in: (Optional): Enter a column where you want to store subscripts. The subscript column will contain 1's in rows corresponding to the first stacked column, 2's in rows corresponding to the second stacked column, and so on. This subscript column may be used for factor levels in analysis of variance procedures or as a BY variable for other descriptive and investigatory procedures. It may also be used to unstack a column at a later time. Use variable names in subscript column: Check to use variable names in the subscript column. To stack stored constants, use the session command STACK, documented in Session Command Help.

Note

To stack two or more columns into a new, longer column 1

Choose Data > Stack > Columns.

2

In Stack the following columns, enter the columns that contain the data you want to stack. The first column is stacked on top of the second column, the second on top of the third, and so on.

3

Under Store the stacked data in, choose the location for the new stacked data: • choose New worksheet to place the stacked column into a separate worksheet • choose Column of current worksheet to place the stacked column in the current worksheet in the column you specify

4

Use any of the dialog box options, then click OK. To stack stored constants, use the session command STACK, documented in Session Command Help.

Note

Example of Stack Columns Example of stacking two or more columns into a new, longer column Suppose you want to analyze the quarterly sales data for one of your products. You focus on the sales at three outlet stores as shown in the following steps. 1

Open the worksheet SALES.MTW.

2

Choose Data > Stack > Columns.

3

In Stack the following columns, enter Denver Boston Seattle.

4

Under Store the stacked data in, choose Column of current worksheet and enter Sales.

5

In Store subscripts in, enter Store.

6

Check Use variable names in subscript column and click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1

C2

C3

C4

C5

C6-T

Quarter

Denver

Boston

Seattle

Sales

1

52

36

63

52

Denver

2

46

32

71

46

Denver

3

51

35

68

51

Denver

4

50

29

66

50

Denver

36

Boston

32

Boston

35

Boston

Store

29

Boston

63

Seattle

71

Seattle

68

Seattle

66

Seattle

Interpreting the results The sales figures from the Denver, Boston, and Seattle columns are now stacked in the Sales column. The Store column contains the subscripts.

64

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Stack Blocks of Columns Data > Stack > Blocks of Columns Use Stack Blocks of Columns to move data from several columns to one longer block of columns in your current or a new worksheet. When you stack blocks of columns, you can also create a column of subscripts, or identifier codes, that indicate which column an observation came from. You can use these subscripts to •

subset your data



create graphs in which data points display differently depending on which group they are from



unstack the blocks of columns

In the following illustration, the Qtr and Sales columns contain the quarterly sales figures from the Denver store stacked on top of the Boston store's quarterly totals, which are stacked on top of the figures from the Seattle store. The Store column contains the subscripts. C1

C2

C3

C4

C5

C6

C6-T

Quarter

Denver

Boston

Seattle

Sales

Qtr

1

52

36

63

52

1

Denver

2

46

32

71

46

2

Denver

3

51

35

68

51

3

Denver

4

50

29

66

50

4

Denver

36

1

Boston

32

2

Boston

35

3

Boston

29

4

Boston

63

1

Seattle

71

2

Seattle

68

3

Seattle

66

4

Seattle

Store

The data in the Quarter and Boston columns are stacked below the Quarter and Denver data and on top of the Quarter and Seattle data to form the new Qtr and Sales columns. The values in the Store column are subscripts that identify which column the sales figures came from. See To stack two or more blocks of columns into a new, longer block of columns for detailed instructions on how to stack the data as shown above. It is usually a good idea to store a subscript column so you can identify the data point associated with each group. For example, in this case, you could analyze the data in Sales, using the data in Qtr and Store as factor or grouping variables.

Data Data can be numeric, text, or date/time, but the columns that are stacked together must be of the same data type. Columns are not required to be the same length.

Dialog box items Stack two or more blocks of columns on top of each other: Enter each block of columns to be stacked in a separate box. The first block is stacked on top of the second, the second on top of the third, and so on. Store stacked data in Choose whether to store stacked data in a new worksheet or in columns of the current worksheet. New worksheet: Choose to store the stacked blocks in a new worksheet. Name: (Optional) Specify a name for the new worksheet. Columns of current worksheet: Choose to store the stacked blocks in columns of the current worksheet and specify the columns. Store subscripts in: (Optional) Enter a column where you want to store subscripts. The subscript column will contain 1's in rows corresponding to the first stacked block of columns, 2's in rows corresponding to the second stacked block, and so on. This subscript column may be used for factor levels in analysis of variance procedures or as a BY variable for other descriptive and investigatory procedures. It may also be used to unstack columns at a later time. Use variable names in subscript column Check to use variable names in the subscript columns. The variable names will correspond to the stacked blocks in place of numbers. Note

To stack blocks of stored constants or more than five blocks of columns in one step, use the session command STACK.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

65

Manipulating and Calculating Data

To stack two or more blocks of columns into a new, longer block of columns 1

Choose Data > Stack > Blocks of Columns.

2

In Stack two or more blocks of columns on top of each other, enter each block of columns to be stacked. Each block of variables must be entered into a separate text box. All variables must have the same number of columns.

3

Under Store stacked data in, choose: • New worksheet to store the stacked blocks in a new worksheet, or • Columns of current worksheet to specify the columns where you want to store the stacked blocks.

4

If you store the data in the current worksheet and you want to store the subscripts, specify a column where you want to store the subscripts. Click OK. To stack blocks of stored constants or more than five blocks of columns in one step, use the session command STACK, documented in Session Command Help.

Note

Example of Stack Blocks of Columns Assume that you have accumulated the quarterly sales data for the Denver, Boston, and Seattle stores. Now, you want to stack blocks of sales data. 1

Open the worksheet SALES.MTW.

2

Choose Data > Stack > Blocks of Columns.

3

In Stack two or more blocks of columns on top of each other, enter Denver Quarter in the first box, Boston Quarter in the second box, and Seattle Quarter in the third box.

4

Select Columns of current worksheet, and enter Sales Qtr to indicate where the newly stacked data will be stored.

5

In Store subscripts in, enter Store to identify the column that will contain the subscripts.

6

Check Use variable names in subscript column and click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1

C2

C3

C4

C5

C6

C6-T

Quarter

Denver

Boston

Seattle

Sales

Qtr

Store

1

52

36

63

52

1

Denver

2

46

32

71

46

2

Denver

3

51

35

68

51

3

Denver

4

50

29

66

50

4

Denver

36

1

Boston

32

2

Boston

35

3

Boston

29

4

Boston

63

1

Seattle

71

2

Seattle

68

3

Seattle

66

4

Seattle

Interpreting the results The Qtr and Sales columns contain the quarterly sales figures from the three stores stacked on top of each other. The Store column contains the subscripts.

Stack Rows − Switching Rows to Columns Data > Stack > Stack Rows You can switch rows to columns in your worksheet. Suppose you work at a plant that makes plastic trashbags. You have been having trouble with the seal at the bottom of the bag breaking apart. In an attempt to isolate the problem, you took four strength measurements on the first work day of

66

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu each week from January 15th through February 24th. You originally entered each subgroup's data (four measurements) across a row in the worksheet. In addition, you entered the day on which the data was collected in a separate column. Now you need to stack the row data to create a single column of data. For example, you may want to change the worksheet data structure in the manner below. The first row of the columns Measure1 through Measure4 become the first four rows of the new data column named Strength. The Measure column stores the subscripts. C1

C2

C3

C4

C5

C6

Day

C7

C8

Measure1

Measure2

Measure3

Measure4

Strength

Measure

SubgrpNumber

13

26.75

26.71

25.19

25.77

26.75

Measure1

13

20

26.74

27.30

27.15

27.05

26.71

Measure2

13

27

26.50

26.47

25.87

26.27

25.19

Measure3

13

3

25.33

27.17

27.33

26.89

25.77

Measure4

13

10

27.20

25.22

26.75

26.02

26.74

Measure1

20

17

25.30

27.92

28.10

27.03

27.30

Measure2

20

24

27.33

26.88

26.72

26.92

27.15

Measure3

20

27.05

Measure4

20

26.50

Measure1

27

26.47

Measure2

27

25.87

Measure3

27

...

...

...

Data The data columns must be of the same type, and must be of equal length

Dialog box items Rows to be stacked are in the following columns: Enter the columns that contain the data you want to appear in a single column. Store stacked data in: Enter a column number or name in which to store the stacked data. Store row subscripts in: Check to store the row subscripts in a column, and enter the column number or name. Store column subscripts: Check to store the column subscripts, and enter the column number or name. Expand the following columns while stacking rows: Check to expand columns while stacking rows, and enter the column names or numbers. Store the expanded columns in: Enter the column names or numbers in which to store the expanded columns.

Data − Stack Rows The data columns must be of the same type, and must be of equal length.

To switch rows to columns in your worksheet 1

Choose Data > Stack > Rows.

2

In Rows to be stacked are in the following columns, enter the columns that contain the data you want to appear in a single column.

3

In Store stacked data in, enter a column number or name.

4

If you like, use any of the dialog box options, then click OK.

Example of Stack Rows − Switching Rows to Columns Suppose you work at a plant that makes plastic trash bags. You have been having trouble with the seal at the bottom of the bag breaking apart. In an attempt to isolate the problem, you took four strength measurements on the first work day of each week from January 15th through February 24th. You originally entered each subgroup's data (four measurements) across a row in the worksheet. In addition, you entered the day on which the data was collected in a separate column. Now you need to stack the row data to create a single column of data. 1

Open the file TRASHBAG.MTW.

2

Choose Data > Stack > Rows.

3

In Rows to be stacked are in the following columns, enter Measure1−Measure4.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

67

Manipulating and Calculating Data 4

In Store stacked data in, enter Strength.

5

Check Store column subscripts, and enter Measure.

6

Check Expand the following columns while stacking rows, and enter Day.

7

In Store the expanded columns in, enter SubgrpNumber. Click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1

C2

C3

C4

C5

C6

C7

C8

Day

Measure1

Measure2

Measure3

Measure4

Strength

Measure

SubgrpNumber

13

26.75

26.71

25.19

25.77

26.75

Measure1

13

20

26.74

27.30

27.15

27.05

26.71

Measure2

13

27

26.50

26.47

25.87

26.27

25.19

Measure3

13

3

25.33

27.17

27.33

26.89

25.77

Measure4

13

10

27.20

25.22

26.75

26.02

26.74

Measure1

20

17

25.30

27.92

28.10

27.03

27.30

Measure2

20

24

27.33

26.88

26.72

26.92

27.15

Measure3

20

27.05

Measure4

20

26.50

Measure1

27

26.47

Measure2

27

25.87

Measure3

27

...

...

...

Interpreting the results The rows are stacked into a single column (Strength), the subscripts are stored in the Measure column, and the values from the Day column have been expanded and serve as subgroup numbers.

Transpose Transpose Columns − Switching Columns to Rows Data > Transpose Columns You can switch columns to rows (transpose columns) in your worksheet. For example, you may want to change the worksheet data structure as shown in the illustration below. The columns that contain each student's exercise totals are switched to rows. This arrangement allows you to analyze the data by exercise type. C1-T Task

C2

C3

Lyn

C4

Bill

C5

Sam

Pushups

50

69

Pullups

66

85

Situps

73

88

C6-T

Marie 70

Labels

C7

C8

C9

Pushups Pullups

Situps

57 Lyn

50

66

73

81

76 Bill

69

85

88

95

79 Sam

70

81

95

57

76

79

Marie

See the example for detailed instructions on how to rearrange the data as shown above.

Data Data must be of the same type, and columns must be the same length.

Dialog box items Transpose the following columns: Enter the columns you want to transpose Store transpose: Choose the location for the transposed columns In new worksheet: Choose In new worksheet to place the transposed columns in a separate worksheet Name: Specify the name of the separate worksheet After last column in use: Choose After last column in use to place the transposed columns in the current worksheet after the last column that contains data Create variable names using column: Specify the column that will designate the variable names

68

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

To switch columns to rows in your worksheet 1

Choose Data > Transpose Columns.

2

In Transpose the following columns, enter the columns you want to transpose.

3

Under Store transpose, choose the location for the transposed columns: • choose In new worksheet to place the transposed columns in a separate worksheet • choose After last column in use to place the transposed columns in the current worksheet after the last column that contains data

4

If you like, use any of the dialog box options, then click OK.

Example of Transpose Columns - Switching Columns to Rows Suppose you are analyzing data based on students' progress in your exercise class. The current data is arranged in columns by student, but you need to rearrange the columns by the types of exercises your students are doing. 1

Open the worksheet EXERCISE.MTW.

2

Choose Data > Transpose Columns.

3

In Transpose the following columns, enter Lyn Bill Sam Marie.

4

Under Store transpose, choose After last column in use.

5

In Create variable names using column, enter Task. Click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1-T Task

C2

C3

Lyn

C4

Bill

C5

Sam

C6-T

Marie

Labels

C7

C8

C9

Pushups Pullups

Situps

Pushups

50

69

70

57 Lyn

50

66

73

Pullups

66

85

81

76 Bill

69

85

88

Situps

73

88

95

79 Sam

70

81

95

57

76

79

Marie

Interpreting the results The four original columns are switched to four rows of data arranged into three columns containing the exercise data.

Sort Sort Data > Sort You can sort one or more columns of data according to values in the associated column(s) you select. Sorting alphabetizes or numerically orders the data and carries along the associated columns. You can sort in ascending or descending order, and you can specify whether the sorted data should be stored in the original columns, other columns you specify, or in a new worksheet. Rules for Sorting Data describes how Minitab sorts different data types. Note

To sort by more than four columns, use the Session command SORT with the BY subcommand, documented in Session Command Help.

Dialog box items Sort column(s): Enter one or more columns to sort. By column: Enter up to four columns to use as sorting criteria. Descending: Check to sort from highest to lowest. Store sorted data in New Worksheet: Choose to put the sorted data in a new worksheet. The data are placed starting with C1. Name: Enter a name for the new worksheet.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

69

Manipulating and Calculating Data Original column(s): Choose to replace the unsorted data with the sorted data. Column(s) of current worksheet: Choose to store the sorted data in columns of the current worksheet and enter the storage columns.

Data − Sort Data can be numeric, text, or date/time. Columns must be of equal length.

To sort data 1

Choose Data > Sort.

2

In Sort column(s), enter one or more columns to sort.

3

In By column, enter at least one and up to four columns to sort by. Minitab sorts rows by the first column listed, then by the second column, and so on.

4 To sort from highest to lowest rather than from lowest to highest, check Descending. 5 under Store sorted column(s) in, choose one of the following, then click OK: •

New worksheet to put the sorted data in a new worksheet. The data are placed starting with C1.

• •

Original column(s) to replace the unsorted data with the sorted data. Column(s) of current worksheet to store the sorted data in columns of the current worksheet and enter the storage columns.

− Name: Enter a name for the new worksheet.

Rules for Sorting Data 1

Minitab sorts words in alphabetical order, observing the following rules: • If two words are the same except for case, lower case is sorted before upper. • If words contain special symbols (for example, ? or %), Minitab uses the ASCII collating sequence. • If two words are exactly the same, Minitab leaves them in their original order. • Missing values (blanks) in text columns are sorted first.

2

Missing values (∗) in numeric and date/time columns are sorted last.

Example of sorting data by one column 1

Enter the following data into a new worksheet: C1:

2

3

1

4

5

C2: 10 11 12 13 14 2

Choose Data > Sort.

3

In Sort column(s), enter C1 C2.

4

In the first By column, enter C1.

5

In Store sorted data in, choose Column(s) of current worksheet and enter C3 C4. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window C1

C2

C3

C4

2

10

1

12

3

11

2

10

1

12

3

11

4

13

4

13

5

14

5

14

Interpreting the results C1 and C2 contain the original data; C3 and C4 hold the data sorted by C1 (in ascending order).

70

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Example of sorting data by two columns You want to view the sales data for each of your advertising agencies. You would like to list the ad agencies alphabetically, with their corresponding sales data shown in descending order. 1

Open the worksheet MARKET.MTW.

2

Choose Data > Sort.

3

In Sort column(s), enter Sales Advertis AdAgency.

4

In the first By column, enter AdAgency.

5

In the second By column, enter Advertis and check Descending.

6

In Store sorted data in, choose Column(s) of current worksheet and enter C8 C9 C10. Click OK. This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C4

C5

C7

C8

C9

C10

Sales

Advertis

94

17

Omega

106

24

99

10

Omega

92

22

Alpha

98

9

116

18

Alpha

AdAgency

Alpha

Alpha

92

22

Alpha

98

9

106

24

Alpha

94

17

Omega

Alpha

116

18

Alpha

108

14

Omega

113

13

Omega

113

13

Omega

108

14

Omega

99

10

Omega

Interpreting the results C4, C5, and C7 contain the original data. C8, C9, and C10 contain the data sorted first by Ad Agency (ascending order), then by Advertis (descending order).

Rank Rank Data > Rank You can assign rank scores to values in a column: 1 to the smallest value in the column, 2 to the next smallest, and so on. Ties are assigned the average rank for that value. Missing values are left as missing In the following illustration, Minitab assigns rank scores to the Sales column and stores them in a new column: Sales 0.5 1.0 1.5 1.0 2.0 0.0

-->

C2 2.0 3.5 5.0 3.5 6.0 1.0

Dialog box items Rank data in: Select the column you want to rank. Store ranks in: Indicate the storage column for the ranked data.

Data − Rank Data must be numeric.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

71

Manipulating and Calculating Data

To calculate rank scores 1

Choose Data > Rank.

2

In Rank data in, enter the column for which you want to calculate ranks.

3

In Store ranks in, enter the storage column for those ranks, then click OK.

Example of calculating rank scores Here are the instructions for assigning rank scores to values in a column. 1

Open the worksheet MARKET.MTW

2

Choose Data > Rank.

3

In Rank data in, enter Sales.

4

In Store ranks in, enter Rank. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window C4

C8

Sales

Rank

94

2

99

4

98

3

92

1

106

5

116

8

113

7

108

6

Interpreting the results The rank assignments for Sales are stored in a new column, Rank.

Delete Rows Delete Rows Data > Delete Rows Deletes specified rows from columns in the worksheet and moves the remaining rows up.

Dialog box items Delete rows: Specify the rows or range of rows you want to delete, using a colon (:) to indicate an inclusive range. For example, if you entered 1:4 7 8, rows 1, 2, 3, 4, 7 and 8 would be deleted. From columns: Select the column(s) from which you want the rows to be deleted. Note

You can also delete rows directly, in the Data window. Just highlight the rows you want to delete, and press .

If you want to clear rows, rather than delete them, highlight the rows you want to clear in the Data window, then choose Edit > Clear Cells. (If the selected rows are in the middle of a column, clearing replaces the selected rows with missing values. If the selected rows are at the end of a column, clearing deletes those rows.)

72

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Erase Variables Erase Variables Data > Erase Variables Erases any combination of columns, constants, and matrices (including their names). It's a good idea to erase all variables you no longer need.

Dialog box items Columns, constants, and matrices to erase: Select the columns, constants, and matrices that you want to remove from the worksheet. Tip

You can also delete columns directly in the Data window. Just highlight the columns you want to delete, then press . See Editing Columns. To erase stored constants and matrices, however, you must use the Erase Variables command.

Note

You can also clear a column, that is, erase all values in the column and leave it empty. To do this, highlight the column, click the right mouse button, and choose Clear Cells.

To erase constants, matrices, and non-contiguous columns Because constants and matrices do not appear in the Data window, the Erase Variables command is the only way to erase them. Caution If you delete constants, matrices, or columns, you cannot undo the action. 1

Choose Data > Erase Variables.

2

In Columns, constants, and matrices to erase, enter any combination of columns, constants, and matrices, then click OK.

Code Code Data > Code Numeric to Numeric − code numbers Numeric to Text − code numbers to text values Numeric to Date/Time − code numbers to date/time values Text to Text − code text Text to Numeric − code text to numbers Text to Date/Time − code text to date/time values Date/Time to Date/Time − code date/time values Date/Time to Numeric − code date/time values to numbers Date/Time to Text − code date/time values to text Use Conversion Table − code numbers, date/time values, or text values to new values, based on a conversion table which you set up in the worksheet

Copyright © 2003–2005 Minitab Inc. All rights reserved.

73

Manipulating and Calculating Data

Code Data > Code > Numeric to Numeric Data > Code > Numeric to Text Data > Code > Numeric to Date/Time Data > Code > Text to Text Data > Code > Text to Numeric Data > Code > Text to Date/Time Data > Code > Date/Time to Date/Time Data > Code > Date/Time to Numeric Data > Code > Date/Time to Text Use Code to change a value or set of values to new values. See When you might use code for specific examples. To code values based on a conversion table, use Data > Code > Use Conversion Table. For more information on date/time formats, see Using Date/Time Data.

Dialog box items Code data from columns: Enter one or more columns you want to change. Into columns: Enter one or more columns where you want to store the coded values. Original values: Type the values or range of values that you want to change. You may type multiple values, such as 1:3 15 20 or red white blue; just separate the values with a space. New: Specify the new value with which you want to replace each original value.

Data − Code Data can be numeric, text, or date/time.

To code numeric, text, or date/time data 1

Choose Data > Code and then choose the type of coding you want to do.

2

In Code data from columns, enter one or more columns containing data that you want to change. Minitab displays only those columns whose type corresponds to the coding method.

3

In Into columns, enter one or more columns where you want to store the changed data.

4

In Original values, enter the data values you want to change. You may type multiple values, such as 1:3 15 20 or red white blue; just separate the values with a space. The following rules apply:

5



Separate the ranges with colons, such as 1:3. Dates must have a space on either side of the colon, such as 2/22/02 : 4/15/02



Enclose the missing value symbol with single quotes, such as '∗'



If a text value includes an embedded space, enclose it with double quotes, such as "New York"



If a date/time value includes time, enclose it in double quotes, such as "01-Aug 06:15:00"

In New, specify the new value you want to replace the original value(s) with. Click OK.

More

You can only code up to eight new values. Use the session command CODE to code up to 50 new values.

When You Might Use Code Here are some examples of when you might use the various code commands. Use...

To code...

Numeric to Numeric



Test scores from 91 through 100 to a 4 (grade of A), from 81 through 90 to a 3 (grade of B), from 71 through 80 to a 2 (grade of C), from 61 through 70 to a 1 (grade of D), and 60 or below to a 0 (grade of F)



All occurrences of −99 to ∗ (the missing value symbol)

Numeric to Text

Test scores from 91 through 100 to an A, from 81 through 90 to a B, from 71 through 80 to a C, from 61 through 70 to a D, and 60 or below to an F.

Numeric to Date/Time

People's ID numbers to their birthdays; for example, 45234 to 11/15/75; 45235 to 12/4/65; etc.

Text to Text

74

Tennessee to TN, North Carolina to NC, Alabama to AL, Georgia to GA.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

The letter grade A to a 4, B to a 3, C to a 2, D to a 1, and F to a 0.

Text to Numeric Text to Date/Time

Month names to dates. For example, code January to 1/1/02, February to 02/01/02, etc.

Date/Time to Date/Time

All dates in January 2002 to January 1, 2002.

Date/Time to Numeric

Any date that falls between January and March to a 1 for the first quarter.

Date/Time to Text

Any date that falls in January to "January."

Example of coding date/time data Suppose you want to code a column of dates to numeric quarters (1-4). 1

Enter the following data into a column in new worksheet:

2

In the column name cell, type Dates.

11/23/2003 2/14/2003 4/29/2003 10/4/2003 8/9/2003 12/4/2003 6/25/2003 3/28/2003 7/3/2003 9/3/2003 3

Choose Data > Code > Date/Time to Numeric.

4

In Code data from columns, enter Dates.

5

In Into columns, enter Quarters.

6

In the first Original values box, enter 1/1/03 : 3/31/03 and in the first New box, enter 1. In the second row, enter 4/1/03 : 6/30/03 and 2. In the third row, enter 7/1/03 : 9/30/03 and 3. In the fourth row, enter 10/01/03 : 12/31/03 and 4. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window C1 Dates

C2 Quarters

11/23/2003

4

2/14/2003

1

4/29/2003

2

10/4/2003

4

8/9/2003

3

12/4/2003

4

6/25/2003

2

3/28/2003

1

7/3/2003

3

9/3/2003

3

Interpreting the results C1 contains the original data. C2 holds the coded data.

Example of coding numeric data Suppose you have grade averages (from 0 through 100) for students in a class, and you want to code the numeric averages to the letter grades A, B, C, D, and F. 1

Enter the following data into a column in new worksheet: 91 92 77 83 95 69 78 85 81 88

2

In the column name cell, enter Average.

3

Choose Data > Code > Numeric to Text.

4

In Code data from columns, enter Average.

5

In Into columns, enter LetterGrade.

6

In the first Original values box, enter 91:100 and in the first New box, enter A. In the second row, enter 81:90 and B. in the third row, enter 71:80 and C. In the fourth row, enter 61:70 and D. In the fifth row, enter 0:60 and F. Click OK.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

75

Manipulating and Calculating Data

This command does not produce output in the Session window. To see the results, look in the Data window.

Note

Data Window C1

C2

Average 91

LetterGrade A

92

A

77

C

83

B

95

A

69

D

78

C

85

B

81

B

88

B

Interpreting the results C1 contains the original data. C2 holds the coded data.

Use Conversion Table Use Conversion Table Data > Code > Use Conversion Table Choose Use Conversion Table to code numbers, date/time values, or text values to new values, based on a conversion table that you set up in the worksheet. Note

You can also use the other Code commands to code data. However, they cannot use a conversion table as this command can.

If you want to convert a column from one type to another, see the Change Data Type commands.

Dialog box items Input column: Select the column that contains the data you want to convert. Output data: Specify the column to store the converted data. Conversion Table: Prior to using this command to convert your data, you must set up two worksheet columns to serve as a conversion table: one listing original values and one listing the corresponding codes. When converting text data, Minitab is sensitive to both case and blank spaces. Column of Original Values: Select the column that contains the first part of the conversion table (that is, the values you want to convert). Column of Converted Values: Select the column that contains the second part of the conversion table (that is, the codes you will use to represent the original data).

To code data using a conversion table 1

In the worksheet, enter a column of original values and a second column of corresponding codes.

2

Choose Data > Code > Use Conversion Table.

3

In Input column, enter the column that contains the values you want to code.

4

In Output column, enter the storage column that will contain the new values.

5

In Column of Original Values, enter the column that contains the original values that you want to base the conversion on.

6

In Column of New Values, enter the column that contains the new values that you want to base the conversion on. Click OK.

76

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

Example of Coding Data Using a Conversion Table Example of coding data using a conversion table Suppose you want to code the state names in an address list to the corresponding state ID numbers. 1

Open the worksheet STATES.MTW. Assume you have already entered a conversion table consisting of a column of original values (StNam) and a second column of corresponding codes (StCod).

2

Insert a new column after the State column and name it StID to store the new ID numbers next to the associated State data. See Insert Columns. If you do not insert a column for your new data, Minitab will store the ID numbers after the last column in use.

3

Choose Data > Code > Use Conversion Table.

4

In Input column, enter State.

5

In Output column, enter StID. If you inserted a new column in step 2, but did not name it StID, Minitab ignores the newly inserted column and stores a new column named StID after the last column in use.

6

In Column of Original Values, enter StNam.

7

In Column of New Values, enter StCod. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window C1-T

C2

State

StID

MT

26

C3-T

C4

StNam

StCod

AL

1 2

CO

6

AK

CO

6

AZ

3

OR

37

AR

4

WA

47

CA

5

CA

5

CO

6

WA

47

CT

7

CO

6

DE

8

NV

28

FL

9

UT

44

GA

10

...

...

Interpreting the results Minitab codes the state names in the State column and stores them in the new StID column. Note

You must have a two-column conversion table before you use this command. The table has been entered in C3 and C4 in this example. If Minitab cannot find a match for a value in the conversion table, a missing value is stored. If you are getting missing values for entries that you do not think are missing, check for differences in capitalization and look for leading or trailing blanks in the data. The match must be exact for the conversion to be done.

Change Data Type Change Data Type Data > Change Data Type > Numeric to Text Data > Change Data Type > Text to Numeric Data > Change Data Type > Date/Time to Text Data > Change Data Type > Date/Time to Numeric Data > Change Data Type > Numeric to Date/Time Data > Change Data Type > Text to Date/Time Minitab provides six commands that allow you to change your data from one type to another. Why would you want to use these commands?.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

77

Manipulating and Calculating Data

Dialog box items Change numeric / text / date/time columns: Select one or more columns to change. When the cursor is in this box, the list that displays available columns displays only those columns whose type corresponds to the command you chose. Store numeric / text / date/time columns in: Enter one or more columns where you want to store the changed data. Format of text columns: (Available with the Text to Date/Time command only) Enter the format that describes the text columns as they are currently displayed in the Data window, for example, mmm-d-yy. This tells Minitab how to translate characters in the columns to the proper date/time components. Date/Time Format Components lists which date/time formats are allowable and how to specify those formats.

Numeric to Text − Options Data > Change Data Type > Numeric to Text > Options Use to specify how to format the text column created by the Numeric to Text command. By default, Minitab formats the new text column up to eight characters wide, uses six significant digits, and converts missing values (∗) to blank cells.

Dialog box items Use default width of column: Choose to use the default width of up to 8 characters for the new column. Specify fixed width of column: Choose to specify a fixed width for the new column, then enter a width in characters. For example, if you enter a 9, the new text column will be 9 characters wide. Specify maximum width of column: Choose to limit the width for the new text column, then enter a maximum width in characters. Use default number of digits: Choose to use the same number of decimal digits as in the original numeric column. Specify number of decimal digits: Choose to specify the number of decimal digits for the new column, then enter the number of decimal digits. Specify number of significant digits: Choose to specify the number of significant digits for the new column, then enter the number of significant digits. By default, Minitab uses six significant digits. Convert missing values to: If you wish, enter the value you would like to use for missing values. By default, if the numeric column you change contains missing values indicated by the missing value symbol ∗, the resulting text column will contain a blank cell.

To change one or more columns from numeric to text or date/time, from text to numeric or date/time, or from date/time to text or numeric 1

Choose Data > Change Data Type, then choose one of the following depending on which type of columns you want to change: • Numeric to Text • Text to Numeric • Date/Time to Text • Date/Time to Numeric • Numeric to Date/Time • Text to Date/Time

2

In Change columns, enter one or more columns to change. When the cursor is in this box, the variable list box displays only those columns whose type corresponds to the command you choose.

3

In Store column ins, enter one or more columns where you want to store the changed data.

4

If you are changing numeric data to text data, you can specify the appropriate options, then Click OK.

To change one or more columns from text to date/time This will work only if the date/time values in the text columns are in a default or a user-defined date/time format (see Using Date/Time Data). Minitab allows many different formats, but if your data do not follow any of these, you will need to edit the data, either in Minitab or in another application. Suppose your column of date/time data looks like the following: (Note the T, which indicates that Minitab considers this to be a text column.)

78

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

C1-T Date Nov-15-95 Nov-26-95 Dec-5-95

1

Choose Data > Change Data Type > Text to Date/Time.

2

In Change text columns, enter one or more columns to change. When the cursor is in this box, the variable list box displays only those columns whose type corresponds to the command you chose, in this case, text columns.

3

In Store date/time columns in, enter one or more columns where you want to store the changed data.

4

In Format of text columns, enter the format that describes the text column as it is currently displayed in the Data window. This tells Minitab how to translate characters in the column to the proper date/time components.

5

Click OK.

See Using Date/Time Data to determine which date/time formats are allowable and how to specify those formats. The new column you just created looks the same as the original column, but it is now identified as a date/time column (labeled with D in the Data window and Columns folder) and will be treated as such by Minitab.

When You Might Use the Change Data Type Commands Using the Numeric to Text, Text to Numeric, and Date/Time to Text Commands Minitab provides six commands that allow you to change your data from one type to another. Why would you want to use these commands? In Minitab, there are three types of columns: text, numeric, and date/time. When you enter data into a column, Minitab decides which type of column it is, depending on the data. In the Data windows and Columns folder, Minitab labels text columns with T and date/time columns with D; numeric columns are not labeled. Sometimes Minitab sets a column as text when you want it to be numeric, and vice versa. For example, if you accidentally type a letter into the first row of a column in the Data window, Minitab will identify that column as a text column. Similarly, if you type a number into the first row of a column, Minitab will identify that column as numeric. The Text to Numeric and the Numeric to Text command can correct these problems. There are a few commands that cannot use date/time columns. If you encounter this restriction, the Date/Time to Text command can help you work around it. The commands summarized below are particularly useful when there is a problem with the format of date/time data which you have imported into Minitab or you want to export from Minitab. Since Minitab recognizes and adheres to standard date/time formats, this should be a rare occurrence. When you might use Date/Time to Numeric

Minitab, like most other applications, stores dates internally as serial numbers, and times as decimal fractions. This command changes your date/time data to the representative numeric values. This can be useful if you want to compare Minitab's representation of date/time data with another application.

Numeric to Date/Time

Most software applications, including Minitab, store dates and times internally as numbers. For example, the date 1/2/95 is represented internally as the number 34701. If you import date/time data into Minitab and find that it displays in the Data window as numbers, use the Numeric to Date/Time command to change those numbers to a date/time format.

Text to Date/Time

Suppose you import a text file that contains date/time data which is not in a default format that Minitab recognizes. In this case, Minitab will identify that column as text. You can use the Text to Date/Time command to change this text column to a date/time column by specifying a user-defined format.

See Using Date/Time Data for an overview of date/time data.

Example of changing a text column to a date/time column Suppose Minitab identifies a column named Dates as text (labeled with a T after the column number), and you want to change it to a date/time column. 1

In a new worksheet, enter the following data into a column: Jan-1-04 Feb-1-04 Mar-1-04 Apr-1-04 May-1-04 June1-04.

2

In the column name cell, type Dates. Note that the column type is text (T).

3

Choose Data > Change Data Type > Text to Date/Time.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

79

Manipulating and Calculating Data 4

In Change text columns, enter Dates.

5

In Store date/time columns in, enter Dates.

6

In Format of text columns (e.g., mmm-d-yy), enter mmm-d-yy. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data window Before

After

C1-T

C1-D

Dates

Dates

Jan-104

Jan-104

Feb-104

Feb-104

Mar-104

Mar-104

Apr-104

Apr-104

May1-04

May1-04

Jun-104

Jun-104

Interpreting the results Minitab changed the data type of the Dates column from T (text) to D (date/time).

Extract from Date/Time Extract from Date/Time to Numeric/Text Data > Extract from Date/Time > To Numeric Data > Extract from Date/Time > To Text You can extract one or more parts of a date/time column, such as the year, the quarter, or the hour, and save that data in either a numeric or a text column. Choose the appropriate extract command depending on whether you want to save the extracted data in a numeric or a text column: Data > Extract from Date/Time > To Numeric saves the data in a numeric column Data > Extract from Date/Time > To Text saves the data in a text column

Dialog box items Extract from date/time column: Select the column from which you want to extract date or time information. Store numeric column in: Enter the column where you want to store the extracted data. Specify at least one component to extract from date/time: Check at least one component (such as day, quarter, or hundredth of a second) that you want to extract. Note

Formatting a date/time column, using Editor > Format Column > Date/Time, simply changes the way values display in the Data window. The values themselves are not changed. Extracting from a date/time column does change the values stored in the resulting text or numeric column.

To extract one or more parts of a date/time column, saving data in a numeric column 1

Choose Data > Extract from Date/Time > To Numeric.

2

In Extract from date/time column, enter a date/time column.

3

In Store numeric column in, enter a storage column.

4

Check the components you want to extract, then click OK.

80

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Data Menu

To extract one or more parts of a date/time column, saving data in a text column 1

Choose Data > Extract from Date/Time > To Text.

2

In Extract from date/time column, enter a date/time column.

3

In Store text column in, enter a storage column.

4

Check the components you want to extract, then click OK.

Example of Extracting from Date/Time to Text Suppose you want to extract data from a column named Date (shown below). 1

Choose Data > Extract from Date/Time > To Text.

2

In Extract from date/time column, enter Date. In Store text column in, enter QtrYr.

3

Check Quarter and Year. Under Year, choose Two Digit. Click OK.

Note

This command does not produce output in the Session window. To see the results, look in the Data window.

Data Window C1-D Date

C2-T QtrYr

1/2/2002

Q102

2/15/2002

Q102

3/6/2002

Q102

3/18/2002

Q102

5/28/2002

Q202

7/3/2002

Q302

Interpreting the results C1 contains the original data. C2 holds the new column, QtrYr.

Concatenate Concatenate Data > Concatenate Use Concatenate to combine two or more text columns side by side and store them in a new, wider column.

Data Data must be text, and columns must be of equal length.

Dialog box items Concatenate text columns: Select the columns in the order you want them combined from left to right. Store result in: Specify a storage column for the concatenated data.

To concatenate two or more text columns 1

Choose Data > Concatenate.

2

In Concatenate text columns, enter the text columns you want to combine side-by-side. Be sure to enter the columns in the order you want them to appear in the new concatenated column.

3

In Store result in, enter a column in which to store the concatenated text. Click OK.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

81

Manipulating and Calculating Data

Example of Concatenate Example of concatenating two text columns Suppose you have created a worksheet containing specific data for the students in your class. The students' names are currently arranged in two columns−last name and first name−but you want to have each student's complete name in one column. 1

Open the worksheet STUDENTS.MTW.

2

Choose Data > Concatenate.

3

In Concatenate text columns, enter First Last.

4

In Store result in, enter Student. Click OK.

Data Window C1-T

C2-T

C3-T

Last

First

Allen

Jo

Student Jo Allen

Charles

Dave

Dave Charles

Perkins

Max

Max Perkins

Richards

Bob

Bob Richards

Stephens

Mary

Mary Stephens

Interpreting the results The names from the first and second columns are combined into the Student column. The text in this new, wider column is stored according to the order you specified in the Concatenate dialog box.

Display Data Display Data Data > Display Data Displays data you select from the current worksheet in the Session window, including any combination of columns, stored constants, or matrices. Display Data is especially useful for viewing the contents of stored constants and matrices, since these variables are not displayed in the Data window. This information can also be viewed in the Constant and Matrices folders within the Project Manager.

Dialog box items Columns, constants, and matrices to display: Select the variables you want Minitab to print in the Session window. Note

The session command PRINT is a useful way to display output in the Session window. Using the subcommand FORMAT, you can override the default format for display.

To display worksheet data in the Session window 1

Choose Data > Display Data.

2

In Columns, constants, and matrices to display, enter the items you want to print in the Session window.

3

Click OK.

Note

82

The session command PRINT is a useful way to display output in the Session window. Using the subcommand FORMAT, you can override the default format for display. See Session Command Help for details.

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Index

Index A

Chi-Square (Calc menu) ....................................... 25

Absolute value .............................................................. 6

Code ........................................................................... 74

Calculator functions ................................................. 6

Date/Time to Date/Time (Data menu) ................... 74

Algebraic expressions................................................... 5

Date/Time to Numeric (Data menu) ...................... 74

Calculator (Calc menu)............................................ 5

Date/Time to Text (Data menu)............................. 74

Antilog ........................................................................... 6

Numeric to Date/Time (Data menu) ...................... 74

Calculator functions ................................................. 6

Numeric to Numeric (Data menu) ......................... 74

Arbitrary Set of Numbers (Calc menu)........................ 15

Numeric to Text (Data menu)................................ 74

Arccosine ...................................................................... 6

Text to Date/Time (Data menu)............................. 74

Calculator functions ................................................. 6

Text to Numeric (Data menu)................................ 74

Arcsine .......................................................................... 6

Text to Text (Data menu) ...................................... 74

Calculator functions ................................................. 6

Use Conversion Table (Data menu) ..................... 76

Arctangent..................................................................... 6

Column Statistics (Calc menu) ................................... 11

Calculator functions ................................................. 6

Columns ..................................................................... 77

Arithmetic .................................................................... 22

Changing data type ............................................... 77

Calculator ................................................................ 5

Concatenating ....................................................... 81

Matrix..................................................................... 22

Copying ................................................................. 56

Operations ............................................................... 7

Sorting................................................................... 69

B

Stacking ................................................................ 63

Bernoulli (Random Data) ............................................ 24

Transposing .......................................................... 68

Bernoulli (Calc menu) ............................................ 24

Unstacking ............................................................ 60

Beta (Probability Distributions).................................... 32

Comparison operations ................................................ 6

Beta (Calc menu)................................................... 32

Concatenate ............................................................... 81

Beta (Random Data) ................................................... 24

Concatenate (Data menu)..................................... 81

Beta (Calc menu)................................................... 24

Constant Matrix (Calc menu)...................................... 21

Binomial (Probability Distributions) ............................. 32

Constants ................................................................... 57

Binomial (Calc menu) ............................................ 32

Copying ................................................................. 57

Binomial (Random Data)............................................. 24

Setting using calculator ......................................... 11

Binomial (Calc menu) ............................................ 24

Conversion table......................................................... 76

C

Copy ........................................................................... 56

Calc menu..................................................................... 5

Column to Constants (Data menu) ....................... 57

Calculating .................................................................. 31

Columns to Columns (Data menu)........................ 56

Probabilities for different distributions ................... 31

Columns to Matrix (Data menu) ............................ 57

p-value for a hypothesis test.................................. 31

Constants to Column (Data menu) ....................... 57

Calculator...................................................................... 5

Constants to Constants (Data menu).................... 57

Calculator (Calc menu)............................................ 5

Matrices to Matrices (Data menu) ......................... 58

Cauchy (Probability Distributions)............................... 33

Matrix to Columns (Data menu) ............................ 57

Cauchy (Calc menu).............................................. 33

Worksheet to Workseet (Data menu).................... 58

Cauchy (Random Data) .............................................. 24

Cosine .......................................................................... 6

Cauchy (Calc menu).............................................. 24

Calculator functions................................................. 6

Ceiling ........................................................................... 6

Current time.................................................................. 6

Calculator functions ................................................. 6

Calculator functions................................................. 6

Change Data Type...................................................... 77

D

Change Data Type (Data menu) ........................... 77

Data ............................................................................ 17

Chi-Square (Probability Distributions)......................... 33

Display .................................................................. 82

Chi-Square (Calc menu)........................................ 33

Make mesh............................................................ 17

Chi-Square (Random Data) ........................................ 25

Make patterned ..................................................... 14

Copyright © 2003–2005 Minitab Inc. All rights reserved.

83

Manipulating and Calculating Data Date/Time data ............................................................. 9

Floor ............................................................................. 6

With the calculator ................................................... 9

Calculator functions................................................. 6

Date/Time to Date/Time.............................................. 74

Functions ...................................................................... 6

Code (Data menu) ................................................. 74

Calculator ................................................................ 6

Date/Time to Numeric ................................................. 77 Change Data Type (Data menu) ........................... 77

G Gamma......................................................................... 6

Code (Data menu) ................................................. 74

Calculator functions................................................. 6

Extract from Date/Time (Data menu) .................... 80

Gamma (Probability Distributions).............................. 35

Date/Time to Text ....................................................... 77

Gamma (Calc menu)............................................. 35

Change Data Type (Data menu) ........................... 77

Gamma (Random Data) ............................................. 26

Code (Data menu) ................................................. 74

Gamma (Calc menu)............................................. 26

Extract from Date/Time (Data menu) .................... 80

Generating Patterned Data ........................................ 16

Date/Time Values (Calc menu)................................... 17

H

Define Constant Matrix (Calc menu)........................... 21

Hypergeometric (Probability Distributions) ................. 35

Degrees ........................................................................ 6

Hypergeometric (Calc menu) ................................ 35

Calculator functions ................................................. 6

Hypergeometric (Random Data)................................. 26 Hypergeometric (Calc menu) ................................ 26

Delete Rows................................................................ 72 Delete Rows (Data menu) ..................................... 72 Diagonal Matrix (Calc menu) ...................................... 21

I Incomplete gamma ....................................................... 6

Discrete (Probability Distributions).............................. 34

Calculator functions................................................. 6

Discrete (Calc menu)............................................. 34

Indicator variables ...................................................... 19

Discrete (Random Data) ............................................. 25

Making for an analysis .......................................... 19

Discrete (Calc menu)............................................. 25

Integer (Probability Distributions) ............................... 36

Display Data................................................................ 82

Integer (Calc menu) .............................................. 36

Display Data (Data menu) ..................................... 82

Integer (Random Data)............................................... 26

Distributions ................................................................ 30

Integer (Calc menu) .............................................. 26

Probability.............................................................. 30

Invert Matrix (Calc menu) ........................................... 21

Random ................................................................. 22

L

Double exponential distribution................................... 26

Lag................................................................................ 6 Calculator functions................................................. 6

E e 6

Laplace (Probability Distributions) .............................. 36

Calculator functions ................................................. 6

Laplace (Calc menu) ............................................. 36

Eigen Analysis (Calc menu)........................................ 21

Laplace (Random Data) ............................................. 26

Erase Variables........................................................... 73

Laplace (Calc menu) ............................................. 26

Erase Variables (Data menu) ................................ 73

Largest Extreme Value (Probability Distributions) ...... 37

Exponential (Probability Distributions) ........................ 34

Largest Extreme Value (Calc menu) ..................... 37

Exponential (Calc menu) ....................................... 34

Largest Extreme Value (Random Data) ..................... 27

Exponential (Random Data)........................................ 25

Largest Extreme Value (Calc menu) ..................... 27

Exponential (Calc menu) ....................................... 25

Log 10........................................................................... 6

Exponentiate ................................................................. 6

Calculator functions................................................. 6

Calculator functions ................................................. 6

Log gamma................................................................... 6

Extract from Date/Time ............................................... 80

Calculator functions................................................. 6

To Numeric (Data menu) ....................................... 80

Logical operations ........................................................ 7

To Text (Data menu) ............................................. 80

Logistic (Probability Distributions) .............................. 37

F Distribution (Probability Distributions)...................... 35

Logistic (Random Data).............................................. 27

Logistic (Calc menu) ............................................. 37

F F (Calc menu)........................................................ 35

Logistic (Calc menu) ............................................. 27

F Distribution (Random Data) ..................................... 25

Loglogistic (Probability Distributions) ......................... 37

F (Calc menu)........................................................ 25

Loglogistic (Calc menu)......................................... 37

84

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Index Loglogistic (Random Data) ......................................... 27

Row statistics ........................................................ 12

Loglogistic (Calc menu) ......................................... 27

N nonmissing.............................................................. 11

Lognormal (Probability Distributions) .......................... 38

Calculator functions................................................. 6

Lognormal (Calc menu) ......................................... 38

Column statistics ................................................... 11

Lognormal (Random Data) ......................................... 27

Row statistics ........................................................ 12

Lognormal (Calc menu) ......................................... 27

N total ........................................................................... 6

M

Calculator functions................................................. 6

Make Indicator Variables (Calc menu)........................ 19

Column statistics ................................................... 11

Make mesh data ......................................................... 17

Row statistics ........................................................ 12

Make Mesh Data (Calc menu)............................... 17

Natural log .................................................................... 6

Make Patterned Data (Calc menu) ............................. 14

Calculator functions................................................. 6

Matrices (Calc menu).................................................. 20

Normal (Probability Distributions) ............................... 38

Arithmetic............................................................... 22

Normal (Calc menu) .............................................. 38

Copying ................................................................. 57

Normal (Random Data) .............................................. 28

Defining constant................................................... 21

Normal (Calc menu) .............................................. 28

Diagonal matrix...................................................... 21

Normal scores .............................................................. 5

Eigen Analysis ....................................................... 21

Calculator functions................................................. 6

Inverting................................................................. 21

Now .............................................................................. 6

Reading ................................................................. 20

Calculator functions................................................. 6

Transposing........................................................... 21

Numeric to Date/Time................................................. 77

Maximum .................................................................... 11

Change Data Type (Data menu) ........................... 77

Calculator functions ................................................. 6

Code (Data menu)................................................. 74

Column statistics ................................................... 11

Numeric to Numeric.................................................... 74

Row statistics......................................................... 12

Code (Data menu)................................................. 74

Mean ............................................................................. 6

Numeric to Text .......................................................... 77

Calculator functions ................................................. 6

Change Data Type (Data menu) ........................... 77 Code (Data menu)................................................. 74

Column statistics ................................................... 11 Row statistics......................................................... 12 Median ........................................................................ 11

P Partial products............................................................. 6

Calculator functions ................................................. 6

Calculator functions................................................. 6

Column statistics ................................................... 11

Partial sums.................................................................. 6

Row statistics......................................................... 12

Calculator functions................................................. 6

Merge Worksheets...................................................... 50

Patterned data ............................................................ 15

Merge Worksheets (Data menu) ........................... 50

Pi 6

Mesh data ................................................................... 17

Calculator functions................................................. 6

Minimum ....................................................................... 6

Poisson (Probability Distributions).............................. 39

Calculator functions ................................................. 6

Poisson (Calc menu)............................................. 39

Column statistics ................................................... 11

Poisson (Random Data) ............................................. 28

Row statistics......................................................... 12 Missing values .............................................................. 6

Poisson (Calc menu)............................................. 28 Probability Distributions (Calc menu)

Calculator functions ................................................. 6

Beta....................................................................... 32

MOD.............................................................................. 6

Binomial ................................................................ 32

Calculator functions ................................................. 6

Cauchy .................................................................. 33

Multivariate Normal (Random Data) ........................... 27

Chi-Square ............................................................ 33

Multivariate Normal (Calc Menu) ........................... 27

Discrete ................................................................. 34 Exponential ........................................................... 34

N N missing .................................................................... 12

F 35

Calculator functions ................................................. 6

Gamma ................................................................. 35

Column statistics ................................................... 11

Hypergeometric..................................................... 35

Copyright © 2003–2005 Minitab Inc. All rights reserved.

85

Manipulating and Calculating Data Integer ................................................................... 36

Recoding data ............................................................ 76

Laplace .................................................................. 36

Round ........................................................................... 6

Largest Extreme Value .......................................... 37

Calculator functions................................................. 6

Logistic .................................................................. 37

Row Statistics (Calc menu) ........................................ 12

Loglogistic.............................................................. 37

Rows........................................................................... 66

Lognormal.............................................................. 38

Deleting ................................................................. 72 Stacking ................................................................ 66

Normal ................................................................... 38 Poisson.................................................................. 39

S

Smallest Extreme Value ........................................ 39

Sample From Columns (Random Data) ..................... 23

t

Sample From Columns (Calc menu)..................... 23

39

Triangular .............................................................. 40

Set Base (Calc menu) .......................................... 22, 30

Uniform .................................................................. 40

Simple Set of Date/Time Values (Calc menu) ............ 15

Weibull................................................................... 41

Simple Set of Numbers (Calc menu) .......................... 16 Sine .............................................................................. 6

R Radians......................................................................... 6

Calculator functions................................................. 6

Calculator functions ................................................. 6

Smallest Extreme Value (Probability Distributions) .... 39 Smallest Extreme Value (Calc menu) ................... 39

Random Data (Calc menu) Bernoulli................................................................. 24

Smallest Extreme Value (Random Data) ................... 28

Beta ....................................................................... 24

Smallest Extreme Value (Calc menu) ................... 28

Binomial................................................................. 24

Sort ............................................................................. 69

Cauchy .................................................................. 24

Sort (Data menu)................................................... 69

Chi-Square ............................................................ 25

Split Worksheet .......................................................... 50

Discrete ................................................................. 25

Split Worksheet (Data menu) ................................ 50

Exponential............................................................ 25

Square root................................................................... 6 Calculator functions................................................. 6

F 25 Gamma.................................................................. 26

Stack........................................................................... 65

Hypergeometric ..................................................... 26

Blocks of Columns (Data menu) ........................... 65

Integer ................................................................... 26

Columns (Data menu) ........................................... 63

Laplace .................................................................. 26

Rows (Data menu) ................................................ 66

Largest Extreme Value .......................................... 27

Standard deviation...................................................... 11

Logistic .................................................................. 27

Calculator functions................................................. 6

Loglogistic.............................................................. 27

Column statistics ................................................... 11

Lognormal.............................................................. 27

Row statistics ........................................................ 12

Multivariate Normal................................................ 27

Standard score ........................................................... 13

Normal ................................................................... 28

Standardize ................................................................ 14

Poisson.................................................................. 28

Standardize (Calc menu) ...................................... 13

Sample from columns............................................ 23

Students t ................................................................... 28

Smallest Extreme Value ........................................ 28

Subset Worksheet ...................................................... 46

t

Subset Worksheet (Data menu)............................ 46

28

Triangular .............................................................. 28

Sum .............................................................................. 6

Uniform .................................................................. 29

Calculator functions................................................. 6

Weibull................................................................... 29

Column statistics ................................................... 11

Range ......................................................................... 12

Row statistics ........................................................ 12

Calculator functions ................................................. 6

Sum of squares .......................................................... 11

Column statistics ................................................... 11

Calculator functions................................................. 6

Row statistics......................................................... 12

Column statistics ................................................... 11 Row statistics ........................................................ 12

Rank............................................................................ 71 Rank (Data menu) ................................................. 71

T

Read Matrix (Calc menu) ............................................ 20

t Distribution (Probability Distributions) ...................... 39

86

Copyright © 2003–2005 Minitab Inc. All rights reserved.

Index Triangular (Calc menu) ......................................... 28

t (Calc menu) ......................................................... 39 t Distribution (Random Data) ...................................... 28

U

t (Calc menu) ......................................................... 28

Uniform (Probability Distributions) .............................. 40

Tangent......................................................................... 6

Uniform (Calc menu) ............................................. 40

Calculator functions ................................................. 6

Uniform (Random Data) ............................................. 29

Text to Date/Time ....................................................... 77

Uniform (Calc menu) ............................................. 29

Change Data Type (Data menu) ........................... 77

Unstack Columns ....................................................... 60

Code (Data menu) ................................................. 74

Unstack Columns (Data menu) ............................. 60

Text to Numeric........................................................... 77

Use Conversion Table ................................................ 76 Use Conversion Table (Data menu) ..................... 76

Change Data Type (Data menu) ........................... 77 Code (Data menu) ................................................. 74

V

Text to Text ................................................................. 74

Variables..................................................................... 19

Code (Data menu) ................................................. 74

Erasing .................................................................. 73

Text Values (Calc menu) ............................................ 15

Indicator for an analysis ........................................ 19

Time .............................................................................. 6 Calculator function................................................... 6

W Weibull (Probability Distributions)............................... 41

Today ............................................................................ 6

Weibull (Calc menu).............................................. 41

Calculator functions ................................................. 6

Weibull (Random Data) .............................................. 29

Transform count............................................................ 6

Weibull (Calc menu).............................................. 29

Calculator functions ................................................. 6

When ............................................................................ 6

Transform proportion .................................................... 6

Calculator functions................................................. 6

Calculator functions ................................................. 6

Worksheets................................................................. 46

Transpose Columns.................................................... 68

Copying ................................................................. 58

Transpose Columns (Data menu) ......................... 68

Merging ................................................................. 50

Transpose Matrix (Calc menu).................................... 21

Splitting ................................................................. 50 Subsetting ............................................................. 46

Triangular (Probability Distributions)........................... 40 Triangular (Calc menu).......................................... 40

Z

Triangular (Random Data) .......................................... 28

z score ........................................................................ 13

Copyright © 2003–2005 Minitab Inc. All rights reserved.

87