Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: Stack trick by Nicholas Cox

From   Michael Stewart <>
To   statalist <>
Subject   st: Re: Stack trick by Nicholas Cox
Date   Sun, 3 Mar 2013 15:10:31 -0500


I am a novice and trying to learn stata graphics.I read Speaking Stat
by Nick, vol 4 , number 2, page 190-215 regarding Graphing Categorical
and compositional data.
Nick writes a conditional statement on page 193.I could not understand
the second option
His cond statement is bysort foreign mpg:gen foreign2=cond(foreign==1,
1-0.1*(_n-1)/7, foreign+0.1*(_n-1)/7)
I cannot understand  what does 1-0.1*(_n-1)/7 and
foreign+0.1*(_n-1)/7  compute and their purpose.I tried to read the
article but am still at loss.
Sorry if it was a straightforward question(which I could not understand)

Thank you ,
Yours Sincerely,
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index