Hello,
I have to plot a simple fitted line for exports relative to GDP (the variable is called "norm_exports") on the y axis and bilateral distance (variable "km") on the x axis. However, I am having problems, since I have to depict the y axis in log scale. I know that I can therefore not use the standard twoway lfit command:
twoway (scatter norm_exports km)(lfit norm_exports km)
Therefore I tried to use predict for a regression of the log of my export variable on distance:
quietly reg log_norm_exports km
predict gr
label var gr "Linear prediction"
twoway (scatter norm_exports km)(line gr km, sort), yscale(log)
However, the code I used is not working. I would be really thankful if one could tell me where my mistake was.
Thanks a lot.
Related Posts with Plotting a fitted Line for log scale axis
Durbin Wu Hausman TestHello, i am struggling with interpreting results from Durbin-Wu Hausman Test for Pooled OLS and fi…
Merging two datasets - m:mDear Stata Users, Below I have a sample of two datasets: set1 and set2. I need to merge them. The p…
Creating all matched pairs Code: clear all set obs 50 generate id1 = . replace id1 = 1 if _n > 0 & _n < 10 replace …
boottest: just as wild, 10X fasterAppendix A.2 of the paper about boottest describes an opportunity to speed up the program's construc…
How to transform this kind of data to panel dataHi everyone, I have a dataset like follows, MMM US Equity MMM US Equity MMM US Equity ABBN SW Eq…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting a fitted Line for log scale axis
Post a Comment