create "indexes"

More
4 years 11 months ago - 4 years 11 months ago #86609 by adishardis
adishardis created the topic: create "indexes"
Hi,

I'm wondering if it's possible to have a field that autocalculates its value depending on previous answers of the respondent.

Maybe something lika a hidden question that just calculates the value. In spss I calculate it like this:

COMPUTE index1 = 0 .
EXECUTE .
DO IF (e5=1 or e15=1 or e15=2) .
COMPUTE
index1 = 1 .
END IF .
EXECUTE .

COMPUTE index2 = 0 .
EXECUTE .
DO IF (index1=1 and (e7=1 or e7=2 or e7=3)) .
COMPUTE
index2 = 1 .
END IF .
EXECUTE .

Sinceraly
Adam
Last Edit: 4 years 11 months ago by adishardis. Reason: unclear phrasing

Please Log in to join the conversation.

More
4 years 11 months ago - 4 years 11 months ago #86625 by TMSWhite
TMSWhite replied the topic: create "indexes"
I'm not well versed in SPSS syntax, but it looks like you're trying to do this:

index1:
{if(e5==1 or e15==1 or e15==2,1,0)}

index2:
{if(index1==1 and (e7==1 or e7==2 or e7==3),1,0)}

If so, create hidden Equation type questions for index1 and index2 and put the associated code in the question field. The values will be auto-updated as the user changes responses; and the resulting values will be stored to the database in variables index1 and index2.
Last Edit: 4 years 11 months ago by TMSWhite.

Please Log in to join the conversation.

More
4 years 11 months ago #86626 by adishardis
adishardis replied the topic: create "indexes"
Thank you, that seems to be exactly what i'm after!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now