Statalist


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

st: RE: Generate data and matrix from unbalanced panel


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Generate data and matrix from unbalanced panel
Date   Mon, 30 Jul 2007 10:32:40 +0200

Nguyen Cong Minh wrote:
> But I don't know how to write a program can do this transformation and give
> me pd and Np into vector pd[.,1], Np[.,1],
> (in this example, pd[]=(1 2 3)' and Np[]=(2 1 2)').And how I can use
> pd[.,1], Np[.,1] to partition
> the whole transformed matrix [Id yr var1 var2 var3] into blocks(i) [Id yr
> var1 var2 var3] with rows = pd[i,1]*Np[i,1]?

I don't think you need any matrices or vectors. Can't you just make an 
identifier variable in much the same way as you did before and use -if- to 
identify the rows? Unless you are using mata, you definitely do not want to 
store pd and Np in vectors, but rather in locals, but as I said that won't 
be necessary anyhow.

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