Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Miguel Angel Duran" <maduran@uma.es> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: Problems imputting data |
Date | Wed, 8 May 2013 14:01:08 +0200 |
Thanks all for your help. I think that I solved the problem. The problem seems to be, indeed, in the Excel files. -----Mensaje original----- De: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] En nombre de Nick Cox Enviado el: miércoles, 08 de mayo de 2013 11:24 Para: statalist@hsphsun2.harvard.edu Asunto: Re: st: Problems imputting data Almost certainly the problem lies in your Excel files. Many Excel users mix numeric and text cells in the same column and Stata has only limited scope for dealing with that. In essence, you already know that, but there is no magic fix. An old FAQ may still be relevant: http://www.stata.com/support/faqs/data-management/converting-excel-files/ Nick njcoxstata@gmail.com On 8 May 2013 09:28, Miguel Angel Duran <maduran@uma.es> wrote: > Thanks, Phil and Reut, for your help. Nevertheless, my version is > Stata 10, so although -import excel- does not seem to be available. I > have also tried to save the Excel file as a .csv file (comma > delimited); then, -insheet- just recognizes one variable (ie, all the variables are put together). > > By the way, I am trying to import about 20 files. Some of them have > been imported without problems. In other cases, I have been able to > import some observations up to a certain number and then copy+paste > the rest. In other cases copy+paste does not work, or the observations > not imported are not the last ones. > > Thank you in advance again. > > Miguel. > > -----Mensaje original----- > De: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] En nombre de Phil Schumm > Enviado el: martes, 07 de mayo de 2013 16:21 > Para: statalist@hsphsun2.harvard.edu > Asunto: Re: st: Problems imputting data > > On May 7, 2013, at 7:08 AM, Miguel Angel Duran wrote: >> Hi, Statalisters. I am trying to import data into Stata. I have used >> two > methods. First, I have tried to import from a .txt file using -insheet-. > Second, I have tried to copy and paste from an Excel file on the data > editor. Nevertheless, in both cases, although the original file has > 8303 observations, Stata just gets about a third of them (and not the > first third). Using the second method Stata informs me that "You > attempted to paste one or more string values into numeric variables. > The contents of these cells, if any, are unchanged". >> >> Will anyone please help me to know what is going on and how I can >> solve > this? > > > Assuming you are using Stata 12, you should use the -import excel- command. > Not only is this easier, but it will avoid some of the problems you > can encounter with the methods you describe above. Try that first, > and if you are still having problems, let us know. > > > -- Phil > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/