Bookmark and Share

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]

st: how to write loop program for each value of a variable?


From   econqian222 <[email protected]>
To   [email protected]
Subject   st: how to write loop program for each value of a variable?
Date   Thu, 3 May 2012 06:28:30 -0700 (PDT)

Hi, statalist
     I want to write a loop program for each value of a variable, such as
     a loop program about variable "v","q", "p" by the value of code(1,2,3),
the data is listed as following:
code	v	q	p
1	4.65605	3.82133	.5891969
1	8.55465	3.273241	.1132121
1	.5072982	3.273241	.1132121
2	.0668553	3.781385	.112315
2	4.346485	3.999861	.1429252
2	.453282	3.389864	.27451
3	2.514498	2.554792	.432496
3	5.027869	3.869841	.1236284
.	.	.	.
.	.	.	.
.	.	.	.

Then how to write such loop program?

Many thanks,
Qian

--
View this message in context: http://statalist.1588530.n2.nabble.com/how-to-write-loop-program-for-each-value-of-a-variable-tp7523601.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index