Dear all,
I have a problem labeling plot using twoway command.
I am plotting scatter with line of best fit together where I use the twoway command. However, I cannot label the plots by bench.
This is my raw data:
I try the following code
When I try this, I get the error "option mlabel() not allowed".
Now I know, that I can obtain labelled scatter plot through:
However, I need the diagram along with line of best fit. Is it possible to obtain both labelled scatter with the line of best fit?
Help in this regard will be really appreciated. Thank you!!
I have a problem labeling plot using twoway command.
I am plotting scatter with line of best fit together where I use the twoway command. However, I cannot label the plots by bench.
This is my raw data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str5 bench float(StateWins shrinesper1000) "abohc" .4228856 0 "banhc" .5753425 .013336194 "dikhc" .51754385 .00256476 "hydhc" .5224359 .010040317 "islhc" .3741007 0 "karhc" .4391026 .003207205 "kashc" .368 .010207728 "khyhc" .6451613 0 "larhc" .4615385 .007298633 "lhrhc" .4746988 0 "mulhc" .3854749 .003135484 "phc" .4971098 .0018573207 "quehc" .426087 0 "rwphc" .462069 .0011151128 "sibhc" .4277108 .005543299 "sukhc" .6610879 .01560029 end
Code:
twoway (scatter StateWins shrinesper1000) (lfit StateWins shrinesper1000), mlabel(bench)
Now I know, that I can obtain labelled scatter plot through:
Code:
scatter StateWins shrinesper1000, mlabe l(bench)
Help in this regard will be really appreciated. Thank you!!
Comment