Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Import full answer labels into Stata not only the first letter

  • gdumarais
  • gdumarais's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago - 1 year 4 months ago #234153 by gdumarais
Hi,
I exported my survey data into Stata. However, in Stata, only the first letter of the Limesurvey value label of an answer option appears as the Stata answer label. For example, when I browse my data in the Stata Data Editor, I only see the first letter of the Limesurvey answer label, (and when I click on that letter, I see the numerical value of that answer option). What should I do to fully import the Limesurvey labels for answer options into Stata?

All my answer options were coded with a number. When I exported my data into xml Stata format, I chose "Question codes" and "Answer codes" for respectively the questions and the answers. 
Thank you very much in advance for you answer!

Your LimeSurvey version: Version 5.4.9
Own server or LimeSurvey hosting: Limesurvey hosting
Survey theme/template: Fruity
==================
(Write here your question/remark)
Last edit: 1 year 4 months ago by gdumarais.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #234172 by Joffm
Hi,
I can't reproduce this.



Everything as expected.

So, you should create a small sample where this issue is reproducable.
Send the lss export, and your stata xml of this survey (that contains the issue)

Joffm

And as you use the Cloud version you may contact LimeSurvey support directly.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: gdumarais

Please Log in to join the conversation.

  • gdumarais
  • gdumarais's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago - 1 year 4 months ago #235035 by gdumarais
Hi Joffm,

I am very grateful for your answer, as I was last time!! Thank you so much again.

Here is my survey (in lss format) and here are my data (in Stata format), I only dropped a few variables for confidentiality. As you can see for all variables, I only have the first letter of the label (for instance for sexe, I get F and M instead of “Féminin” and “Masculin”, the same goes for REG12 etc.) (link to download the files: transfer.pcloud.com/download.html?code=5...LQ79bwvdvMmhJp5Lm7X0 )

Another weird thing is that I don’t get the values of the LS variable in my Stata data, - I only get missing values everywhere-, even though I have values in the Limesurvey Statistic section. This variable enables to capture the ID of the survey company and I created it following exactly the advice in the survey manual ( manual.limesurvey.org/Panel_integration ). I don’t know if the two problems could be related?

By the way, my Limesurvey version has changed, it is actually 5.4.12 now. Also, I asked the question on YouTube and someone told me that he had heard about it somewhere else and it might be a LimeSurvey bug… :/

Thank you so much again for your answer

PS: I contacted Limesurvey several times, but unfortunately they took more than a week to answer for the first time and they waited another week to really read my question, even though I purchased the expert formula through the university, and I am launching my survey this coming week.
Last edit: 1 year 4 months ago by gdumarais.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #235442 by Joffm
Hi,
yes, it is reproducable.
So, file a bug report.

In my opinion the error is in file "STATAxmlWriter.php" line 632
$xml->text($aAnswer);

With this command answer labels of "multiple" questions are displayed correct
but others, like single or array questions are not
 

If you change this line to 
$xml->text($aAnswer); 
it is the other way
correct for single and array questions, not correct for multiple questions.


But, anyway,
you usually have to adapt the VARIABLE LABELS and VALUE LABELS.
Nobody wants to see these long labels (with included instructions for the respondent) in your analysis.
Like this:

(Nous rappelons qu'il n'est pas possible d’identifier personnellement vos réponses et que les données collectées sont utilisées uniquement pour réaliser des statistiques générales, représentatives de la population Française.)

À combien estimez-vous le patrimoine NET de votre ménage (en euros) ? Sont incluses ici toutes vos possessions (logement, voiture, épargne, etc.) nettes de dette.

Par exemple,  vous possédez une maison valant 250 000€, votre seul bien, et qu’il vous reste 100 000€ à rembourser sur votre crédit immobilier, votre patrimoine net s’élève à 150 000€. 

So, during the fieldwork, you may write a new Do file with your labels.
As many answer options are repeatedly used in many question you have only to define a few containers and add them to the questions.

I do not know Stata, but it's the same we always do in SPSS.

And of course you can export to Excel or *.csv and import into Stata. Again add the labels afterwards in a Do file.


Now some remarks:

There are some errors in your survey. Probably you renamed some questioons.
I remember your "I changed some things,..."
 

And there are some cumbersime ways you do it., like some conditions where there are only 5 options.
ChgtTxLinAvion == 1 or ChgtTxLinAvion == 2 or ChgtTxLinAvion == 4 or ChgtTxLinAvion == 5  -> ChgtTxLinAvion !=3
ChgtTxLinAvion == 3 or ChgtTxLinAvion == 4 or ChgtTxLinAvion == 5  -> ChgtTxLinAvion>2
ChgtTxLinAvion == 1 or ChgtTxLinAvion == 2  -> ChgtTxLinAvion<3

(((!is_empty(ChgtTxCaLin_ChgtTxCaCarbu.NAOK) && (ChgtTxCaLin_ChgtTxCaCarbu.NAOK == 1)) or (!is_empty(ChgtTxCaLin_ChgtTxCaCarbu.NAOK) && (ChgtTxCaLin_ChgtTxCaCarbu.NAOK == 2)) or (!is_empty(ChgtTxCaLin_ChgtTxCaCarbu.NAOK) && (ChgtTxCaLin_ChgtTxCaCarbu.NAOK == 4)) or (!is_empty(ChgtTxCaLin_ChgtTxCaCarbu.NAOK) && (ChgtTxCaLin_ChgtTxCaCarbu.NAOK == 5))))
!is_empty(ChgtTxCaLin_ChgtTxCaCarbu.NAOK) && ChgtTxCaLin_ChgtTxCaCarbu.NAOK!=3

Many more.

And I'd advise to create an equation to generate age classes instead of many alternative questions.(the whole age quoata group)
Only one equation "ageclass"
{if(age<18,0,if(age<25,1,if(age<35,2,if(age<50,3,if(age<65,4,5)))))}

And your quota definition changes from
from25to34      1     to      ageclass   2
from35to49      1     to      ageclass   3
as you did it in all your other quotas.

I did not see a quota on these "strictlyover74".  you can eiter use this equation or expand the ageclass equation to
{if(age<18,0,if(age<25,1,if(age<35,2,if(age<50,3,if(age<65,4,if(age<75,5,6))))))}
and enter both values (5 and 6) into your quota of respondents older than 64

Joffm

And, please do not provide a lss export with 163 questions.
We can't go through it only to have some data to export.

Always create a small sample survey where your problem is shown, reproducable.

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose