BookmarkSubscribe
Choose Language Hide Translation Bar
tlsimons
Community Trekker

Creating a Variable

I have an issue while creating an overall measure of time. I have attached a screenshot that shows what the data looks like thus far. I need to now create a variable that is called "time in trial" where I basically take the "Nback start" minus the "Nback stop."

 

More specifically I would need several things to happen. 

1. When "Nback # of letters presented" equals 1 the "time in trial" should equal 0. Then as the "Nback # of letters presented" increases the "time in trial" should also increase. 
2. This increase should stop when I reach another 1 in "Nback # of letters presented" and start back over at 0 for "time in trial."


image.png
Any guidance would be greatly appreciated. 

0 Kudos
1 REPLY 1
Jeff_Perkinson
Community Manager Community Manager

Re: Creating a Variable

If there are no gaps in the sequence for Nback # of letters presented then I think the formula for Time in Trial is just:

 

:NBack# of Letters Presented - 1

 

If there are gaps, then you'll need a formula that combints conditional If() to check whether Nback# letters is 1 and the Lag() function to get the value of Time in Trial in the previous row so you can increment it.

 

JMPScreenSnapz217.png

 

-Jeff
0 Kudos