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]

Re: st: list x matrix


From   richard boylan <richardtb25@gmail.com>
To   statalist@hsphsun2.harvard.edu
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
<scott.merryman@gmail.com> wrote:
> On Sat, Mar 27, 2010 at 3:56 PM, richard boylan <richardtb25@gmail.com> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index