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

st: Transfer of value labels: SQL data to Stata

From   "Lopman, Benjamin A" <[email protected]>
To   <[email protected]>
Subject   st: Transfer of value labels: SQL data to Stata
Date   Tue, 25 Jan 2005 15:48:14 -0000

Hello - 

I've got a question about getting data from our database into Stata for
analysis.  Perhaps one of you has gone through a similar process.

Transferring the data itself is of course no problem through an ODBC
connection.  The problem is handling the value labels.  (The variable
labels are also tricky but not such a major issue).  The problem is
mainly with the categorical variables and is as follows:

In Access (or any other database, as far as I am aware) the labels are
stored in a separate table.  For example, 1 and 2 are stored in a data
table and the  corresponding Male and Female labels are stored in a
second "lookup" table.  That is not how Stata or SPSS stores labels, so
when the data is brought back into one of those packages, the value
labels are lost.  I want to retain the numerical data and retain the
labels.  I am concerned about this because the dataset is so large  that
I don't want to have difficult to interpret  numerical data when the
data is shared with other analysts.

Stat Transfer does not seem to handle value labels converting to/from
database files.  

Has anyone overcome this problem?  Is there a script to properly carry
the value labels into the stats package?

Thanks in advance,

Ben Lopman

Department of Infectious Disease Epidemiology
Imperial College London
St Mary's Campus
Norfolk Place
London W2 1PG
Tel: 020 7594 3631
Fax: 020 7594 3282

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index