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]

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/

**Follow-Ups**:**Re: st: Re: Defining a matrix in ml program***From:*Maarten Buis <maartenlbuis@gmail.com>

**References**:**st: Defining a matrix in ml program***From:*Cyrus Levy <levy.cyrus@gmail.com>

- Prev by Date:
**Re: st: margins** - Next by Date:
**Re: st: how does one automatically calculate the age in years by subtracting the system date from the date of birth?** - Previous by thread:
**st: Defining a matrix in ml program** - Next by thread:
**Re: st: Re: Defining a matrix in ml program** - Index(es):