cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
sanchezpeinado
Level II

How do I create a formula

I have a column with multiple values captures a different time points. How can I create a new column with a formula that divide the sample based on values above and below the median at baseline

 
Time PointData per subject
Baseline169.8
30 Days180.6
3 Months188.1
6 Months174.98
1 Year215
Baseline214.9
30 Days206.7
3 Months222.6
6 Months219.9
1 Year191.9
1 ACCEPTED SOLUTION

Accepted Solutions
SDF1
Super User

Re: How do I create a formula

Hi @sanchezpeinado ,

 

  There's a few different ways you can do this. Ultimately, you'll want to do a conditional formula based on the values of the baselines. However, your data table is not setup like it really should be for JMP. Looking at your columns, it looks like you should also have another column, maybe "product" or something like that since your "time point" column repeats some entries with a new baseline value. Something like below:

DiedrichSchmidt_2-1623079692393.png

  You would then want to split your data table using the Product column and split the other two columns. The new table will look like the one below.

DiedrichSchmidt_3-1623079769629.png

  The last two columns in this table are formulas that use a conditional IF statement. Each one references the first cell (baseline) for each "product". To reference a specific cell of a column, after the column name type [], left square bracket followed by right square bracket. You'll then put 1 in there for the first cell of the respective column. 

DiedrichSchmidt_5-1623079860684.png

DiedrichSchmidt_6-1623079869762.png

 These formulas are set to return a numerical value -1 for below the baseline, 1 for above the baseline. You can change this to whatever you want, text or 0/1 or whatever. 

 

  This is just one way to do it, there are other ways. You'll definitely want to change the structure of your data table for JMP though. Having multiple baseline entries in a single column will make creating a formula rather difficult. 

 

Hope this helps!,

DS

View solution in original post

2 REPLIES 2
SDF1
Super User

Re: How do I create a formula

Hi @sanchezpeinado ,

 

  There's a few different ways you can do this. Ultimately, you'll want to do a conditional formula based on the values of the baselines. However, your data table is not setup like it really should be for JMP. Looking at your columns, it looks like you should also have another column, maybe "product" or something like that since your "time point" column repeats some entries with a new baseline value. Something like below:

DiedrichSchmidt_2-1623079692393.png

  You would then want to split your data table using the Product column and split the other two columns. The new table will look like the one below.

DiedrichSchmidt_3-1623079769629.png

  The last two columns in this table are formulas that use a conditional IF statement. Each one references the first cell (baseline) for each "product". To reference a specific cell of a column, after the column name type [], left square bracket followed by right square bracket. You'll then put 1 in there for the first cell of the respective column. 

DiedrichSchmidt_5-1623079860684.png

DiedrichSchmidt_6-1623079869762.png

 These formulas are set to return a numerical value -1 for below the baseline, 1 for above the baseline. You can change this to whatever you want, text or 0/1 or whatever. 

 

  This is just one way to do it, there are other ways. You'll definitely want to change the structure of your data table for JMP though. Having multiple baseline entries in a single column will make creating a formula rather difficult. 

 

Hope this helps!,

DS

sanchezpeinado
Level II

Re: How do I create a formula

Thank you!