In: Statistics and Probability
An example for numerical to categorical data off the top of my head: Light of different color has different wavelengths, but certain ranges of wavelengths qualify as certain shades/hues/tints/etc. You can generalize and say a certain range can be called "blue" or "red". Red is usually attributed to light that has a wavelength between 780 and 622 nanometers, whereas blue light is between 492 and 455 nm. To the average person, "red" and "blue" obviously mean more than a given wavelength of light, so a categorical/qualitative description might be of more use in such a context. Another example would be grading scales. Certain ranges of scores will qualify as an A, a B, and so on. Suppose you want to examine the grades of high school students admitted into a prestigious university. Students that fall in the A/B range tend to have a better chance of being admitted, while those at the other end of the spectrum are "significantly" less likely to enroll. ("Significant" here can take on the statistical meaning of the word.
To use the chi-square test, we have to create the table of attributes from numeric values as follows;
1) for colour and wavelength
Colour\ Wavelength | 780 to 622 | 492 to 455 | Total |
Red | N1 | N3 | N1+N3 |
Blue | N2 | N4 | N2+N4 |
Total | N1+N2 | N3+N4 | TOTAL= N1+N2+N3+N4 |
Here, in the first cell, colour is titled for column while the wavelength is titled for the row.
N1 represents the number of colour displaying as 'red' with a wavelength of 780 to 622 similarly we can interpret N2, N3, N4.
Now, on this data chi-square can be done.
2) Grades and admission in the university;
Grades\ Admitted in the university | Reputed | Other | Total |
A | N1 | N5 | N1+N5 |
B | N2 | N6 | N2+N6 |
C | N3 | N7 | N3+N7 |
D | N4 | N8 | N4+N8 |
Total | N1+N2+N3+N4 | N5+N6+N7+N8 | TOTAL = N1+N2+...+N8 |
Here,
N1 is the student having grade A and admitted in the reputed univerity.
Similarly, we ddefine N2 to N8.
Now, on this data chi-square can be done.
Now, on this data chi-square can be done.