Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -Simulate- and dropping variables


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: -Simulate- and dropping variables
Date   Mon, 20 Aug 2007 16:16:15 +0100 (BST)

--- Rachel <academicgirl@gmail.com> wrote:
> 1. Is there any way to stop -simulate- from dropping certain
> variables before it executes?  It seems to drop all variables within
> the dataset.

-simulate- does not drop variables before it executes, it opens a new
dataset once it is finished. So it does the computations on your
original data, and when the simulation is over it opens a new dataset
that contain the result from the simulation. I presume that that is why
you think that -simulate- drops variables.
 
> 2. I have a large number of variables] with the same stem "abc10
> abc11 abc12....abc99" I'd like to drop all variables with an abc*
> prefix if any such variables currently exist within the stem.
> 
>  I've tried using -isvar-, but--from my reading--that requires me to
> list out each of these variables.  Is there an easier way?

capture unab todrop : abc*
drop `todrop'

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  http://uk.promotions.yahoo.com/forgood/environment.html
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index