How to create a calculated 'Age Ranges' question out of 'Age' numeric?

Mehr
5 Jahre 1 Monat her #86486 von amoswagon
amoswagon erstellte das Thema How to create a calculated 'Age Ranges' question out of 'Age' numeric?
Hopefully this is a simple question with a simple enough answer.
How to create a calculated 'Age Ranges' question out of 'Age' numeric?

I want a survey to include the following:

1: What is your age? _____ (numeric)
2: Age Range: (hidden)
-under 20
-21 to 40
- 41 to 60
- 61 or more

I want people's answers to question 1 to fall into the correct bucket of question 2 and be stored just as if I asked the question.

Thanks!!

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86511 von tfj
tfj antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
amoswagon:

I have put together a simple survey (attached) that may be what you are looking for. I based it upon the excellent example of the BMI calculation that tmswhite put together in his sample surveys that display how the Expression Manager works. (For example, you might look at the documentation under "Tailoring/Piping.")

I slightly changed your specifications to account for someone who is 20 years old, as you will see in the coding for the 2nd question.

tfj
Anhang:

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86519 von amoswagon
amoswagon antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
This is extremely helpful - thank you.
Is it possible to put the data in a single choice question with answer choices predefined?
In your example the data is stored as a Open text response, I'd like it to be stored with Answer codes as A1 (under 20) A2 (20-40) and so on...

I appreciate the efforts you put in your answer and example.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86521 von tfj
tfj antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
amoswagon:

I'm not sure that I have understood your requirement, but you could change the coding in the second question to this:

{if(Age <= 20, 'A1', if(Age < 41, 'A2',if(Age < 61, 'A3','A4')))}

and then hide the question, (in the Advanced settings).

tfj
Folgende Benutzer bedankten sich: amoswagon

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86522 von amoswagon
amoswagon antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
This is how you built it:
1) Age (numeric)
2) AgeRange*(Equation)

*The calculated ranges are stored in AgeRange question

This is how I want it:
1) Age (numeric)
2) AgeRange*(Equation)
3) AgeGroups (single choice- hidden) with the following options A1 (under 20) A2 (21-40) and so on...

Once a user enters his/her age, the data will be recorded in the AgeGroups question as if he/she answered the Single Choice question.

I want to save the data as a single choice, because it gives more flexibility in terms of charting and additional analysis in SPSS.

I hope I was more clear this time!
Thank!

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86527 von tfj
tfj antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
amoswagon:

Seems to me that the hidden equation question fulfills your requirement, when you change my original one to

{if(Age <= 20, 'A1', if(Age < 41, 'A2',if(Age < 61, 'A3','A4')))}

and make it hidden and not mandatory.

It puts "A1," "A2", "A3", or "A4" into a separate field, without asking the user. You can then export the table to SPSS.

I'm sure someone else will understand your requirement better than I have. I'm sorry I couldn't be of more help.

tfj
Folgende Benutzer bedankten sich: DenisChenu, amoswagon

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
5 Jahre 1 Monat her #86560 von Mazi
Mazi antwortete auf das Thema: How to create a calculated 'Age Ranges' question out of 'Age' numeric?
Great example, tjf. Can you please add it to docs.limesurvey.org/Expression+Manager+E...ples_for_Expressions and also attach your survey there for testing?

This would help other users a lot.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha