Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Two Mata questions

From   "U.A.QU.AP" <>
Subject   st: Two Mata questions
Date   Thu, 30 Mar 2006 01:32:54 +0100 (CET)

I have 2 questions about matrix manipulation on my unbalanced
panel data sets:
with my old Stata matrix language I can create a sequence of
matrix by typing for exemple
local wave=1
while `wave'<22 {
matrix accum A`wave' = x1 x2 ..xk if t==`wave', noconstant
local wave=`wave' +1
How can i performs a similar task with Mata?
I don't seek for a complex way to things but in fact i would
like to write a more complex expression wich looks like:
for each time period t the matrix
A_{t} = sum_{i=1 to n} (s1_it * s2_it  x_it' * x_it)

where , s1_it  is a  scalar =norm(xb)  and
 s2_it= normden(xb)
scalars s1_it and s2_it comes froma previeous probit estimation
any help?
AbdelRahmen El Lahga
*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index