Syntax to determine the display order of randomized questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax to determine the display order of randomized questions

Colleen
Hello all-

I have ten variables in a survey data file representing questions that were
shown in a random order to respondents, and I want to analyze the data based
on the order in which they were displayed.  I have timestamp data (in
milliseconds) for each, and simply need to assign the number of the first
question shown to POS_1, the number of the second question shown to POS_2, etc.

My approach to POS_1 was to take the minimum of the 10 timestamp values and
assign the corresponding question number to POS_1, which was
straightforward. To do this for all of the position variables I would need
to take into account ALL of the previously determined positions, in order to
know which subset of timestamps to take the minimum value from.  I'm sure
there is a much easier way to accomplish this-- any suggestions would be
greatly appreciated!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Syntax to determine the display order of randomized questions

David Marso
Administrator
Hi Colleen,
See if this one floats your boat ;-)  Easier to just butcher the data and reorganize it rather than doing an inline sort of the data (however I did write such a beast a long time ago  and it's probably still around somewhere on the internet;-).
HTH, David
---
*simulate some data.
input program.
numeric ts01 to ts10 var01 to var10 .
loop caseid=1 to 1000.
do repeat ms=ts01 to ts10 / var=var01 to var10.
compute ms=uniform(86400*1000).
compute var = trunc(uniform(10)).
end repeat.
end case.
end loop.
end file.
end input program.



**Actual program .
VARSTOCASES   /MAKE ms FROM ts01 TO ts10  /MAKE var FROM var01 TO var10  /INDEX = Index1(10)  /KEEP =  caseid.
RANK ms BY caseid.
CASESTOVARS  /ID = caseid  /INDEX = index1  /GROUPBY = VARIABLE .  

---
Colleen wrote
Hello all-

I have ten variables in a survey data file representing questions that were
shown in a random order to respondents, and I want to analyze the data based
on the order in which they were displayed.  I have timestamp data (in
milliseconds) for each, and simply need to assign the number of the first
question shown to POS_1, the number of the second question shown to POS_2, etc.

My approach to POS_1 was to take the minimum of the 10 timestamp values and
assign the corresponding question number to POS_1, which was
straightforward. To do this for all of the position variables I would need
to take into account ALL of the previously determined positions, in order to
know which subset of timestamps to take the minimum value from.  I'm sure
there is a much easier way to accomplish this-- any suggestions would be
greatly appreciated!

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"