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
Optimal lags and Error-correction modelGood morning everyone; I want to perform a cointegration with the Error correction model. Everythi…
putdocx cell / row heightIs there a way to control the row or cell height in a putdocx table? …
How to set the X axis in the DASP package in stataI want to use the DASP plug-in in stata and use the Lorenz curve to analyze the fairness of inter-pr…
Business calender: Get omitted dates using bodf()I have a list of dates for specific company events of listed US companies. This variable (reguldate)…
How to evaluate the following hypothesizes?Hello all! I am currently working on a research project and I have a dataset of bankrupt and non-ba…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting a fitted Line for log scale axis
Post a Comment