Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72772

How to calculate intersection point of two graphs

$
0
0
Hi Statalisters,



I am using margins command to see effect of interaction term and subsequently I am interested in calculating the point at which below two lines intersect.

I run the model first using:

:
regress avsg asg_1 avten pcoo avtmt pdc avri avhhi poc avtd avcal  i.cino##c.avlemp, vce(robust)
Then I get the margins using:
:
margins cino, at(avlemp=(-1.2(.6)4.8))
And finally the graph using:

:
marginsplot, noci
which comes out to be:

Array

Since I am interested in calculating the point at which these two lines intersect, I can do it manually by by getting the line equations for both using y=slope*x+constant. However, I would like if there's a way to do this through some code in Stata.

Thank you,
Mohsin

Viewing all articles
Browse latest Browse all 72772

Trending Articles