Thanks Daniel, that was the problem. It works with local macros.
Tom
On 10/15/07, Daniel Waxman <[email protected]> wrote:
> I'm no matrix expert, but there is a logical problem here.
>
> You define x and y as variables and they can take on a different value for
> each observation (although you are giving them the same value for each
> observation in your example).
>
> so it is unclear which values of x and y your matrix command would use.
>
> . display x
>
> Gives you the value of x in the first observation (although it is unclear to
> me why Stata lets you do this).
>
> Perhaps what you need are local macros?
>
> . local x 1
> . local y 1
> . matrix byvar = (`x',`y')
>
>
> Daniel
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.11/1071 - Release Date: 10/15/2007
> 6:48 AM
>
>
> *
> * 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/
>
--
Thomas Jacobs
*
* 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/