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 on April 23, 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   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: list x matrix
Date   Sat, 27 Mar 2010 18:30:33 -0500

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index