View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
09039Bug reportsPluginspublic2014-06-18 16:40
Reporterjboogie21 Assigned Tomfaber  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09039: exporting to STATA (.xml) format not working properly
Description

I'm trying to export survey results to STATA (.xml). The plugin does not keep the token fields as variable names. That is, <type varname=""> is blank. The token field name should go between the quotes.

Also it is supposed to export the responses as answer codes. For me it is exporting the actual response. So it's saying "Strongly Agree", "Agree", etc. rather than the code 1, 2, 3, etc.

Steps To Reproduce
  1. Export results to application
  2. Select STATA (.xml)
  3. View XML file with issues outline above
Additional Information

STATA version 12. However, you can see the missing and incorrect info in the XML file before STATA.

TagsNo tags attached.
Attached Files
STATAxmlWriter.php (29,768 bytes)
Bug heat6
Complete LimeSurvey version number (& build)140422
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5.0.95
Server OS (if known)RHEL 6
Webserver software & version (if known)Apache 2.2.3-83
PHP Version5.3.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

mfaber

mfaber

2014-05-17 04:24

reporter   ~29975

jboogie21, can you please attach a short sample survey that has the issue with the missing/wrong labels?

jboogie21

jboogie21

2014-05-19 15:01

reporter   ~29982

I just uploaded an archive file with sample data.

mfaber

mfaber

2014-05-19 21:03

reporter   ~29984

Jboogie21: STATA only uses value labels on numerical variables. If the answer codes are not numerical the plugin exports the full text-answer.
In your test survey, just replace the answer value (A1, A2, A3,...) with (1, 2, 3,...) and you'll get the value labels in the export.

c_schmitz

c_schmitz

2014-05-20 12:55

administrator   ~29993

mfaber, can you please add an according hint to the documentation and maybe let the Stata export try a decent conversion of the answer code to a number (A1 -> 1)

jboogie21

jboogie21

2014-05-20 16:14

reporter   ~30012

mfaber: That makes sense. As c_schmitz suggested, I think a statement in the documentation would be very helpful.

Related to my other question, do you know why the token name fields are not maintaining when exporting to STATA?

mfaber

mfaber

2014-05-20 23:08

reporter   ~30014

I added a note regarding value labels in the wiki. Reluctant to change the plugin in a way that it changes the underlying answer codes during export. Feels like tampering with the data to me. If someone wants to have a properly labelled data set, it's easy to use numerical answer codes.

About the token name fields: I never used them myself so I might have just overlooked these fields while developing the plugin. Will try to come up with a fix in the next few days. Thanks for reporting this issue!

mfaber

mfaber

2014-05-23 18:03

reporter   ~30016

jboogie: I attached a new version of the stata_writer plugin. If you can, please copy the file to application\core\plugins\ExportSTATAxml\ in your limesurvey installation directory. Please give me feedback if the additional token fields are exported ok then.
Thanks!

mfaber

mfaber

2014-05-26 21:09

reporter   ~30023

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=14226

jboogie21

jboogie21

2014-05-30 17:01

reporter   ~30038

It works as expected. This is exciting!

c_schmitz

c_schmitz

2014-06-18 16:40

administrator   ~30176

LimeSurvey 2.05+ Build 140618 released.

Related Changesets

LimeSurvey: master 4578772a

2014-05-26 19:02:44

mfaber


Committer: mfaber Details Diff
Fixed issue 09039: Custom tokenfields missing in Stata-xml export Affected Issues
09039
mod - application/core/plugins/ExportSTATAxml/STATAxmlWriter.php Diff File

Issue History

Date Modified Username Field Change
2014-05-16 23:06 jboogie21 New Issue
2014-05-17 04:20 mfaber Assigned To => mfaber
2014-05-17 04:20 mfaber Status new => assigned
2014-05-17 04:24 mfaber Note Added: 29975
2014-05-19 15:00 jboogie21 File Added: survey_archive_975791.lsa
2014-05-19 15:01 jboogie21 Note Added: 29982
2014-05-19 21:03 mfaber Note Added: 29984
2014-05-20 12:55 c_schmitz Note Added: 29993
2014-05-20 16:14 jboogie21 Note Added: 30012
2014-05-20 23:08 mfaber Note Added: 30014
2014-05-23 17:59 mfaber File Added: STATAxmlWriter.php
2014-05-23 18:03 mfaber Note Added: 30016
2014-05-23 18:04 mfaber Status assigned => feedback
2014-05-26 21:09 mfaber Changeset attached => LimeSurvey master 4578772a
2014-05-26 21:09 mfaber Note Added: 30023
2014-05-26 21:09 mfaber Resolution open => fixed
2014-05-26 21:10 mfaber Status feedback => resolved
2014-05-26 21:10 mfaber Fixed in Version => 2.05+
2014-05-30 17:01 jboogie21 Note Added: 30038
2014-06-18 16:40 c_schmitz Note Added: 30176
2014-06-18 16:40 c_schmitz Status resolved => closed