[email protected]
>
> I have a 2*1 matrix and wish to produce another matrix
> containing simply the square root values of this matrix.
mat b = J(2,1,1)
forval i = 1/2 {
mat b[`i',1] = sqrt(a[`i',1])
}
What you put in b[,] initially is arbitrary as each element
is overwritten.
The general principle is exactly that explained in the FAQ referred to
yesterday:
How do I perform element-by-element operations on matrices?
http://www.stata.com/support/faqs/data/matrix.html
Nick
[email protected]
*
* 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/