Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: nonlinear relationships between multiple axis


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: nonlinear relationships between multiple axis
Date   Mon, 18 Jun 2007 12:59:28 -0400

Steinar Fossedal --
You might try something along these lines:
clear
set obs 16
gen B = _n
gen C = B^.5
gen A = B
line A B, xla(1 "1" 16 "16") || line A B, xaxis(2) xla(1 "1" 16 "256", axis(2))

and if you need to construct a set of labels to put in xla(.), you may
want -levelsof- and a loop using -foreach-.

On 6/18/07, Steinar Fossedal <[email protected]> wrote:
Hi, listers

I have three variables where variable A can be derived from each of the
two others (B & C). I now want to create a line-graph with the value of
variable A on the y-axis and the corresponding values of B and C on
xaxis 1 and 2 respectively.

In case this was as hard to understand as it was to explain, I'll
elaborate with an example:

clear
set obs 100
gen B = _n
gen C = B^.5
gen A = B
line A B

I want to include a second x-axis which shows the corresponding values
of C.

Can this be done somehow?

My dataset only contains 16 points, so suggestions for ugly hacks are
also welcome :)

-Steinar
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index