data in wide format


Author
Message
mongrel
mongrel
Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)Guru (5.7K reputation)
Group: Forum Members
Posts: 53, Visits: 147
Hey Dave,

you kindly did help me with the following script and I have one more question concerning the data file: Now, the data are saved in long format (see file attached). However, I would like them to be saved like that:
Collumns: subject, date, time, A_negpos, A1_negpos ... A_symp, A1_symp ..., values.sequence

How can I do that?

This is the script:

Slider*********************************************************************************

<slider negpos>
/ labels = ("negativ~n1", "~n2", "~n3", "~n4", "~n5", "~n6", "positiv~n7")
/ range = (1, 7)
/ slidersize = (50%, 5%)
/ showtooltips = false
/ position = (22%, 50%)
/ required = true
/ fontstyle = ("Arial", 26, false)
</slider>

<slider symp>
/ labels = ("unsympathisch~n1", "~n2", "~n3", "~n4", "~n5", "~n6", "sympathisch~n7")
/ range = (1, 7)
/ slidersize = (50%, 5%)
/ showtooltips = false
/ position = (19.5%, 75%)
/ required = true
/ fontstyle = ("Arial", 26, false)
</slider>

*****************************************************
<image A>
/ items = ("A.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image B>
/ items = ("B.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image A1>
/ items = ("A1.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image A2>
/ items = ("A2.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image A3>
/ items = ("A3.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image A4>
/ items = ("A4.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image B1>
/ items = ("B1.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image B2>
/ items = ("B2.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image B3>
/ items = ("B3.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<image B4>
/ items = ("B4.jpg")
/ position = (37%, 15%)
/ imagesize = (33%,33%)
</image>

<list items>
/ items = ("A","A1","A2","A3","A4","B","B1","B2","B3","B4")
/ selectionmode = random
/ replace = false
/ selectionrate = trial
</list>

<list pages>
/ items = (surveypage.A,surveypage.A1,surveypage.A2,surveypage.A3,surveypage.A4,surveypage.B,surveypage.B1,surveypage.B2,surveypage.B3,surveypage.B4)
/ selectionmode = list.items.currentindex
/ selectionrate = trial
</list>

<values>
/ item = ""
/ sequence = ""
/ valid_sequence = false
</values>

<trial sequence_generator>
/ ontrialbegin = [
  values.item = list.items.nextvalue;
  values.sequence = concat(concat(values.sequence, ","), values.item);
  list.mysequence.appenditem(list.pages.nextvalue);
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
</trial>

<trial sequence_checker>
/ ontrialbegin = [
  if (contains(values.sequence, "A,A1") || contains(values.sequence, "A1,A") || contains(values.sequence, "B,B1") || contains(values.sequence, "B1,B")) {
   values.valid_sequence = false;
  } else {
   values.valid_sequence = true;
  };
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
</trial>

<expt>
/ blocks = [1=generate_sequence; 2=run_sequence]
</expt>


<block generate_sequence>
/ onblockbegin = [
  values.item = "";
  values.sequence = "";
  list.items.reset():
  list.pages.reset();
  list.mysequence.reset();
]
/ trials = [1-10=sequence_generator; 11=sequence_checker]
/ branch = [
  if (!values.valid_sequence) block.generate_sequence;
]
</block>

<block run_sequence>
/ trials = [1-10 = list.mysequence]
</block>

<list mysequence>
/ selectionmode = sequence
</list>

<surveypage A>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=A; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage B>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=B; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage A1>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=A1; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage A2>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=A2; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage A3>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=A3; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage A4>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=A4; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage B1>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=B; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage B2>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=B1; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage B3>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=B2; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

<surveypage B4>
/ subcaption = "Wie wirkt diese Person auf Sie?"
/ subcaptionfontstyle = ("Arial", 2.5%, true, false, false, false, 5, 0)
/ showquestionnumbers = false
/ questions = [1=B4; 2=negpos; 3=symp]
/ finishlabel = "Weiter"
/ nextbuttonposition = (47, 95)
/ showbackbutton=false
/ showpagenumbers = false
/ branch = [trial.blank]
</surveypage>

*****************************************************
Blank between pages
*****************************************************
<trial blank>
/stimulusframes = [1 = blank]
/trialduration = 300
</trial>

<item blank>
/1 = "blank.png"
</item>

<picture blank>
/ items = blank
/ position = (37%, 15%)
</picture>

*****************************************************
*****************************************************
Seitendesign
*****************************************************

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ screencolor = white
/ txbgcolor = white
/ txcolor = black
/ halign = center
</defaults>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response correct latency values.sequence values.valid_sequence)
/ separatefiles = false
</data>


Thank you a lot!!!
R.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search