Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
Hi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file.
|
|
|
Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437
|
|
|
Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block>
|
|
|
Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
+x+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> Hi Dave, thank you for your help. Same script. I was trying to give some feedback by assigning points to how early the response as made before values.b_onset, and I found it was impossible to calculate directly on values.b_onset. Do you have new ideas? / ontrialend = [if(trial.mytriala.latency<=values.b_onset/10){ values.points+=10}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/9){ values.points+=20}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/8){ values.points+=30}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/7){ values.points+=40}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/6){ values.points+=50}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/5){ values.points+=60}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/4){ values.points+=70}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/3){ values.points+=80}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){ values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){ values.points+=100}] Best,
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> Hi Dave, thank you for your help. Same script. I was trying to give some feedback by assigning points to how early the response as made before values.b_onset, and I found it was impossible to calculate directly on values.b_onset. Do you have new ideas? / ontrialend = [if(trial.mytriala.latency<=values.b_onset/10){ values.points+=10}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/9){ values.points+=20}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/8){ values.points+=30}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/7){ values.points+=40}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/6){ values.points+=50}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/5){ values.points+=60}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/4){ values.points+=70}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/3){ values.points+=80}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){ values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){ values.points+=100}] Best, It's perfectly possible to calculate on values.b_onset. See for yourself: <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 / points = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames / branch = [ trial.showfeedback ] </trial> <trial showfeedback> / stimulusframes = [1=pointsinfo] / validresponse = (57) </trial> <text pointsinfo> / items = ("B Onset: <%values.b_onset%> | Latency: <%trial.mytriala.latency%> | Points: <%values.points%>") </text> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> I*m not sure I correctly understand your point / award system, though. / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] If latency is smaller than half the onset value (awarding 90 points), it is *by necessity* / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] also smaller than the whole onset value (awarding 100 points), hence you're awarding 190 points total. This of course extends to all the other, smaller fractions as well (onset divided by 3, by 4, and so forth). Is that intended?
|
|
|
Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
+x+x+x+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> Hi Dave, thank you for your help. Same script. I was trying to give some feedback by assigning points to how early the response as made before values.b_onset, and I found it was impossible to calculate directly on values.b_onset. Do you have new ideas? / ontrialend = [if(trial.mytriala.latency<=values.b_onset/10){ values.points+=10}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/9){ values.points+=20}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/8){ values.points+=30}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/7){ values.points+=40}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/6){ values.points+=50}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/5){ values.points+=60}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/4){ values.points+=70}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/3){ values.points+=80}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){ values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){ values.points+=100}] Best, It's perfectly possible to calculate on values.b_onset. See for yourself: <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 / points = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames / branch = [ trial.showfeedback ] </trial> <trial showfeedback> / stimulusframes = [1=pointsinfo] / validresponse = (57) </trial> <text pointsinfo> / items = ("B Onset: <%values.b_onset%> | Latency: <%trial.mytriala.latency%> | Points: <%values.points%>") </text> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> I*m not sure I correctly understand your point / award system, though. / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] If latency is smaller than half the onset value (awarding 90 points), it is *by necessity* / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] also smaller than the whole onset value (awarding 100 points), hence you're awarding 190 points total. This of course extends to all the other, smaller fractions as well (onset divided by 3, by 4, and so forth). Is that intended? Yes, it was. Thank you for your advice. Would you help me with another question? I wish to arbitrarily add 100ms delays on the "latency" as soon as the space key is pressed, so the latency with delays becomes the final latency for that trial. Best,
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> Hi Dave, thank you for your help. Same script. I was trying to give some feedback by assigning points to how early the response as made before values.b_onset, and I found it was impossible to calculate directly on values.b_onset. Do you have new ideas? / ontrialend = [if(trial.mytriala.latency<=values.b_onset/10){ values.points+=10}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/9){ values.points+=20}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/8){ values.points+=30}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/7){ values.points+=40}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/6){ values.points+=50}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/5){ values.points+=60}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/4){ values.points+=70}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/3){ values.points+=80}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){ values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){ values.points+=100}] Best, It's perfectly possible to calculate on values.b_onset. See for yourself: <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 / points = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames / branch = [ trial.showfeedback ] </trial> <trial showfeedback> / stimulusframes = [1=pointsinfo] / validresponse = (57) </trial> <text pointsinfo> / items = ("B Onset: <%values.b_onset%> | Latency: <%trial.mytriala.latency%> | Points: <%values.points%>") </text> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> I*m not sure I correctly understand your point / award system, though. / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] If latency is smaller than half the onset value (awarding 90 points), it is *by necessity* / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] also smaller than the whole onset value (awarding 100 points), hence you're awarding 190 points total. This of course extends to all the other, smaller fractions as well (onset divided by 3, by 4, and so forth). Is that intended? Yes, it was. Thank you for your advice. Would you help me with another question? I wish to arbitrarily add 100ms delays on the "latency" as soon as the space key is pressed, so the latency with delays becomes the final latency for that trial. Best, The latency property of a trial is supposed to reflect what actually happened, i.e. it is read-only and you cannot manipulate it (i.e. arbitrarily change it, add or subtract, etc.). You can, however, use a value as in / ontrialend = [values.latencyplus100 = trial.mytriala.latency+100]
|
|
|
Nakayama Yao
|
|
Group: Forum Members
Posts: 39,
Visits: 230
|
+x+x+x+x+x+x+x+x+xHi Dave, I wish to design an experiment with the following process: The trial begins with a fixation. "A" shows up at an variable onset and disappears until the onset of "B" (A's offset overlaps with B' onset). "B" lasts 2s before disappearance. The response (press the space) can only be made after the onset of A and does not affect the presentation of B, and the time point of response release is recorded. The onset of B is drawn from a guassian distribution with a fixed mu and sigma (I have read https://www.millisecond.com/forums/Topic8431.aspx#bm8437, but still do not how to apply it into to my syntax). Would you help me fix my script? Best, Nakayama It would be helpful if you could attach your script. You attached a data file -- I cannot tell you what's wrong with the script based on a data file. https://www.millisecond.com/forums/Topic8431.aspx#bm8437 here I attached my script, one of which was copied from the website above for generating normally distributed data. <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames </trial> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> Hi Dave, thank you for your help. Same script. I was trying to give some feedback by assigning points to how early the response as made before values.b_onset, and I found it was impossible to calculate directly on values.b_onset. Do you have new ideas? / ontrialend = [if(trial.mytriala.latency<=values.b_onset/10){ values.points+=10}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/9){ values.points+=20}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/8){ values.points+=30}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/7){ values.points+=40}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/6){ values.points+=50}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/5){ values.points+=60}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/4){ values.points+=70}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/3){ values.points+=80}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){ values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){ values.points+=100}] Best, It's perfectly possible to calculate on values.b_onset. See for yourself: <data> / columns=[subject, blockcode, trialcode, trialnum, latency, response, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, values.a_onset, values.b_onset] </data> <expressions> / z = if(values.u>0.5)(sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) else (-sqrt(-ln(1-pow(2*values.u-1,2))/sqrt(m_pi/8))) / x = (values.sigma*expressions.z)+values.mu </expressions> <values> / mu = 1500 / sigma = 500 / u = 0 / a_onset = 0 / b_onset = 0 / points = 0 </values> <trial mytriala> / ontrialbegin = [values.u=rand(0,1); values.a_onset = expressions.x;] / ontrialbegin = [values.u=rand(0,1); values.b_onset = expressions.x;] / ontrialbegin = [trial.mytriala.insertstimulustime(text.a, values.a_onset)] / ontrialbegin = [trial.mytriala.insertstimulustime(text.b, values.a_onset + values.b_onset);] / ontrialbegin = [trial.mytriala.insertstimulustime(shape.b_offset, values.a_onset + values.b_onset + 2000);] / ontrialbegin = [trial.mytriala.beginresponsetime = values.a_onset] / ontrialend = [trial.mytriala.resetstimulusframes()] / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] / stimulustimes = [0=fixation] / validresponse = (57) / responseinterrupt = frames / branch = [ trial.showfeedback ] </trial> <trial showfeedback> / stimulusframes = [1=pointsinfo] / validresponse = (57) </trial> <text pointsinfo> / items = ("B Onset: <%values.b_onset%> | Latency: <%trial.mytriala.latency%> | Points: <%values.points%>") </text> <text fixation> / items = ("+") / erase = false </text> <shape b_offset> / shape = rectangle / size = (100%, 100%) / color = white / erase = false </shape> <text a> / items = ("A") / erase = false </text> <text b> / items = ("B") / erase = false </text> <block myblock> / trials = [1-10=mytriala;] </block> I*m not sure I correctly understand your point / award system, though. / ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] If latency is smaller than half the onset value (awarding 90 points), it is *by necessity* / ontrialend = [if(trial.mytriala.latency<=values.b_onset){values.points+=100}] also smaller than the whole onset value (awarding 100 points), hence you're awarding 190 points total. This of course extends to all the other, smaller fractions as well (onset divided by 3, by 4, and so forth). Is that intended? Yes, it was. Thank you for your advice. Would you help me with another question? I wish to arbitrarily add 100ms delays on the "latency" as soon as the space key is pressed, so the latency with delays becomes the final latency for that trial. Best, The latency property of a trial is supposed to reflect what actually happened, i.e. it is read-only and you cannot manipulate it (i.e. arbitrarily change it, add or subtract, etc.). You can, however, use a value as in / ontrialend = [values.latencyplus100 = trial.mytriala.latency+100] Thank you Dave. It works. As for the point-rewarding system, I wish to use y=ax+b to define the relationship between trial.mytriala.latency and values.points (rewarded points), so both of which can be continuous variables. instead of using staircase definition like, ontrialend = [if(trial.mytriala.latency<=values.b_onset/2){values.points+=90}] Is there any syntax I can refer to? Thank you for your time. Best,
|
|
|