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: Creating a matrix from an excel table


From   [email protected] (Brendan Halpin)
To   [email protected]
Subject   Re: st: Creating a matrix from an excel table
Date   Fri, 01 Apr 2011 09:45:37 +0100

On Fri, Apr 01 2011, Diego Canales wrote:

> Does anyone know how could I import my data as a matrix into Stata, or
> Mata I guess? I'm aware that I am constrained with the matrix size (I
> have Stata SE, so 11,000 matrix maximum), so I'm planning on deleting
> observations that are above a certain threshold and come up with a
> smaller matrix.

Here's a starting point:


+-------------------------------------------------------------------
|input group latj lonj
|1	56	298.5816873
|1	55	466.3318352
|1	2	537.7437382
|1	3	736.950696
|1	58	761.8313998
|1	141	820.9843873
|1	57	832.6894503
|1	13	893.208735
|1	135	896.4010734
|end
|
|sort group
|
|save /tmp/other, replace
|
|rename latj lati
|rename lonj loni
|
|joinby group using /tmp/other
+-------------------------------------------------------------------


Brendan
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-009 x 3147
mailto:[email protected]  http://www.ul.ie/sociology/brendan.halpin.html
*
*   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