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

Plus d'informations
il y a 7 ans 2 mois #86486 par amoswagon
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!!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86511 par tfj
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
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86519 par amoswagon
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.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86521 par tfj
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
Les utilisateur(s) suivant ont remercié: amoswagon

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86522 par amoswagon
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!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86527 par tfj
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
Les utilisateur(s) suivant ont remercié: DenisChenu, amoswagon

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 7 ans 2 mois #86560 par Mazi
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
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!