From the course: Advanced and Specialized Statistics with Stata

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: More on visualization techniques

Solution: More on visualization techniques - Stata Tutorial

From the course: Advanced and Specialized Statistics with Stata

Start my 1-month free trial

Solution: More on visualization techniques

(upbeat music) - [Instructor] Let's have a look at the solutions to our data visualization challenge. There was only one challenge, to create a good looking graph, but it had several components to it. The first component was to load the auto data and scatter price against weight. In addition, we were asked to superimpose a linear fit of price against weight so that should be pretty easy to do. Sysuse auto loads the auto training data and we can call a scatterplot by typing two way scatter price against weight and, on top of this, we're going to overlay an L fit plot of price against weight. I'm going to pull this over here to the left because we're going generate a lot of code and this way we can see it better. Let's take a look at this. This is our starting plot. The next step was to plot this graph over the variable foreign. We can do this by using the by option in one of our two graphs so let's add it to the L…

Contents