Mathematical expressions that produce a true or false are known as boolean logic or boolean expressions.
Some analysis software requires that users write code to specify boolean logic. For example, boolean logic in SPSS Syntax language for A female living alone or a female that preferss Coca-Cola, is:
gender = "Female" AND living_arrangments = "Living along" OR
preferred_cola = "Coca-Cola" AND gender = "Female"
if all the variables are text variables. If the variables are numeric, then the values representing the labels need to be used instead:
gender = 2 AND living_arrangments == 7 OR preferred_cola == 1 AND gender == 2
There are often different ways of writing the same thing in boolean logic. For example, we can rewrite the above expression as:
gender = 2 AND (living_arrangments == 7 OR preferred_cola == 1)
More modern software provides users interfaces so that users do not need to learn a computer language. For example, the above expression in Displayr can be written as: