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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Creating a matrix from an excel table


From   brendan.halpin@ul.ie (Brendan Halpin)
To   statalist@hsphsun2.harvard.edu
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:brendan.halpin@ul.ie  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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index