[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: graph with valuelabel
Ricardo Ovaldia <email@example.com> asks why his -twoway lfit- command fails
to use the value labels for his x-variable, even though he specifies
-xlabel(1 2, valuelabel)-.
Svend Juul <SJ@SOCI.AU.DK> diagnosed the problem when he wrote
> Perhaps surprisingly: -twoway scatter- does what Ricardo wants, but
> -twoway lfit- does not.
> It could be a deliberate decision, but it is a bit strange.
A semi-deliberate decision; maybe. Behind the scenes, -twoway lfit- and his
close cousin -twoway qfit- do not use the actual x-variable, but instead
generate their own variable so that you can control the number of points on
the line or curve using -n()- option. The value labels are not currently
being carried forward to the generated variable.
No matter the cause, this will be made to work in a future ado update.
Until then, Ricardo can explicitly place the text of the labels on the axis by
modifying his -xlabels()- option to
xlabel(1 "M" 2 "F", valuelabel)
If instead of two ticks with single character labels, there are many ticks
with long labels, Ricardo could adapt Svend's diagnosis into an alternate work
around. Add a scatter plot using the same variables and if qualifier before
his linear fit and make the markers invisible -- option -marker(none)-.
Because he would then have two plots, Ricardo will probably want to turn off
the legend, -legend(off)-.
* For searches and help try: