Suppose a variable $T$ (temperature) is coded as follows: $T = 1$ if temperature < 10, $T = 2$ if 10 < temperature < 40, and $T=3$ if temperature > 40. Is it better to treat $T$ as a categorical variable?
|
|
@Wayne is right that you have already decided to categorize your variable, so in some sense the deck is loaded. However, I think it would be better to set your categorization aside and go with your original continuous variable. As it happens, I just discussed this issue in another question (and a slightly different context). See here (1/2 way down) for a list of reasons why it's better to leave continuous variables in their original form. |
|||
|
|
I think the question maybe whether there is a way to treat the data "as is" as continuous, somehow. It may be. If you know the minimum and maximum temperatures, and if you can make some reasonable assumptions about the distribution, you can come up with "recreated" continuous data out of your ordinal factor. For example, say your data is temperature in New York City in degrees centigrade on each day in the distant year for which exact data are not available. You will not be able to recreate the exact temperature, but you can "fake it" by using data from years where temperature is available. Of course, this will be much noisier than the real data, and if you have nothing else to go on, it might not be worth it. But if this is the real example, you would have a guess as to temperature on the day before and the day after .... Is this a good idea? I'm not sure. It probably depends on the exact situation. I think this could be an interesting larger question. |
|||
|
|
|
If you want to encompass categorical data analysis, then you might want to treat continuous variables as categorical variables. For example, if you want to perform Mantel-Haenszel chi-square test, an appropriate categorization is needed. In terms of categorization, you need to categorize them in a sensible way because we don't have too few records for |
|||
|
|