Tutorial: Homework Assignments Purposes: Use Excel Load and embed SPC Macro into Excel Create Histograms from Data Sets Create Control Charts for Various

Embed Size (px)

DESCRIPTION

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) 3 Excel 2010

Citation preview

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 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) draws File 4 = Length of stay by delivery type (vaginal or C-section) File 5 = Breast cancer screening Homework Files 2 Excel 2010 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 cant 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) 3 Excel 2010 Choosing an SPC Chart (Decision Tree) Data TypeData Type AttributeNumeric Discrete (# of per) (# of between) Continuous (# of per) Constant Subgroup Variable Subgroup Rare Event n >1 n=1 Normal Dont Recognize Distribution Distribution n Constant or Varies np < 15 Subgroup p Size n c Chartu Chartg Chartx, sx, s x XmRc Chartp Chart Control Chart Additional information can be found in Measuring Quality Improvement in Health Care (Carey & Lloyd, pg. 72) 4 Excel 2010 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. 5 Excel 2010 Load Macro into Excel 1. Open Excel (spreadsheet should be blank) and click File tab 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 xlam 5. Select Open * If prompted with a security notice be sure to select Enable Macros Excel 2010 Open Data Sets 1. To open the homework data sets (spreadsheets), click the File tab 2. Select Open 3. Find where you have saved the data sets and Select File 1 pneumonia patients per week.xlsx 4. Press the Open button Excel Excel 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. Select Add-Ins tab (If you dont see the macro, you will need to re-load it) 2. Select SPC Macros drop down 3. Select Identify Distribution 4. Check that the first row contains labels 5. Select Recalc to generate the distribution Excel 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 Create Table for Control Chart Select and open Homework file #1. If necessary, reload SPC Macro. Determine the distribution that matches your dataset 1. Highlight the # pneumonia pts per week (column B) in the dataset. 2. Go to Add-Ins 3. Find desired control chart option under SPC Macros 4. Select appropriate chart (file1= C-chart because: # of per, ratio discrete, variable subgroup) 10Excel 2010 1 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 The macro will populate a new sheet that looks like this 11 Excel 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 12 1 Excel 2010 Edit Control Chart Format 1. To remove the markers from c-bar, right click on the center line 2. Select Format Data Series 3. Select the Marker Options tab, and choose the None radio button 4. Press the Close button to update the graph Excel 2010 Edit Control Chart Format (contd) A dotted red line without markers is a convention that is widely used for the LCL and UCL. 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 Excel 2010 Edit Control Chart Format (contd) 5. Now, select the Line Color tab 6. Choose the Solid line radio button 7. Press the Color: button, and choose red 8. 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 15 **Follow the steps on slides 14 and 15 to change the LCL to a dotted red line** Excel 2010 Label and Finish Chart 16 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 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. Excel 1 Additional Steps for file2 nondeaths between deaths.xlsx ** Follow pages to create and edit control chart** Excel Additional Steps for file3 Red Bead Game.xlsx 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 11 Excel 2010 Creating Control Chart for file3 Red Bead Game.xlsx 20 To create Control Chart, follow steps on slide 12. To format Control Chart, follow steps on slides Before Formatting After Formatting Excel 2010 Final P-Chart for file3 Red Bead Game.xlsx Now charts can be generated for files 1-3. Refer to slides for file4 and slides for file5. 21 Excel 2010 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. Select Custom Sort 4. Check that My data has headers 5. Next to Sort by select Type 6. Click OK 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 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. Go to Add-Ins 3. Select X-bar S Chart from SPC Macros drop- down 4. Click inside the groupings range box and highlight DSCHRG_MNTH (this is the grouping variable) in column C Excel Enter a significance level (0.01) and click OK to generate X-bar S Chart 11 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: Excel C-Section Vaginal **After creating the X-bar S charts, use data from columns D-G to create the control chart (slides ).** 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: Excel C-Section ChartVaginal Chart 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, 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 27 1 Excel 2010 Additional Steps for file5 Breast Cancer Screening.xlsx 28 The new worksheet will initially look like this image. 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 Excel 2010 Additional Steps for file5 Breast Cancer Screening.xlsx On the PivotTable Field List menu, click on the arrow next to Sum of ID 2. Select Value Field Settings After Excel Select Count from the Summarize value field by scroll box 4. Select OK Additional Steps for file5 Breast Cancer Screening.xlsx 1. Now highlight the values that correspond with 2013 (preIntervention) and 1 for screening done. This will be column C cells Go to the AddIns tab 3. Click SPC Macros 4. Select pchart 5. The highlighted material will appear in the first box in the p Chart pop-up window 6. Click into the 2 nd box and highlight column D Grand Total cells 617 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 PChart Table will appear under the tab titled p Chart Table 1 30 Excel 2010 1 Additional Steps for file5 Breast Cancer Screening.xlsx **Return to the worksheet with the pivot table** Repeat the steps from the previous slide (slide 30) for creating a pchart, but using only 2014 data (PostIntervention), this will be rows 19 24. 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. 31 Excel 2010 1 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. Excel 55 Additional Steps for file5 Breast Cancer Screening.xlsx Finally, create an SPC chart as you did in previous steps (slides ). 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 Additional Steps for file5 Breast Cancer Screening.xlsx Excel *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). Before After Embed Macro into Excel (optional) 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 Click the File tab 2. Select Options Excel 2010 Embed Macro into Excel (contd) 3. Select the Add-Ins tab 4. Press the Go button at the bottom of the Add-Ins screen Excel 2010 5. Press the Browse button 6. Locate where you have saved the macro, select it, and press "OK" 7. Make sure the SPC Macros AddIn rev xlam box is checked, and press OK Embed Macro into Excel (contd) Excel 2010 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