Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Re: Defining a matrix in ml program


From   "Joseph Coveney" <stajc2@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Defining a matrix in ml program
Date   Mon, 11 Mar 2013 10:34:33 +0900

Cyrus Levy wrote:

In the ml program below, I want to define a matrix based on parameter
equations and use that matrix later in lnL. But "ml check" command
returns an error in the line where I define the matrix MT. I am
wondering if it is possible or not at all to create matrices in Stata
based on ml parameters in this context. If yes, what is wrong with my
code and how can I fix it?

[snip]

--------------------------------------------------------------------------------

It looks as if you're trying to assign a dataset variable to a matrix cell.  I 
believe that the variables created by -mleval- from a vector are 
constant-valued, so you can choose the first row (first observation) of data 
from the variable and plug that as a scalar into the matrix cell.  Try changing
the line of code that defines the matrix from

  matrix define `MT' = [`eta1', `eta2'\ `eta3', `eta4']

to

  matrix define `MT' = (`eta1'[1], `eta2'[1] \ `eta3'[1], `eta4'[1])

Joseph Coveney

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