Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: mkmat


From   baum <[email protected]>
To   StataList <[email protected]>
Subject   st: mkmat
Date   Fri, 18 Oct 2002 18:05:54 -0400

Chris wondered how to pick up the correct number of columns after using xpose, which generates v1,v2,...

use http://fmwww.bc.edu/ec-p/data/wooldridge/wagepan,clear
keep nr-occ9
collapse black-occ9, by(year)
summ year,meanonly
local en = r(N)
xpose, clear varname
mkmat v1 - v`en',mat(one)

xpose,clear
keep if year < 1985
summ year,meanonly
local en = r(N)
xpose, clear varname
mkmat v1 - v`en',mat(two)

Kit
*
* 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