Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Overlaying an unknown number of line graphs
From
Antoine Terracol <[email protected]>
To
[email protected]
Subject
Re: st: Overlaying an unknown number of line graphs
Date
Wed, 09 Nov 2011 11:57:04 +0100
Hi Colin
would something like
local n=10
forvalues graph =1/`n' {
local command "`command' (line freq`graph' sample`graph' , sort)"
}
twoway `command'
meet your needs?
Antoine
On 09/11/11 11:48, Colin Robert Angus wrote:
Dear list,
I am writing a do file to take n random samplings from a distribution,
for a user-inputted value of n.
This file creates variables labelled sample`i' and freq`i' for each
value of i between 1 and n.
I would like to draw a single line graph with all of the plots of
sample`i' against freq`i' overlaid on it.
So something like:
twoway (line freq1 sample1, sort) (line freq2 sample2, sort)...(line
freqn samplen, sort)
But I can't see how to write this without knowing the value of n
beforehand, and then, if n is large, writing an incredibly long command.
Is there a way to do this within Stata?
Regards,
Colin
--
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/