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]

st: list x matrix


From   richard boylan <richardtb25@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: list x matrix
Date   Sat, 27 Mar 2010 14:49:59 -0500

Very simple question, but I couldn't find the answer in the STATA documentation.

I have a list
local var "x1 x2 x3 ...."

and a 1 x n matrix (vector)

b = (b1 b2 b3 ..)

How do I compute the new variable

z = b1*x1 + b2*x2 + b3*x3  + ...

I mean I know how to do that by writing the sum, there just has to be
a better way of doing this.

Also, what it is the best place to figure out this stuff?

Thanks.

Richard
*
*   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