Exercise 14: Box plots in Prism
Go to parent GraphPad Prism statistical analyses
For this exercise we will use data of the babies data set. We are going to create a boxplot of babies’ weight for each category of smoking behavior of the mother:
- 0 = never (never smoked)
- 1 = yes (still smoking)
- 2 = recently (quit during pregnancy)
- 3 = long ago (quit before pregnancy)
- 9 = unknown
So we need to create five boxplots in total.
This means we only need the wt (weight of the baby) and smoke column, but we need to get the weights for different smoking categories in separate columns. I will explain it for the first smoking category: 0=never.
Get the weights for smoking behaviour 0=never in a separate table. |
---|
To do this you need to prune the rows. Pruning is done based on X-values. So first you need to paste the columns wt and smoke to an XY-table where smoke is the X column (smoke contains the values you want to base the pruning on):
Now you can prune the XY table:
Now keep only the values for which X equals 0 (the mother never smoked):
Click OK. This generates a transformed data table containing the weights of the babies from mothers that never smoked:
I have changed the title of the wt column to never since this is tha label I want to use in the box plot. |
Go back to the XY table containing smoke and wt values. Repeat the pruning for smoke=1, smoke=2, smoke=3 and smoke=9.
Once you have the pruned wt columns for each smoking type, you can start thinking about the box plots. The easiest is to create one table containing 5 columns, each column containing weights of babies for one specific type of smoking behaviour.
Create a new column table containing these 5 columns. |
---|
Box plots are linked to column tables:
|
Create a box plot for this new column table. |
---|
This generates a box plot of the data. |
Just for the sake of the next exercise (Exercise 15C), we'll also create an individual box plot for smoke=0 and smoke=1.
Make a boxplot for smoke=0. |
---|
This generates a box plot of the data.
|
Do the same for smoke=1.