Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: concatenating column vectors


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: concatenating column vectors
Date   Fri, 30 Dec 2011 07:48:48 +0000

Show us the code you tried that produced an error.

Nick

On Fri, Dec 30, 2011 at 7:31 AM, Jason Park <[email protected]> wrote:
> I want to calculate something for each column and concatenate them
> into a matrix.
> For a 3x3 matrix, for example, it can be done as follows:
> matrix Q=uu`i'         /* this is directly from the code I'm using, In
> fact, I'm trying to modify a code provided by an individual*/
> matrix Z=vecdiag(Q)
> matrix P=(Q[1...,1]/Z[1,1],Q[1...,2]/Z[1,2],Q[1...,3]/Z[1,3])
> And I want to generalized this to NxN case, with and without using a
> loop both (since it looks like the use of a loop conflicts with some
> other part of the code, hence generates an error).
> How can this be done? Please advise.
>
> Many thanks,
> Jason
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index