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]

st: importing data from matlab


From   László Sándor <sandorl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: importing data from matlab
Date   Tue, 18 Oct 2011 03:15:48 -0400

Hi,
I try to fix insheeting with Stata 12 on Unix a text file I saved with
Matlab, but something is off. Each line has 23 numbers for my 23
variables, and the file has 261000 lines, as my data set, but I still
have the error:
.     insheet `peervarsL1' using fileL1.txt,  clear nonames
too many variables specified
error in line 261001 of file
r(103);

My file starts like
. !head fileL1.txt

0.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00
0.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00
0.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00
0.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00
0.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00
0.0000000e+00   0.0000000e+00   0.0000000e+00

and ends without an end-of-line character, simply with the last zero.

The line number is:
. !wc fileL1.txt

  261000  6003000 96309000 fileL1.txt

The Matlab R2011b command read
save fileL1 vL1 -ASCII;

The Stata command tried to be
insheet `peervarsL1' using fileL1.txt,  clear nonames

I think I checked the relevant FAQ, and much of the web.

Thanks for any quick thoughts!

Laszlo
*
*   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