Welcome to the LimeSurvey Community Forum

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

Code of "Other"

  • kevinleung
  • kevinleung's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 3 months ago #192405 by kevinleung
Code of "Other" was created by kevinleung
Hi All,
I added an Option 'Other' to the question.
When I output to the data file, the code is "-oth-"
When I do the SPSS analysis, I have to recode the data file.
Is it possible to change the default code? (e.g. 9999)
Thank you.
Kevin
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago - 4 years 3 months ago #192406 by Joffm
Replied by Joffm on topic Code of "Other"
Hi, Kevin,

When I output to the data file, the code is "-oth-"

I do not know which type of question and which versions of SPSS and LS you are using, I tested with
question type: list (radio)
SPSS: V21
LS: 3.21.1

And I got the following results:
  • Using alphanumerical codes ("A1", "A2",...) I got a variable of type "string" (or "A2") and the "other" is there as "-".
  • Using numerical codes ("1", "2",...) I got a variable of type "numerical" (or "F1") and the "other" is there as "SYSMIS".

An export of "-oth-" I could only reproduce when exporting to EXCEL.

What did you get after importing into SPSS?

Because you talked about code "9999" I assume you use numerical values.
If the question has to be answered always add to your SPSS syntax file
RECODE q2 (SYSMIS=9999).

I there is the option that your question is missing by other reasons (relevance, not mandatory) and you only want to recode the "other", add this
DO IF (CHAR.LENGTH(q2_other)>0).
RECODE q2 (SYSMIS=9999).
END IF.


Because in most cases you edit your syntax file to structure the data to your needs this is easy done.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 3 months ago by Joffm.
The topic has been locked.
  • kevinleung
  • kevinleung's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 3 months ago #192408 by kevinleung
Replied by kevinleung on topic Code of "Other"
Hi Joffm,
Thank you for the suggestion.
Yes, you are right, I get the code "-oth-" when I export to Excel.

Actually, I cannot export directly to SPSS directly, because some text question included comma, so .dat file does not working properly.
Every time, I have to export to Excel and then import to SPSS.

We can make the change by SPSS syntax, but it would be better if I can change the default setting of LS.
Thank you.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #192416 by Joffm
Replied by Joffm on topic Code of "Other"

because some text question included comma

The text in the *.dat file is quoted, isn't it.
So, what is the problem with comma?



But, even if you do it by EXCEL, it is a simple "Search and Replace".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • kevinleung
  • kevinleung's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 3 months ago #192426 by kevinleung
Replied by kevinleung on topic Code of "Other"
Hi Joffm,
Thanks for the suggestion.
I think it will be risky if I forgot put the syntax to fix the issue...
I can make the change by "Search and Replace" in Excel also, but this is manual work. And I am looking for automation if possible.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #192428 by Joffm
Replied by Joffm on topic Code of "Other"

I think it will be risky if I forgot put the syntax to fix the issue...

And? If you really forget, just enter it and run the syntax again. No problem.

I can make the change by "Search and Replace" in Excel also, but this is manual work. And I am looking for automation if possible.

You may create a macro.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
4 years 2 months ago #193021 by cgschenck
Replied by cgschenck on topic Code of "Other"
Hi Joffm,

"And I got the following results:
Using alphanumerical codes ("A1", "A2",...) I got a variable of type "string" (or "A2") and the "other" is there as "-".
Using numerical codes ("1", "2",...) I got a variable of type "numerical" (or "F1") and the "other" is there as "SYSMIS".

An export of "-oth-" I could only reproduce when exporting to EXCEL."


It seems like export to Excel and the import to SPSS is better as I wouldn't want my "other" responses to look like they are missing values. I am a new LS user and we are finalizing our first questionnaire design, so I wanted to check in this forum past experiences with exporting LS data to SPSS before launching our survey. This is a helpful discussion.

Catherine
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 2 months ago #193031 by Joffm
Replied by Joffm on topic Code of "Other"
Hi,
I do not see your problem.
In the meantime you will have checked by yourself what is exported to SPSS.

As you see, there are two columns for this single punch question with "other" option.
And if "other" is selected, you get a "SYSMIS" in the first column and the text in the second.
So it's easy to recode.
E.g.
DO IF (CHAR.LENGTH(q11_other)>0).
RECODE q11 (SYSMIS=999).
END IF.
EXECUTE.


You always have to adapt your SPSS syntax to your needs.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: cgschenck
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose