Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Using mkmat with a local as the varlist


From   Mauricio Esteban Cuak <[email protected]>
To   [email protected]
Subject   st: Using mkmat with a local as the varlist
Date   Fri, 8 Mar 2013 16:05:50 -0600

Hi,

I'm trying to save the lists of variables from a macro as an argument
for the mkmat command.
Here is an example of the use I'm trying to give:

******** Begin Code**************

sysuse auto, replace

foreach v of var * {
	drop if missing(`v')
}

qui ivregress gmm price trunk (weight = turn length )

/*  Now i'd like to construct a matrix with the instruments      */

/* This works: */

mkmat trunk turn length, matrix(A)

/* But this doesn't:  */

local instruments e(insts)

mkmat `instruments', matrix(B)


***** End of code ********

I've tried different ways to define the local but I haven't been able
to make it work. I think the problem is mkmat takes `instruments' as a
string and not as
a list of variables, but I don't know how to fix it...

Thanks for your time,

M.C.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index