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

  • Minitab Cookbook
  • Isaac Newton
  • 475字
  • 2021-07-16 12:29:18

Stacking blocks of columns at the same time

With some datasets, we may want to keep several columns together while running a stack command rather than running several individual stack commands to stack blocks of columns.

In the previous recipe, the data for senators was stacked, but we didn't keep the information about the states in the new worksheet. Stacking blocks of columns can keep the information about the states with the stacking command.

Getting ready

We will use the senators data from the previous recipe. This can be found from the following location:

http://mathforum.org/workshops/sum96/data.collections/datalibrary/data.set6.html

The Getting ready section of the Stacking blocks of columns at the same time recipe has details on how to import the data.

How to do it…

The following instructions will stack the party membership details and retain information about the state at the same time:

  1. Navigate to Data | Stack and then click on Blocks of Columns.
  2. In the first field, enter Democrats and select the State columns.
  3. In the second field, enter Republicans and select the State columns
  4. In the third field, enter Independents and select the State columns
  5. In the Store stacked data in section, name the new worksheet Stacked Data and click on OK.
    How to do it…
  6. As with the stack command, the columns created in the new worksheet are not named. We will need to rename these columns, go to the section above the data in column one and name it Party, column two as Senators, and column three as State.

How it works…

The stack blocks of columns commands will stack columns vertically by order in each row. The number of senators for Democrats will be placed in the second column at the top, those for Republicans will placed below it, and finally, the Independent senators will appear. The State column is placed in each row to ensure that the stacked data has the correct state next to each count of senators in the second column.

The optional selection of Use variable names in subscript column uses the name of the first column in each row to identify where the data has come from in the new worksheet and places this in the first column. Hence, in the stacked worksheet, column 1 lists Democrats, then Republicans, and finally, Independents.

How it works…

The preceding screenshot shows the worksheet generated up to step 5 in the instructions. The column names are stored in the subscript column, C1. If we do not want the name of the parties to appear in column 1, then unselecting this option will create the subscript column with numbers instead.

As the stack commands do not name the columns, we should use step 6 to ensure that we can identify each column when we use these later in dialogs.

See also

  • The Stacking several columns together recipe
  • The Transposing the columns of a worksheet recipe
主站蜘蛛池模板: 莒南县| 崇文区| 浦江县| 蚌埠市| 京山县| 杂多县| 加查县| 桑日县| 都匀市| 星子县| 景东| 双牌县| 余姚市| 建水县| 永丰县| 绥滨县| 龙门县| 社旗县| 波密县| 九江县| 岑溪市| 紫阳县| 乐东| 泽普县| 南皮县| 宜春市| 怀化市| 泸溪县| 班玛县| 伊金霍洛旗| 八宿县| 刚察县| 海晏县| 沐川县| 怀化市| 建阳市| 绍兴县| 榆社县| 甘孜县| 永善县| 临夏县|