Statalist


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

RE: st: tips on reading large matrix from ASCII file?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: tips on reading large matrix from ASCII file?
Date   Tue, 2 Dec 2008 20:55:22 -0000

That's precisely why Jeph used -matrix input- not -matrix-, I presume. 

Nick 
[email protected] 

Stas Kolenikov

As for your code, check to see what exactly

mat A = (3 -5)
mat li A

produces. Not quite what you expected; you'd need to put commas
between the matrix values.

On 12/2/08, Jeph Herrin <[email protected]> wrote:

>  I used -file- to read the ASCII file a line at a time
>  and write out a -do- file which contained the necessary
>  lines to -matrix input- the values. 

< snip > 

>  #delimit ;
>  matrix input b = (
>  -1.9488158      -0.0874626       0.1785559       0.0304908 -0.0104287
> -0.0703224      -0.1402648      -0.1590217 -0.1926564      -0.3406200
> -0.4178385       0.0257852 -0.0065606       0.0570689      -0.0954522
> 0.1280117 0.0992062       0.0927456       0.0836843       0.0516530
> 0.0455983       0.0205244      -0.0223471      -0.0603116 -0.0759259
> -0.0762618      -0.0953297      -0.1421571 -0.1698843       0.3499212
> 0.2285282       0.2955863 0.0175301       0.7239078       0.2099990
> 0.2993378 0.3490949       1.0163712       0.2478369       0.3167427
> -0.3050866      -0.2854428       1.6223277      -0.0351432 0.1986832
> 0.2789393       0.2540214      -0.0226724 -0.2104767      -0.0402748
> 0.0700727       0.0355059 0.0453931      -0.2231259       0.0576488
> 0.0559482 0.1819322       0.4569752       0.4768460       1.7106584
>  2.3341741       2.0369928      -0.0271400       0.0421754
-0.0549200
>  ) ;

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index