How to remove all values that are too big or too small?
When analyzing data, sometimes you want to graph or analyze only a portion of the values, and remove any values that are higher (or lower) than some threshold. You can do this with a user-defined Prism transform. Here is a transform that removes any data with Y greater than 100:
Y=IF(Y>100, NULL, Y)
That transforms any values greater than 100 to NULL (or blank) values, so they are omitted in the results table. The other values get transformed to equal Y (no change).
Here is a transform that removes any data with Y greater than 100 or less than 10.
Y=IF(Y>100, NULL, IF(Y<10, NULL,Y))
This simply nests two IF functions in the transform.
An alternative but equivalent form of this equation is:
Y=IF(OR(Y>100, Y<10), NULL, Y)
This function first checks for values of Y that are greater than 100 OR less than 10. When either of these conditions are true, this function returns NULL (bank) values. When neither of these conditions are true, this function returns Y (unchanged).
Rather than removing values that are too high (or too low), you might want to set them to a particular value. This transform sets any value greater than 100 to equal 100:
Y=IF(Y>100, 100, Y)
This transform keeps any value between 0 and 100, but transforms any negative values to equal 0.0 and any values greater than 100 to equal 100:
Y=IF(Y>100, 100, IF(Y<0, 0,Y))
To enter a user defined transform, go to a data table, click analyze, and choose Transform. At the top of the dialog, choose User-defined Y transforms. On the new dialog, click Add to create a new transform.
Of course, you could create an X transform and use similar syntax to remove rows where X is too high or too low (or meets some other criterion).
A note on using NULL
In previous versions of Prism, the "NULL" function may not be recognized. In these situations, a different workaround would be to use a transform that divides by zero (for example, 1/0). Since this value is undefined, Prism won't try to return a value for this and will simply report the result as blank.
Keywords: exclude, trim, window, divide by zero