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.
Thanks
Regards
Kartick
>>> "Sebastian F. Büchte" <[email protected]> 09/20/07 11:21 PM >>>
Kartick
looking at your example it seems more to be a sort problem. Try
gsort ABC, mfirst
This will sort your data by entries in ABC in ascending order with
missing values first.
If you would like to add observations to a dataset, you could use
-expand-. This command allows you to add extra observations by copying
existing ones, e.g., expand 2 in 1 will append a full copy of your
dataset's first observation and append it to the very end of the
dataset. Find out more about -expand- with -help expand-.
Sebastian
2007/9/20, Kartick Gupta <[email protected]>:
> Hello all,
> Is it possible to insert a row in the data table? I know it is
possible by running some simple program, but is there any function
already available in Stata?
>
> For example,
>
> ABC --change to---> ABC
> 1 x .
> 2 y x
> 3 z y
> 4 . z
>
> Regards
> Kartick
>
>
>
> *
> * 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/
>
*
* 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/
*
* 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/