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]

Re: st: list x matrix


From   richard boylan <[email protected]>
To   [email protected]
Subject   Re: st: list x matrix
Date   Sat, 27 Mar 2010 19:43:34 -0500

I understand, but it cumbersome.  It seems to me that there should be
a way of doing this without specifying the sum.

Incidentally, the other suggestion - to put in a matrix - is a bit
problematic if there are many observations (i.e., may lead to a matrix
that is too big for STATA).

On Sat, Mar 27, 2010 at 6:30 PM, Scott Merryman
<[email protected]> wrote:
> On Sat, Mar 27, 2010 at 3:56 PM, richard boylan <[email protected]> wrote:
>> I had thought of doing that, but was wondering if there was a more
>> direct way of doing that.
>
> You could reference the matrix cells in a -gen- statement:
>
> . sysuse auto
> (1978 Automobile Data)
>
> . matrix b  = 1 ,2,3
>
> . gen z = b[1,1] + mpg*b[1,2] + price*b[1,3]
>
> Scott
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

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


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