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" <uaquap@gnet.tn>
To   statalist@hsphsun2.harvard.edu
Subject   st: Two Mata questions
Date   Thu, 30 Mar 2006 01:32:54 +0100 (CET)

Hello,
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:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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