Tuesday, August 23, 2011

Example of STATA's Analytical and Graphing Power

I really wanted to combine many graphs into one using STATA statistical software when I saw the graph below. However, even if you look at a really large version of this 6x5 graph, you won't be able to see the details unless you have 20+/20+ eyesight, which most of us don't.

After looking at some STATA manuals I came up with this graph below. I think it is really neat how you can write a simple piece of code in STATA to merge as many graphs as you want. Here is the simple piece of code I used to make the graphs happen:

twoway scatter   npl2000 hrs_82
graph save g1.gph, replace
twoway (scatter meanhs8 hrs_82) (lfit meanhs8 hrs_82), ytitle(mean housing prices in 1980)
graph save g2.gph, replace
gr combine g1.gph g2.gph

And here is the actual explanation of what the graphs mean:

3b)  From the graph on the left below we can observe that an HRS score higher than 28.5 accounts for some but not all the variation for determining whether or not a census tract contains a hazardous waste site listed on the NPL by year 2000.
3c) The graph on the right gives a linear regression estimate, showing a mildly positive relationship between the HRS score in 1982 and mean housing prices in 1980. Additionally, from this graph we can conclude that HRS score in 1982 serves as a good predictor for housing values in 1980.
And here is the graph: 


No comments:

Post a Comment