logic function ifHi, I'm new to JMP;
I ask for help how to solve the problem:
I have values in the column (HB) I have to compare the following conditions
if the value of HB> 150 has been reclassified as "grade 0" SE HB> 80 & <90 grade 1 result; IF HB> 90 & <= 150 result "grade 3"
I can't not if then and Else, someone can help me
THANKS
Re: logic function ifHi @MarcoR,
You can do this with a formula column
If(
:HB > 150, "grade 0",
80 < :HB <= 90, "grade 1",
90 < :HB <= 150, "grade 3",
"not graded"
)
Distribution by grade
I have attached an example data table with the column formula.
Re: logic function if
@pmroz he wrote:
The first time you use IF in JSL it can be a challenge. You are very careful about the placment of commas. I annotate my code to make it a little clearer. Using Stan's example:
If (:HB > 150,
// then
"grade 0",
// else if
80 < :HB <= 90,
// then
"grade 1",
// else if
90 < :HB <= 150,
// then
"grade 3",
// else
"not graded"
)
Thanks for your answer ;
in relation the range that I need is the segunte I have re-worked according to your indications but not function,
with excel I used this syntax = SE (HB> 120; 0; SE (E (B2> = 100; B2 <= 120); 1; SE (E (B2> = 80; B2 <100); 2)))
I tried this but it doesn't work
If (: Hb> 120, "0",
120 <: Hb <= 100, "1",
80 <: Hb <= 100, "2",
"not graded"
)
when I put the values between 80 and 120, it notifies me Not Grade
Thanks again
Re: logic function ifYou are almost there.
If(
:Hb >= 120, "0",
100 <= :Hb < 120, "1",
80 < :Hb < 100, "2",
"not graded"
)
Re: logic function ifThe first time you use IF in JSL it can be a challenge. You have to be very careful about the placment of commas. I annotate my code to make it a little clearer. Using Stan's example:
If (:HB > 150,
// then
"grade 0",
// else if
80 < :HB <= 90,
// then
"grade 1",
// else if
90 < :HB <= 150,
// then
"grade 3",
// else
"not graded"
)