## Random duration of trial

##### Random duration of trial
 Author Message ***JayD*** Group: Forum Members Posts: 17, Visits: 67 Hi,I have a couple of questions1) Is it possible to randomize a trial's duration (either using /trialduration or /response = timeout ())? I want to try and have my intertrial interval randomly vary between 500ms and 400ms on any given trial.2) I want a particular (mouse-click) response to give participants a 'reward' feedback trial on 80% of trials, while presenting the same mouse-click with a different 'no-reward' feedback trial on the other 20%. I'm not sure how to go about building in these percentages into the branch trials. What's the best way to do this?Thanks,Jay Dave posted 8 Years Ago ANSWER Group: Administrators Posts: 12K, Visits: 99K Re. #1: Yes. You can do something like/ randomiti = 0...with / ontrialbegin = [values.randomiti = round(rand(400,500))].../ trialduration = values.randomiti.../pre- and /posttrialpause, /timeout and /trialduration all accept values which you can set at will via /ontrialbegin etc.For the relationship between the various timing components involved in a see the "How to Control Trial Duration and Inter-Trial Intervals" topic in the documentation.Re. #2: Not sure why you would need any elaborate /branch logic, but the question is underspecified. For example, it's not clear if the "specific response" is the only allowed response; if not, you cannot possibly know how many times a participant will actually provide the "specific response", i.e., it may not even be possible to achieve the 80/20 split. Suppose the participant only provides the "specific" response twice across however many trials you have: You could at best achieve a 50/50 split in that situation.If, otoh, there is only that single "specific response", you can simply do/ trials = [1-10 = noreplace(rewardtrial, rewardtrial, rewardtrial, rewardtrial, norewardtrial)]...which will run 8 "reward" trials and 2 "no reward" trials. No branching required. Edited 8 Years Ago by Dave

#### Merge Selected

Merge into selected topic...

Merge into merge target...

Merge into a specific topic ID...