Generate missing values with the function ifHello,
I have a database with many values (BMI, waist circumference, etc) from patients at two time points (T0, T1). Some values are missing.
I would like to create a formula that generates a missing value at T1, when T0 is missing (and the contrary).
Can someone help me with that ?
Thank you
Re: Generate missing values with the function ifHere is one way to do what you want
Names Default To Here( 1 );
dt = Current Data Table();
For( i = 1, i <= N Rows( dt ), i++,
If( Is Missing( dt:BMI[i] ),
thePatient = dt:Patient[i];
If(
dt:Time[i] == "T0",
dt:BMI[dt << get rows where(
dt:Patient == thePatient & dt:Time == "T1"
)] = .,
dt:Time[i] == "T1",
dt:BMI[dt << get rows where(
dt:Patient == thePatient & dt:Time == "T0"
)] = .,
);
)
);Re: Generate missing values with the function ifHereby an example of how my datatable is arranged !
Thank you for your help
Re: Generate missing values with the function ifPlease attach a sample of your data table, or at least an image of the data table
Re: Generate missing values with the function ifT0 and T1 are in rows in my JMP table.
Is there any way to make it work that way ?
Re: Generate missing values with the function ifAssuming your reference to T0 and T1 are 2 columns in your JMP Table, the following will make the adjustment you want
Names Default to Here( 1 );
For Each Row(
If( isMissing( :T0 ), :T1 = . );
If( isMissing( :T1 ), :T0 = . );
);Re: Generate missing values with the function if@Shiel,
Assuming your data looks something like what is shown below, you could try what I have shown on the right.
