The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » label of variables in DTA file
label of variables in DTA file [message #14915] Tue, 15 May 2018 07:02 Go to next message
alice.b
Messages: 3
Registered: January 2018
Location: Toulouse
Member
Dear Madam, Sir,

I am working with the DHS datasets (about domestic violence). I manage to download the different datasets by country (in DTA format). I see in the DTA files that the labels of the variables are present (like "date of interview", "region", etc just below the abbreviate variables. But when I open the file with the R command:

dta=read.dta(AFCR70FL.DTA, convert.factors = FALSE) or dta=read.dta(AFCR70FL.DTA, convert.factors = TRUE)

I can vizualize the dta file but the long name of the variables are not present anymore. Is there any way to retain the name of the different columns after opening the fiel?

Many thanks in advance for your help,

Alice




AB
Re: label of variables in DTA file [message #14927 is a reply to message #14915] Wed, 16 May 2018 12:56 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1485
Registered: February 2013
Senior Member
Following is a response from DHS Technical Specialist, Shireen Assaf:

Unfortunately R does not have a built in way to handle variable labels. I found an exchange on this question online that may help. The link has a few solutions you can try including some suggested packages.

https://stackoverflow.com/questions/2151147/using-stata-vari able-labels-in-r
Previous Topic: DHS recode manual in excel format?
Goto Forum:
  


Current Time: Sun Oct 21 17:46:42 Eastern Daylight Time 2018