Force a Categorical Attribute to Be Treated as Numeric

Top  Previous  Next

How To... > Work with Collections > Force a Categorical Attribute to Be Treated as Numeric

Attributes that have at least one non-numeric character are treated as categorical by Fathom. When graphed, they produce bar charts, rather than dot plots. Often this is undesirable, as when imported data represent missing values with asterisks. You want Fathom to ignore those values completely when dropping the attribute onto graphs, summary tables, or statistical objects.

 

Hold down Ctrl (Win) Option (Mac) key as you drop the attribute onto the object.

Warning: This method has disadvantages: You have to do it each time you drop the attribute, and, more seriously, values that have both numeric and non-numeric values will be ignored completely. For example, many attributes have a “top end” value, such as 7+ representing women who have had seven or more children. Leaving these values out of your analysis distorts your results. Instead, you should make an attribute that strips out the non-numeric characters.

Add a new attribute and give it the formula StringToNumber(mixedAttribute).

The new attribute will have only the numeric values stripped of any non-numeric characters. You could clear the formula at this point. You should document (in the collection’s Comments or a text object) that the “top end” value represents “that value and above.”

See also

stringToNumber

Add Comments to a Collection

Work with Text in Text Objects