cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
tlsimons
Level I

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. 

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

Recommended Articles