PC 2010 Tutorial.pdf

advertisement
Tutorial: Homework Assignments
Purposes:
• Use Excel
• Load and embed SPC Macro into Excel
• Create Histograms from Data Sets
• Create Control Charts for Various Data Types
• Create Histograms and Control Charts on your
“Own” QI Project Data
Excel 2010
1
Homework Files
Test Dataset Contents:
File 1 = Number of pneumonia patients per week
File 2 = Number of non-deaths between deaths
File 3 = Red bead game (# red beads out of 100) - 500 draws
File 4 = Length of stay by delivery type (vaginal or C-section)
File 5 = Breast cancer screening
Excel 2010
2
Data Types
Attribute (Categorical) Data:
• Nominal: “named” categories (ex. male/female)
• Binary: exactly two categories
• Ordinal: ordered, named categories (ex. low/medium/high)
Numeric Data:
• Interval: numbers without fixed zero scale. These can’t form meaningful ratios
(ex. temperature)
• Ratio: numbers that can form meaningful ratios (ex. blood pressure)
• Continuous: can take on any numeric value (e.g. cost, weight)
• Discrete: meaningful only at discrete values (e.g. # of children)
Excel 2010
3
Choosing an SPC Chart
(Decision Tree)
Data Type
Attribute
Numeric
Discrete
Subgroup p
Size n
n Constant
or Varies
Control
Chart
p Chart
np < 15
c Chart
(# of per)
Constant
Subgroup
(# of per) (# of between)
Variable
Rare
Subgroup
Event
c Chart u Chart
g Chart
Continuous
n >1
x, s
n=1
n=1
Normal Don’t Recognize
Distribution Distribution
x
XmR
Additional information can be found in Measuring Quality Improvement in Health Care (Carey & Lloyd, pg. 72)
Excel 2010
4
Access Macro and Data Sets
The datasets are found on the
session cd in a folder labeled:
“Excel Homework Files”
It is easiest to copy these files to your
own computer*. To do this:
• Select all the files (Drag to
highlight, hold down Ctrl)
• Right click and select “Copy”
• Paste the files in a new folder, or on
your desktop (right click, “Paste”)
* If you do not copy the files, you may still view them from the
cd, but if any changes are made and you wish to save them, you
will have to do so in a folder on your own computer.
Excel 2010
5
Load Macro into Excel
1
1. Open Excel (spreadsheet
should be blank) and click “File”
tab
2
2. Select “Open” and find the
folder where the macro is saved
3. Select “All Files” from the
drop-down menu to the
right of “File Name”
4. Select
“SPC Macros AddIn
rev.1.12.4.xlam”
4
5. Select “Open”
* If prompted with a
security notice be sure to
select “Enable Macros”
3
5
Excel 2010
6
Open Data Sets
1. To open the homework data sets
(spreadsheets), click the “File” tab
2. Select “Open”
1
3. Find where you have saved the data sets
and Select File 1 – pneumonia patients per week.xlsx
4. Press the “Open” button
3
2
4
Excel 2010
2007
7
Create Distribution with SPC Macro
In file1- pneumonia patients per week.xlsx, select the data in column B (tip: if you select
the first cell in the column and then press ctrl + shift + down arrow keys together, Excel will
select all data in the column until it arrives at a blank cell)
1
1. Select “Add-Ins” tab
(If you don’t see the macro,
you will need to re-load it)
2. Select “SPC Macros”
drop down
2
3
4
5
3. Select “Identify
Distribution”
4. “Check” that the
first row contains
labels
5. Select “Recalc” to
generate the distribution
Excel 2010
8
Distribution and Residuals
•The SPC Macro
creates a new tab
with output that
looks similar to this:
•The data is saved
upon pressing "OK".
"Cancel" erases the
new tab.
Excel 2010
9
Create Table for Control Chart
1.
2.
3.
4.
• Select and open Homework file #1. If necessary, re‐load SPC Macro .
• Determine the distribution that matches your dataset
Highlight the # pneumonia pts per week (column B) in the dataset.
Go to “Add-Ins”
Find desired control chart option under “SPC Macros”
Select appropriate chart (file1= C-chart because: # of per, ratio discrete, variable subgroup)
2
3
4
1
Excel 2010
10
Complete Fields to Generate Table
Complete the fields in the c- chart box in the Input Data and
Significance Level sections of the macro.
1. Make sure highlighted range corresponds to data
highlighted on spreadsheet
2. Only check “Check if the first row contains labels” if
you have included the label in the highlighted material
3. Enter the significance level, α, as desired(.01 or .05)
4. Select "OK" to generate the table
1
2
3
4
Excel 2010
The macro
will
populate a
new sheet
that looks
like this
11
Create Control Chart
1. Select variables to be graphed on control chart:
•
•
•
•
c = count
c-bar = average count
LCL = lower confidence limit
UCL = upper confidence limit
Tip: Select cell B6 and while holding left
mouse key, move cursor to E6 and release left
mouse key. Use tip from previous slides (shift
+ ctrl + down arrow key) to select and move to
the bottom of the data range.
After highlighting the data:
2. Select the “Insert” tab
3. In the “Charts” section,
select “Line”
4. Select “Line with Markers”
to create the chart
Excel 2010
2
3
4
1
12
Edit Control Chart Format
3. Select the “Marker Options” tab, and
choose the “None” radio button
4. Press the “Close” button to update
the graph
1. To remove the markers from “c-bar”,
right click on the center line
2. Select “Format Data Series”
3
1
2
4
Excel 2010
13
Edit Control Chart Format (cont’d)
• A dotted red line without markers is a
convention that is widely used for the LCL
and UCL.
3
4
1. To change the line, color, type, and markers first
right click on the UCL line
2. Select “Format Data Series”
3. To remove markers, select the “Marker
Options” tab
4. Choose the “None” radio button
1
2
Excel 2010
14
Edit Control Chart Format (cont’d)
5.
6.
7.
8.
Now, select the “Line Color” tab
Choose the “Solid line” radio button
Press the “Color:” button, and choose red
Select the “Line Style” tab
9. Press the “Dash type:” button, and choose
the round dots
10. Press the “Close” button and the line on
your graph will be updated
6
5
8
9
7
10
Excel 2010
**Follow the steps on slides 14 and 15 to change the LCL to a dotted red line**
15
Label and Finish Chart
To add titles to the
chart and to the axes:
• Click anywhere on
the chart
• Under chart tools,
select “Layout”
• In the labels section,
select “Chart Title”
• Select “Above Chart”
and type title onto
chart
• To the right of
“Chart Title”, select
“Axis Title
• Choose vertical or
horizontal title and
type title onto chart
*Files 2, 3, 4, and 5 require additional/altered steps based on chart type*
*For more detailed information on axis customization (with examples), refer to slide 34*
Excel 2010
16
Additional Steps for file2 – nondeaths
between deaths.xlsx
**File2 is similar to File1,
but a g-chart is used.
1. Highlight “Nondeaths
Between Deaths” data in
column B.
2. Go to “Add-Ins”.
3. Select “g Chart” from
“SPC Macros” drop-down.
4. Enter a significance
level (0.01) and click “OK”.
2
3
1
4
Excel 2010
17
Additional Steps for file2 – nondeaths between
deaths.xlsx
** Follow pages 12-16 to create and edit control chart**
Excel 2010
18
Additional Steps for file3 – Red Bead Game.xlsx
1. Select the data in column B
(ctrl+shift+down arrow key)
2. Then select the appropriate
control chart option (p-chart)
3. After clicking in the field
“Select the sample size range:”
select the data in column C
(highlight the first cell in the
data column then press
ctrl+shift+down arrow key to
highlight the data clear to the
bottom. You may also type in
the data range
4. Fill in the significance level.
5. Select “OK” to create the
table
Excel 2010
2
3
1
4
5
19
Creating Control Chart for file3 –Red Bead Game.xlsx
Before Formatting
• To create Control Chart, follow
steps on slide 12.
• To format Control Chart, follow
steps on slides 13-16.
After Formatting
Excel 2010
20
Final P-Chart for file3 – Red Bead Game.xlsx
Now charts can be generated for files 1-3.
Refer to slides 22-26 for file4 and slides 2734 for file5.
Excel 2010
21
Sort and Separate file4 – length of stay
by delivery type.xlsx
•
Open “file4 – length of stay by delivery type.xlsx”. The file contains data on two types of
procedures (C-Section and Vaginal) that are identified in column “Type”. We will organize
the data according to delivery type and then separate them into 2 different data sets.
1. Make sure the “Home” tab is selected
and select the data in columns A thru F
2. Select “Sort & Filter” under “Home”
tab
3.
4.
5.
6.
Select “Custom Sort”
“Check” that My data has headers
Next to “Sort by” select “Type”
Click “OK”
2
1
3
4
5
6
22
Sort and Separate cont.
file4 – length of stay by delivery type.xlsx
•Once you have sorted by delivery type, cut and paste separate data into two
separate columns, one for each delivery type
•Find where type changes from “C-Section” to “Vaginal”
•Highlight the second group (col A-F) for “Vaginal” type
• Create a distribution on each type using the LOS_HRS Column (Slides 8-9)
Excel 2010
23
Sort and Separate cont. file4 – length of stay by
delivery type.xlsx
1. Highlight “LOS_HRS”
(this is the data value) in
column D
2
2. Go to “Add-Ins”
3. Select “X-bar S Chart”
from “SPC Macros” dropdown
4. Click inside the
“groupings range” box
and highlight
“DSCHRG_MNTH” (this
is the grouping variable)
in column C
3
4
1
5. Enter a significance level (0.01) and click “OK” to
generate X-bar S Chart
Excel 2010
5
24
Sort and Separate cont. file4 – length of
stay by delivery type.xlsx
The “x-bar s chart” for both delivery types should look like the following:
C-Section
**After creating
the X-bar S charts,
use data from
columns D-G to
create the control
chart (slides 1216).**
Excel 2010
Vaginal
25
Sort and Separate cont. file4 – length of
stay by delivery type.xlsx
Create Control Charts for the X-bar S Charts (refer to slides 12-16).
Your charts should look like the ones below:
C-Section Chart
Excel 2010
Vaginal Chart
26
Additional Steps for file5 – Breast Cancer Screening.xlsx
For this file we are going to treat it as if an intervention occurred
that began on Jan 1, 2014.
We will first create a Pivot
Table:
1. Highlight all data
2. Select the “Insert” Tab
3. Click the “Pivot table”
button on the far left of the
ribbon.
4. Select “Pivot Table”
from the drop-down
5. Make sure “Select a
table or range” is selected
(should be default setting)
6. Make sure “New
Worksheet” is selected
(should be default setting)
7. Select “OK” to bring up
the pivot table
2
3
4
1
5
6
7
Excel 2010
27
Additional Steps for file5 – Breast Cancer Screening.xlsx
To populate the Pivot Table:
1. On the right hand side, in “Pivot
Table Field List”, check all boxes
under “Choose fields to add to
report”
2. Left-click and drag “Year” and
“Month” into the “Row Labels” box
below
3. Drag “Screening Done” into the
“Column Labels” box
4. Drag “ID” into the “Values” box
1
4
Excel 2010
2 3
 The new worksheet will initially look like this image.
28
Additional Steps for file5 – Breast Cancer Screening.xlsx
1. On the “PivotTable Field List” menu, click on the
arrow next to “Sum of ID”
2. Select “Value Field Settings”
3. Select “Count” from the “Summarize value
field by” scroll box
4. Select “OK”
After
3
2
4
1
Excel 2010
29
Additional Steps for file5 – Breast Cancer Screening.xlsx
2
1. Now highlight the values that
correspond with 2013
(pre‐Intervention) and 1 for
screening done. This will be
column C cells 6-17
2. Go to the Add‐Ins tab
3. Click “SPC Macros”
4. Select p‐chart
5. The highlighted material will
appear in the first box in the “p
Chart” pop-up window
6. Click into the 2nd box and
highlight column D ‘Grand Total’
cells 6‐17 for the sample size
7. Skip to the bottom where
you will enter a significance level
(.01)
8. Select "OK" at the bottom of
the p Chart window and a new
P‐Chart Table will appear under
the tab titled “p Chart Table 1”
Excel 2010
3
4
5
6
1
7
8
30
Additional Steps for file5 – Breast Cancer Screening.xlsx
2
**Return to the worksheet
with the pivot table**
Repeat the steps from the
previous slide (slide 30) for
creating a p‐chart, but using
only 2014 data
(Post‐Intervention), this will be
rows 19 ‐ 24.
3
4
5
6
Use the same significance
level that you used from the
2013 data (.01).
This will create another,
smaller P Chart Table under
the “p Chart Table 2” tab.
7
1
Excel 2010
8
31
Additional Steps for file5 – Breast Cancer Screening.xlsx
1. Highlight the data from the
2014 P Chart Table (excluding
headers).
2. Right-click highlighted data
and copy.
3. Go to 2013 P Chart Table,
under “p Chart Table 1” tab.
4. Paste the 2014 data under
the 2013 data.
5. Change group numbers to
actual month and year values.
(ex. Jan-13, Apr-14, etc.)
** If you are having trouble
with excels autocorrect feature,
highlight all “Group #” cells,
right-click and select “Format
Cells”. Under the “Number” tab,
in the “Category” menu, select
“Text” and press ok. This will
allow you to enter text, without
autocorrect, on the highlighted
cells.
2
1
5
4
32
Excel 2010
3
Additional Steps for file5 – Breast Cancer Screening.xlsx
Finally, create an SPC chart as you did
in previous steps (slides 12-16 ).
To include group numbers on the
horizontal axis:
•
•
•
Cut and Paste the “np-hat” and
“n” values (columns B & C) out of
the space in between “Group #”
and “p-hat”. Move these to a
Cut and Paste the rest of the
values (columns D-G) next to
“Group #”
Highlight “Group #” through “UCL”
(now columns A-E) and use these
values to create your control chart
Once you have completed the control chart,
You will see the change from Pre to
Post Intervention highlighted with
different averages and control limits.
Excel 2010
33
Additional Steps for file5 – Breast Cancer Screening.xlsx
Before
*Hint: To change how you
view the values on the axis:
•
•
•
Right-click the axis of
interest and select
“Format Axis”.
Customize in “Axis
Options” Section.
To change decimal places
viewed, go to “Number”
(under “Axis Options”
tab).
Excel 2010
After
34
Embed Macro into Excel (optional)
1
If you wish to use the macro
again at a later time, you will
have to repeat the steps on
slide 6 each time Excel is
opened. If you would like to
embed the macro in Excel so
it loads automatically each
time Excel is opened, follow
the steps on slides 35-37
2
1. Click the “File” tab
2. Select “Options”
Excel 2010
35
Embed Macro into Excel (cont’d)
3. Select the “Add-Ins” tab
4. Press the “Go” button at the
bottom of the Add-Ins screen
3
4
Excel 2010
36
Embed Macro into Excel (cont’d)
6. Locate where you have saved the macro,
select it, and press "OK"
7. Make sure the SPC Macros AddIn rev.
1.12.4.xlam box is checked, and press “OK”
5. Press the “Browse” button
5
7
6
Excel 2010
37
Create Histograms, Control Charts and Distribution
Using Your “Own” QI Project Data
1. Determine what data element(s) you will need in order to
show any changes to the process you are focusing on
2. Create a dataset or work with someone at your
organization that can help you access data for your QI
project
3. Create histograms from data sets
4. Write brief statement on graph about data “findings”
Excel 2010
3
8
Download