Hi,
I am new to Stata programming so I have a problem to translate the following
line of mathlab code into Stata code.
lambda(z==0) = - normpdf(X(z==0,:)*gamma)
Here lambda is an (nx1) matrix, X is (nxk), gamma is (kx1), z is (nx1), and
for example X(z==0) denotes subset of the matrix X for which (z==1), i.e.
the condition in parenthesis holds true.
In Stata, how can I access this subset of my X matrix? It should be
something like:
matrix lambda = -normde(X[if z==1]*gamma)
but I can't Stata to access the matrix subsets as I need it. Thanks for your
help.
Best,
Jens
*
* 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/