Legend(label(1 "USA") label(2 "UK") label(3 "Australia") label(4 "Qatar"))) (connected unemp year if country="Qatar", /// (connected unemp year if country="Australia", msymbol(square_hollow)) /// (connected unemp year if country="United Kingdom", msymbol(triangle_hollow)) /// Twoway (connected unemp year if country="United States", msymbol(diamond_hollow)) /// We can present lines for each country above in a single graph. Twoway connected unemp year if country="United States" | ///īy(country, title("Unemployment Rate")) /// In this case, we have to provide the country name and use by country command. We can use Stata's two-way connected command to create separate line graphs for a selected set of countries. Twoway connected unemp unempf unempm year if country="United States", /// We can present the above graph by connecting the lines and adding symbols (circle, diamond, square, etc.) to the lines. Legend(label(1 "Total") label(2 "Females") label(3 "Males")) /// Line unemp unempf unempm year if country="United States", /// Let us add a legend, line pattern, y-axis title, and graph title to make the graph more beautiful. Stata now gives us a better-looking graph. Let us generate the line graph again using the cleaner data. Let us remove zeros for each variable to get a nicer-looking graph. We see each of the variables contains 0% unemployment rates. Let's check the variables more carefully. Stata will give us the following line graph: Line unemp unempf unempm year if country="United States" Generate a line graph for the variables unemp unempf unempm for the United States. Inspect the data to get a better idea about the data. First, open a Stata data file by typing the following codes:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |