Millisecond Forums

Organising survey data into single rows per subject when executed from a block element

https://forums.millisecond.com/Topic12289.aspx

By Marcel - 2/9/2014


Following on from my venture into experimenting with using Inquisit to present some survey data this post.

I wonder if there may be a way to set up this task to store the data in a single row for each subject after having used a block element.

A simplified example:

<block demographics>
/trials = [1=demographics1]
</block>

<surveypage demographics1>
/ caption = "Please answer the following demographic questions"
/ fontstyle = ("Verdana", -16, true, false, false, false, 5, 0)
/ questions = [1=sex; 2=age] 
</surveypage>

<dropdown sex>
/ caption = "Sex"
/ options = ("female", "male")
</dropdown>

<textbox age>
/ caption = "Age"
/ mask = positiveinteger
/ range = (7, 110)
</textbox>

I wonder if there is a way to write a data element (or similar) that will do as described above?

<data>
/ columns = [subject, dropdown.sex.response, textbox.age.response]
/file = "responses.iqdat"
</data>


Thank you

Marcel
By Dave - 2/9/2014

If you want a single-line data file for survey data, why don't you use the <survey> element? A <survey> element is a special type of <block> and can be run via the <expt> element's /blocks attribute.

Note, though, that you *don't* want to use <survey> elements if you happen to repeat some <surveypage> elements or question elements over an over. How could that be captured in a single line file? Single-line survey data provides *one column per question*, thus different responses to repeated instances of a given question element simply cannot be captured that way.

Instead, you need to re-structure / aggregate your data using your preferred data management / statistical analysis application. All of them provide facilities to do so -- such data preparation it is a routine task in the course of most computerized data collection and research.

Edited to add: Example for the above -- observe the differences between the 3 resulting data files and how they correspond to the respective <survey>s vs. <block> setup.

<expt myexpt>
/ blocks = [1=mysurvey1; 2=mysurvey2; 3=myblock]
</expt>

<survey mysurvey1>
/ pages = [1-2=mypage1]
</survey>

<survey mysurvey2>
/ pages = [1=mypage1; 2=mypage2]
</survey>

<block myblock>
/ trials = [1-2=mypage1]
</block>

<surveypage mypage1>
/ questions = [1=myrb]
</surveypage>

<surveypage mypage2>
/ questions = [1=myrb]
</surveypage>

<radiobuttons myrb>
/ options = ("A", "B", "C", "D", "E", "F")
</radiobuttons>