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: reference to a single row of a stata matrix


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: reference to a single row of a stata matrix
Date   Sun, 2 Feb 2014 09:58:53 +0100

It is not a bug. The problem is your way of selecting "all collumns".
The correct syntax reads -aux[1,1...]-, which is interpreted as "the
first row and columns 1 till last". The first two dots are interpreted
as "till" and the last dot is interpreted as "last". This is
documented in -help matrix extraction-.

Hope this helps,
Maarten

On Sun, Feb 2, 2014 at 5:58 AM, László Sándor <[email protected]> wrote:
> Hi,
>
> I might be missing a feature in my StataMP 13 for mac, or I encountered a bug.
>
> I was using putexcel for the first time, and following the examples I
> had lines like these:
>
> reg y x1 x2
> matrix aux = r(table)
> matrix aux = aux[1,.]
> putexcel A1=matrix(aux) using test.xlsx, sheet("Sheet1") modify
>
> But this leaves the sheet blank, as aux becomes a 1x1 matrix of
> missing values after the third line.
>
> However, simply using
> matrix aux = aux[1..1,.]
> solves the problem.
>
> I am not very familiar with Stata matrices, but if it's not only me,
> perhaps it was worth pointing out.
>
> Thanks,
>
> Laszlo
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



-- 
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------

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


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