NumberLists comparison

From Impure Wiki

Jump to: navigation, search

A very common structure is Table with a first column (list) filled with names or objects, and the others with numbers. If the Table have only two lists: names and values, you can use the Histogram, the CirclesTagCloud or the Quadrification to visualize it, in this cases you have to use the getListElement (remember that Table is a List o Lists, so if you read the first element of the Table it will be the first List, and so on).

Once you have a Table with objects or names in the first List, and two or more NumberLists, you may want to use some kind of comparative visualization method.

In order to perform this exercise you have to find a table with a list of names and two or more number lists.

This data could be interesting: http://www.guardian.co.uk/news/datablog/2010/apr/12/maternal-mortality-rates-millennium-development-goals

The main idea in this case is to try to figure out if budget and revenues are correlated or not.

You load and decode the table. The result should be a Table with at least three Lists. Then you place three getElementFromList operators on the space, each one picking a different List, the first one being a StringList and the other two NumberLists.

Now you have two interesting an immediate options. If values determine a sorting, you may be interested in see how each NumberList define a different sorting and to compare the two sorting lists. In the example of maternal mortality it´s interesting to see the list of countries sorted from lees to more mortality in each year, and try to visualize which countries remained in the same positions and which ones changed. For that purpose use the ComparativeSort visualizator.

For instance, from a csv file:

title;classification;year;budget;gross;duration;audience

Aliens;1;1986;18.5;81.843;137;8.2

Armageddon;2;1998;140;194.125;144;6.7

As Good As It Gets;2;1997;50;147.54;138;8.1

Braveheart;1;1995;72;75.6;177;8.3

Chasing Amy;1;1997;0.25;12.006;105;7.9

Contact;2;1997;90;100.853;153;8.3

Dante's Peak;2;1997;104;67.155;112;6.7

Deep Impact;2;1998;75;140.424;120;6.4

Executive Decision;1;1996;55;68.75;129;7.3

Forrest Gump;3;1994;55;329.691;142;7.7

Ghost;3;1990;22;217.631;128;7.1

Gone with the Wind;3;1939;3.9;198.571;222;8

Good Will Hunting;1;1997;10;138.339;126;8.5

Grease;3;1978;6;181.28;110;7.3

Halloween;1;1978;0.325;47;93;7.7

Hard Rain;1;1998;70;19.819;95;5.2

I Know What You Did Last Summer;1;1997;17;72.219;100;6.5

Independence Day;2;1996;75;306.124;142;6.6

Indiana Jones and the Last Crusade;2;1989;39;197.171;127;7.8

Jaws;2;1975;12;260;124;7.8

Men in Black;2;1997;90;250.147;98;7.4

Multiplicity;2;1996;45;20.1;117;6.8

Pulp Fiction;1;1994;8;107.93;154;8.3

Raiders of the Lost Ark;2;1981;20;242.374;115;8.3

Saving Private ryan;1;1998;70;178.091;170;9.1

Schindler's List;1;1993;25;96.067;197;8.6

Scream;1;1996;15;103.001;111;7.7

Speed 2:Cruise Control;2;1997;110;48.068;121;4.3

Terminator;1;1984;6.4;36.9;108;7.7

The American President;2;1995;62;65;114;7.6

The Fifth Element;2;1997;90;63.54;126;7.8

The Game;1;1997;50;48.265;128;7.6

The Man in the Iron Mask;3;1998;35;56.876;132;6.5

Titanic;2;1997;200;600.743;195;8.4

True Lies;1;1994;100;146.261;144;7.2

Volcano;2;1997;90;47.474;102;5.8


I took the first, the fourth and the fifth lists, and the result was:

ComparativeSort.png

Other approach is to try to depict whether or not two NumerLists are correlated. A classic method to do that is the Scatter. But if the two NumberLists are sorted (chronologically, for instance) you can visualize the relation between values with ColoredScatter.

Personal tools