Bookmark and Share

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

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

st: reference to a single row of a stata matrix

From   László Sándor <>
Subject   st: reference to a single row of a stata matrix
Date   Sun, 2 Feb 2014 05:58:14 +0100


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.


*   For searches and help try:

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