Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Converting a vetor into a matrix

From   André Gyllenram <>
To   <>
Subject   st: Converting a vetor into a matrix
Date   Mon, 24 Sep 2012 14:20:46 +0200


I have read that in mata you can use rowshape or colshape to convert a vector into a matrix. But it does not seem to work for me. If I have a 9x1 vector and want to convert it to a 3*3 matrix how do I do that?

If A is the 9x1 vector and I write:

rowshape(A,3) i get this message:

"rowshape():  3103  view found where array required
                 <istmt>:     -  function returned error"

Sorry if this has been asked before but i could not find it.

Kind regards
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index