You can use -set obs #- to add observations.
For example:
sysuse auto,clear
gen t = _n
count
set obs `=r(N) + 1 '
replace t = 0 in `=r(N) + 1 '
sort t
drop t
// or use Roger Newson's -ingap-
sysuse auto,clear
ingap
Scott
On 9/20/07, Kartick Gupta <[email protected]> wrote:
> Hello Sebastian,
> Thanks for your suggestion. However, -gsort- may not be helpful. For
> example, if there is no missing data and still I want to insert a row in
> 1, gsort will fail. I think -expand- will only work for duplicate
> options. By using [_n] function, the problem can be solved, but that
> might not be effective utilization of time given that I have to repeat
> for a large number of variables.
*
* 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/