Written by: STATISTICA 11/21/2011 4:00 PM
Histograms visually show the frequencies of data. Similarly, a bivariate histogram shows frequencies across two variables. This is a powerful graph for showing the relationship between two variables.
It may be helpful to add the frequency value to the bars of the bivariate histogram, giving a more precise picture of the relationship. This article focuses on the steps to add the numeric frequency to the plot.
For this example, we will use the example data file HeartDisease.sta located in C:\Program Files\StatSoft\STATISTICA 10\Examples\Datasets. A bivariate histogram can show the relationship between the presence of Coronary Heart Disease and Family History of heart disease.
In STATISTICA, select the Graphs tab. In the More group, click the 3D Seq. arrow, and select Bivariate Histograms from the drop-down menu. In the 3D Bivariate Histograms dialog box, click the Variables button. In the variable selection dialog box, select variables as X = Family History and Y= Coronary Heart Disease. Click the OK button.
Click the OK button in the 3D Bivariate Histograms dialog box.
From the graph, it is apparent that individuals without a family history of heart disease were less likely to exhibit coronary heart disease. This plot gives a nice visual representation of the relationship between these variables.
Because of the three-dimensional nature of the plot, the precise frequency is harder to discern. The tallest column of the plot, where both Family History and Coronary Heart Disease are Absent, has a frequency of 206. It is obvious that the frequency for this combination is higher than the other combinations, but the precise value is not obvious.
Even at a different vantage point, the exact frequency may be difficult to determine. (Use the interactive graphics controls at the bottom of the graph window, or select the Edit tab and in the Customize Graph group click the 3D Rotation Control to explore different vantage points.)
Now, let’s add the cell frequencies for each of the four bars in this graph to show precise frequencies. To do this, we will manually add the cell frequencies as custom text boxes on the plot.
1. To access the needed frequencies, create a crosstabulation table. Select the Statistics tab. In the Base group, click Basic Statistics to display the Basic Statistics and Tables Startup Panel. Select Tables and banners.
2. Click the OK button. In the Crosstabulation Tables dialog box, click the Specify tables (select variables) button. In the variable selection dialog box, select Coronary Heart Disease in List 1 and Family History in List 2.
3. Click the OK button in the variable selection dialog box, and click the OK button in the Crosstabulation Tables dialog box to advance to the Results dialog box.
4. Click the Summary: Review summary tables button. The output gives the frequencies across the two selected variables. These values will be used in the custom text boxes added to the bivariate histogram plot.
5. With the plot active, select the Edit tab. In the Customize Graph group, click the Text box icon to add a custom text box to the plot.
6. Now, click on the plot where you want to add the custom text box. In this case, I want to add it to the bars of the bivariate histogram.
7. Double click on the custom text box to display the Titles/Text dialog box. Enter the value from the crosstabulation. Here, the text box is for Family History = Absent and Coronary Heart Disease = Absent. This value is 206. You can adjust the size and font if desired.
8. Click OK, and the text box is updated with the appropriate cell frequency. You may need to move the text box to center it on the column: select it and then drag it to the appropriate place.
9. Repeat the process for the remaining columns with their respective frequencies from the table output.
The resulting graph shows the visual display of the relationships between the two variables while giving the precise cell frequencies as well.
0 comment(s) so far...