Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: export data


From   Philip Ryan <[email protected]>
To   [email protected]
Subject   Re: st: Re: export data
Date   Sat, 14 Aug 2004 17:44:50 +0930

In addition to Rafa's suggestions, the -odbc- set of Stata commands will allow 
you to directly read data into memory from an Access table _within a Stata 
session_. You need to declare the Access database as an ODBC source using the 
Control Panel facility in your operating system - this is a once only 
manoeuvre, after that Stata will see the database and its component tables.

As an example, when you installed MS Access, most likely its "Northwind" 
example database was automatically declared as an ODBC source.  In Stata you 
could:

. clear
. odbc list                    /* see a directory of current sources */
. odbc query Northwind         /* see the tables defined in Northwind" */
. odbc load, table(Customers)  /* read data into memory */

see -help odbc-

Phil




Quoting "R.E. De Hoyos" <[email protected]>:

> Pedro,
> 
> You can use Stata/Transfer or you can save/export from Access to a .txt file
> and use the -insheet- command to import them to Stata.
> 
> When you -tsset- your data you are declaring that yours is a timeseries (or
> longitudinal type), therefore your panelid variable must appear just once in
> every cross section (e.g. every year). If you have two of more panelid
> values for the same time variable, then Stata won't be able to understand
> the structure of your data.
> 
> 
> Rafa
> 
> 
> ----- Original Message -----
> From: "Pedro Juan Garc�a Teruel" <[email protected]>
> To: "Statalist" <[email protected]>
> Sent: Friday, August 13, 2004 2:13 PM
> Subject: st: export data
> 
> 
> > Hello,
> > How can I export data from Microsoft Access to Stata?
> > Im working with a panel, and sometime, when I use copy and paste, and
> > write tsset I get the next text:
> > repeated time values within panel
> > r(451);
> >
> >
> >
> >
> > --
> >
> >
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> >
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 


-- 
Philip Ryan
Associate Professor
Department of Public Health

Associate Dean (IT)
Faculty of Health Sciences

Head, Data Management and Analysis Centre
Department of Public Health and Department of General Practice

University of Adelaide
5005 South Australia
AUSTRALIA
CRICOS Provider Number 00123M
----------------------------------------------------------- 
This email message is intended only for the addressee(s) 
and contains information that may be confidential and/or 
copyright.  If you are not the intended recipient please 
notify the sender by reply email and immediately delete 
this email. Use, disclosure or reproduction of this email 
by anyone other than the intended recipient(s) is strictly 
prohibited. No representation is made that this email or 
any attachments are free of viruses. Virus scanning is 
recommended and is the responsibility of the recipient.
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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