| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Using scalars when defining matrices
If you use tempnames, then you don't need to use the scalar() function
because the name will be unique and you should only place single quotes
around macro names (like beta, which is created by tempname).
Also, you should drop the "input" and you need to put a space after the \ to
prevent a problem with macro expansion (the \ prevents macro expansion)
matrix `BigMat'=(1,`beta' \ `beta',`beta')
should work.
Michael Blasnik
----- Original Message -----
From: "Rachel" <[email protected]>
To: <[email protected]>
Sent: Friday, December 08, 2006 10:17 AM
Subject: Re: st: Using scalars when defining matrices
<snip>
1:arg {other vars} abc
2: tempname beta BigMat
3 scalar `beta'=exp(`abc')
4 matrix input `BigMat'=(1,`scalar(beta)'\`scalar(beta)',`scalar(beta)')
*
* 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/