Book Image

Data Analysis with STATA

Book Image

Data Analysis with STATA

Overview of this book

Table of Contents (16 chapters)
Data Analysis with Stata
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Scatter plots


Let's start with scatter plots. Assume that your data has variable A and variable B with a lot of values. You need to find a correlation between variable A and variable B. Before you find the correlation, you need to plot the scatter graph of these two variables.

Select twoway graphs from the Stata tool list and follow the following steps:

  1. Click on the Create button. Here is what the box will look like:

  2. Select Basic plots and select the type of the plot as Scatter plot.

  3. Select X and Y variable, as shown in the next screenshot:

  4. Click on the Accept button after performing the required changes, as shown in the preceding screenshot.

  5. Your output window will open with scatter plot, as shown in the next screenshot:

What if you need to add more variables and create complex scatter plots? You can add as many variables as you want and observe the clusters that are naturally available in the scatter plot. Here is a procedure to perform this:

  1. Click on the graphing tool again.

  2. In the list of variables...