Introduction
This is a skill acquisition session. At the end of this session the students should be able to produce, from data, the most common plots
used in clinical research
- The Pie Chart
- The bar chart with Fixed and Variable Intervals
- The x/y Scatterplot
- The Forest Plot
- The Data Plot
How shall we do this session - I will first give a talk on the use of Macroplot for graphics
- We will then form 6 groups of 4 students each
- We will do each plot in turn. For each plot, we will
- Have a short talk on what the plot is all about
- Professor Chang will demonstrate how to do it in StatPgm and in Excel
- The groups will duplicate what is done
- This will be followed by Questions and Answers
- If the students do these easily and quickly, and wishes to try doing it in Excel, I will try and help
What is the best way to do graphics - This session is only introduction and orientation
- Students should, in their own time, study MacroPlot_Help.php in depth
**Do lots of plots**- If asked, I will provide as many exercise as requested
will need StatPgm_6_Graphics.php It may also be useful to open the Powerpopint file to place and make final modifications to the graphics produced Macroplot
Why Macroplot
- Developed in Dept. O&G over many years, and improved continuously since
- Lack of cheap, good quality graphic packages
- Graphics need to be edited during production
- The first result is usually unsatisfactory
- Need to change size, color, line thickness, size of dots, and labelling
- Need to place additional symbol or text on the plot
How does Macroplot work - Separate the job into two stages
- Stage 1. Produce pseudo-computer codes (macros) which are plotting command
- Stage 2. The computer produces the plot according to the macros
- Both codes and plots are displayed
- The parameters of each macro can be modified
- The plot can be re-drawn using the modified code
- Most of the plot remains the same, but the modified macro changes the appearance of that particular plotting element
- The macros have improved over the years
- Unused macros are removed from the system
- Macros conform to uniform format whenever possible
- Commonly used parameter values are inserted by default
Where are all the instructions - All instructions, examples, and templates for codes are in MacroPlot_Help.php Click to open file so we have a ready reference
- Use this as a reference
- Do not try to memorise it. Too much information
- Refer to it when a macro template is needed
- Refer to it, if difficulties found in changing a macro
How will we learn to use Macroplot - Go straight to StatPgm_6_Graphics.php
- Run the program and do a plot
- Modify the macros, and learn what they mean and how to modify as we work on each plot
- Refer to the help file when necessary
Plots
- Click Example to produce the initial macros and plot
- Demonstrate changes in code
- Change size of bitmap
- Change background color
- Move wedge
- Change color of wedge
- Change labelling
- The size of the pies should reflect the different total number of deliveries
- One pie should have approximately 6 times the area as the other
- As area = πr
^{2}, r is sqrt(area) - So the radius of the wedges of 1 pie should be sqrt(6)= 2.5 times the other roughly
- The wedges for different deliveries should be in the same order and the same color to make labelling easy
- The two pies can then be placed next to each other for comparison
- Using Macroplot
- Draw 2 pies separately
- Edit to same color, but change diameters of the wedges to 100 and 40 pixels
- right click on bitmap and save to a temporary folder
- Open Powerpoint
- Use Insert->Pictures, load bitmaps to Powerpoint
- On Powerpoint
- Go to Home->Picture->Format->Color, scroll to bottom and click transparency arrow
- Click on white background of imported bitmap and click. The bitmap should now have transparent background
- Move the two bitmaps until they are correctly positioned
- The x axis defines different categories
- All the bars are equal distance apart
- Excel and Macroplot both create Fixed Interval Bar Charts
- The x axis define values of a measurement
- Distances between bars depends on the x value of the bar
- Macroplot creates Variable Interval Bar Charts
- Excel does not creates Variable Interval Bar Charts
- Each row represents the parameter of a bar
- The first column represents x
- For Fixed Interval charts
- It is taken to be a text label
- It must be a single word with no spaces
- For Variable Interval charts
- It is taken to be a number representing value of x
- It must be a single number
- For Fixed Interval charts
- The second column is the value of y, the height of the bar
- Click both Example buttons for Bar chart Plot
- Demonstrate
- Difference between fixed interval and variable interval
- Scaling y axis
- Modify data to wide difference in value
- Change min and max y
- Create ylog 1
- Rescale y as yaxislog
- Change bars base to 1
- Each row is a dot
- Column 1 is x value
- column 2 y value
- Click Example to produce the initial plot
- Demonstrate changes in code
- Change axis and scale
- a central value (a dot)
- A line marking out the 95% confidence interval
- Each row represents a study
- Column 1 is the central effect value
- Column 2 and 3 the values of the 95% confidence interval
- Click Example to produce the initial plot
- Demonstrate
- For normal scaling
- Change x axis labelling
- For normal scaling
- For log scaling
- Change x axis labelling
- Show effect of non-positive number
- Show what happen when the log scaling is changed to normal scaling
- Open Excel and copy table to Excel
- Select and copy appropriate columns
- Paste selected data to program
- Produce initial Forest Plot
- Rescale x axis
- Change last dot to different shape and color
- It plots data point values in lines according to group value
- If more than 1 dot exists in a value, the program puts the dots next to each other so they will not overlap
- Similar to SPSS, the plot marks
- A vertical line delineating the 95% confidence interval for measurements
- A box-like structure delineating 95% confidence interval of the mean
- A horizontal line delineating the mean
- Click Example to produce the initial plot
- Demonstrate
- Data a 2 table
- Each row is a case
- Column 1 is group number
- Column 2 value
- Data a 2 table
- For Results
- Adjust y axis and labels
- point out delineators (mean and 95% confidence intervals)
- Open Excel and copy table to Excel
- Edit by collapsing all data into 2 columns
- Copy data ans paste to program
- Produce initial data Plot
- Rescale y axis
Pie Chart
Introduction
Pie chart is an useful way to show relative sizes that adds up to 100%. An example is classifying
different methods of deliveries. All deliveries are included, so the total is 100%
Macroplot
The example shown in the program contains data for
different deliveries in one year from a hospital. These are 2762 normal deliveries,
1009 ventouse, 213 forceps, and 1328 C.S.
These are converted to 52%, 18.99%, 4.01%, and 25% respectively.
The Macros are then created, and the pie chart produced Go to graphics program Exercise
We have data of deliveries from two hospitals.
Compare the two hospitals visually by placing two pie charts together Suggested approach Bar Chart
Introduction
Bar charts are appropriate to values between different groups, which may or may not add up to 100%
An example is antenatal complication. Some people have more than one complication, others none at all. The total can be from less than 100% to more than 100% Fixed Interval Bar Chart Variable Interval Bar Chart Macroplot
Data input is the same for both types of bar chart, a 2 column table of data
Go to StatPgm_7.php : Graphics Exercise
We conducted a controlled trial, where normal women admitted in labour
were randomly allocated to be cared for midwives or doctors. We compared the incidences of
clinical interventions and found the following results
XY Scatterplot
Introduction
The easiest of all plots
Data entry : 2 column table for both Macroplot and Excel Macroplot
Go to graphic program Exercise
We collected birth weight data and found the following information
Create X/Y Scatterplot for both boys and girls on the same plot
Forest Plot
Introduction
A Forest Plot is used to show the effects of a number of studies all in one plot.
This is an efficient manner to display a lot of information Each study is represented by Macroplot
The entry data is a 3 column table
Go to graphics program Exercise
Create Forest Plot Data Plot
Introduction
Dataplot simulates a similar plot produced by SPSS, with improvements
It provides the following features Macroplot
Go to graphics program Exercise
We compare maternal height of women delivered by Caesarean Section (CS) or vaginal delivery (VD), and obtained the following results
Create Data Plot |