[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Questions about matrix operations
> -----Original Message-----
> From: Wolff [mailto:wolff@MAIL1.andrew.cmu.edu]
> Sent: Monday, June 17, 2002 3:37 PM
> To: email@example.com
> Subject: st: Questions about matrix operations
> Hey folks,
> I have a simple problem. I have a regression with three variables. I
> would like to create a new variable equal to the sum of the estimated
> coefficients times the variable values. The coefficients are saved in
> the matrix e(b). I would like to do something like newvar=e(b)'*[var1
> var2 var3]. Since e(b)' is 1X3 and the next matrix is 3X1, I
> thought it
> would generate a scalar. Is there an easy way to accomplish this?
See the -matrix score- command (help matscore).
Note that [var1 var2 var3] matrix is 3xN, not 3x1, so this will generate
a variable, not a scalar.
* For searches and help try: