Option to export with variable/value labels from other languages

Use cases: Increasingly, for the surveys in which I’m involved, CAPI questionnaires have multiple languages: typically English as the main language and local language(s) as translations. In many of those same cases, the end user wants to export data such that variables have the variable and value labels of the non-English languages. This can be for several reasons:

  • Local survey monitoring needs non-English language.
  • Data dissemination needs to be done in both English and non-English languages.

Implementation ideas:

Add a selector on the export screen (and property in the API request) to select the language of variable and value labels.

Work-arounds:

The messy work-arounds I’ve seen are:

  • Export with English labels and hope that local survey management works somehow
  • Draft the question text in the local language, and then use variable and value label definitions from earlier efforts for adding English labels (e.g., take CSPro outputs, change variable names, revise and repeat until useable, etc.)

These are a shame since the metadata describing variables and values are contained in the Designer questionnaire in the translation file.

2 Likes

This would be a fantastic feature.

An option on the Tabular export would be to have separate *.do files for each of the languages that have labels in the survey.

I’ll again add a bump for the Add Data Export Type 'Tabular With Labels' because a language selector option in the export would work really well with exporting tabular with labels rather than values in multilingual surveys.

1 Like

Rather than curse the darkness, I decided to light a candle. While digesting turkey, I wrote a two R functions that extract information from the translation file, and create Stata .do files for applying that information to Stata data. One function, trans_var_lbls, extracts question text for variable labels, and creates a Stata .do file for applying those labels. Another function, trans_val_lbls, extracts option text and values, and creates a Stata .do file for applying them.

Here are some notes on use:

  • Download the translation file from Designer
  • Execute the R functions
  • Open Stata .dta file
  • Run Stata .do files to apply variable and value labels, respectively
  • Repeat the last two steps for each export file (since these functions each create one Stata file for all variables in all export files)
# define file folder and file
fileDir <- "C:/My/File/Folder/"
excelFile <- "translation_file.xlsx"

# take data from the Excel translation file to create a .do file named varlabels.do
trans_var_lbls(
	input_path = paste0(fileDir, excelFile), 		# where Excel file is located
	output_path = paste0(fileDir, "varlabels.do")) 	# where Stata file will be created

# take data from the Excel translation file to create a .do file named val_labels.do
trans_val_lbls(
	input_path = paste0(fileDir, excelFile), 		# where Excel file is located
	output_path = paste0(fileDir, "val_labels.do"), # where Stata file will be created
	label_prefix = "kh") 							# prefix that might help user
													# distinguish between multiple languages
													# (eg, en, fr, kh, etc.)

Here are the functions in maturing repository. If issues are found, please post them on the repository here. Meanwhile, I’ll try to find time to do some work on:

  • Testing with other input files
  • Add code to check that inputs meet the program’s expectations
  • Attempt to find and use labels in the translation file if they exist (rather than default to question text)
  • Add methods for ingesting long answer sets in tabs with @@_ prefix (issue here)
4 Likes

I’m my country we’re using two languages, French and Creole. So, all questionnaire are bilingual. So, in CSPro when i want to export in whatever language, define the language usin the setlanguage function: https://www.csprousers.org/help/CSPro/setlanguage_function.html
And, all are fine, SPSS, STATA, R etc labels (questions and variable) are exported according to the defined language. Please can we have similar function in Survey Solutions?

Please let’s know,

This will be a feature for the development team to consider–both how big of a priority it is and how to implement it.

For my part, I have personally come around to viewing this as more of a priority based on current project needs. Initially, I was supporting projects where interviews were in a single language in CAPI. Now, I am more often supporting multi-country survey projects where the core questionnaire is created in English, and then translated into local languages in the implementing countries (via Survey Solutions’ translation feature). Additionally, I have seen more and more projects that have a similar set-up.

Could others jump in and say whether they see this potential feature as a priority or not–and if so, why?

Hello @arthurshaw2002 , I also was curious to see if an export of variable names with labels was a possibility. The reason is that when we extract the code internally for out systems we want to reflect the question comments with the label in another system. having hundreds of variables in a survey makes it particularly tedious in manually entering the labels in external systems.

@jsmallhorn , let me give a two-part answer.

First part, for the proposed Survey Solutions feature, my expectation is that one would export (Stata) data with variable and value labels from the selected translation (i.e., “original” plus any other translations). The questionnaire metadata already exists in Survey Solutions, and applying it to export data should be a matter of creating labels based on that metadata.

Second part, for the R functions linked above, there are two R functions: one for creating variable labels; another for creating value labels. The result is one step away from what this feature request proposes. The R functions create Stata .do files that apply variable and value labels extracted from the translation file.

Could you say more about your needs? Would the proposed Survey Solution feature meet your needs? Or do you need something different for your systems?