Statalist The Stata Listserver


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

st: RE: qvf and xi expansion


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: qvf and xi expansion
Date   Thu, 10 May 2007 14:04:45 +0200

--- Henry Sauermann wrote:
> I have several categorical variables that I would need to expand using xi
>(putting the dummies in directly makes the command huge and very complex).
> My problem is that qvf does not seem to work with the expansion. While it
> does expand variables in the first part of the statement, it does not expand
> variables in the second.
> 
> E.g., in
> 
> xi: qvf y i.x1 x2 x3 x4 (i.x1 x2 x4 t3)
>
> ,the first time x1 is expanded, but the second time qvf reports missing
> variables (presumably indicating that it did not expand x1 correctly the
> second time).

You can use the fact that you feed these commands varlists and thus you 
can use wildcards when specifying your variables, see: help varlist. In y
our case you could type:

xi i.x1 
qvf y _Ix1* x2 x3 x4 (_Ix1* x2 x4 t3)

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/
-----------------------------------------


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index