Put it into Practice
Now it’s time to try things out for yourself. Complete each of the following steps, based on what we learned in this chapter.
Unless your instructor tells you otherwise, use a do-file to execute all commands needed to accomplish the following:
- Load in the social media posts dataset (
posts.dta). You can download it here and save it on your computer. Or you can load the file directly into Stata through the web at the following URL: https://learndata.net/posts.dta
Select four variables to examine. Make sure to choose at least one qualitative (or ordinal) variable and one quantitative variable. Note that binary variables (with values of only 0 and 1) are considered qualitative variables.
For each of these four variables, make at least two graphs. If you are submitting your work to an instructor, you will probably want to save a copy of each graph in a Word document, which you can then submit to show you completed this assignment.
See the video at the bottom of this page for guidance on getting graphs out of Stata and into a Word doc. You can try using copy-paste, although this may not work if you have a remote access setup for using Stata. Another option is to take a screenshot and then paste this into your Word doc. One final option is to click the “save” icon in the window showing the graph, allowing you to save the graph as its own file in a folder of your choosing; before clicking the “Save” button, you will need to change the setting under “Save as type” to something like a PNG or JPEG that can easily be read into Word. In Word, you can then navigate to “insert” a “picture” from your device.
After completing all of this, you should save your do-file in a folder that is convenient to access. It is a good idea at the end of your work to try clearing out your Stata session (e.g., typing “clear” in the command box and then hitting Enter) and then running your entire do-file at once, to make sure you have a clean do-file that can fully execute. If you are submitting work to an instructor, they will likely want you to send them both your do-file and a Word doc containing your graphs.