I would like to create a scatter plot with a fitted regression line, along with R^2 and display the name of the country corresponding to each point. I would also like to name the y-axis "Interest Rate Differential (%)", the y-axis "Net Foreign Asset (NFA)" and provide a title for the graph "Interest Rate VS NFA".
Here is the data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str52 Country double(nfa diff_i) "Australia" -.4267577486506838 1.615668604651164 "Canada" -.2696254208220782 .011162790697674955 "Chile" -.3628558592742929 10.223658382651651 "Czech Republic" -.23455379242580174 2.010113071740569 "Hungary" -.7495181138676478 9.596175101188097 "Iceland" -1.7826689000284937 10.434086163048555 "Israel" .1590222455724404 .6748448767712435 "Italy" -.10556646713862525 5.023209166666656 "Japan" .37988397756392067 -3.7284142512077305 "Korea" -.12107555882403813 1.5218750000000025 "Mexico" -.3443486180147916 8.274787071185017 "New Zealand" -.7649633061776219 1.8052225176122438 "Sweden" -.31080523852767533 .37955777777777666 "Switzerland" 1.2745308938969182 -.6942708333333352 "United Kingdom" -.0366740451489023 -.5527753968253981 end
Code:
graph twoway (lfit diff_i nfa) (scatter diff_i nfa) graph twoway (lfit i nfa) (scatter i nfa)
0 Response to Scatter plot with Country name and R-square
Post a Comment