I am using categorical variable (having three categories) as independent variable in model and found that one category is coming to be significant while another category is not coming to be significant while variable is significant at overall level to be included in model. I am not able to understand whether I should include the insignificant category in the model.
2 Answers
Categorical variables can be represented several different ways in a regression model. The most common, by far, is reference cell coding. From your description (and my prior), I suspect that is what was used in your case. The standard statistical output will give you two tests. Let's say that A is the reference level, you will have a test of B vs. A, and a test of C vs. A (n.b., C can significantly differ from B, but not A, and not show up in these tests). These tests are usually not what you really want to know. You should test a multi-category variable by dropping both dummy variables and performing a nested model test. Unless you had an a-priori plan to test if a pre-specified level is necessary and it is not 'significant', you should retain the entire variable (i.e., all levels). If you did have such an a-priori hypothesis (i.e., that was the point of your study), you can drop only the level in question and perform a nested model test.
It may help you to read about some of these topics. Here are some references for further study:
Coding strategies for categorical variables:
- UCLA's stats help website
- I discuss reference cell coding here: Regression based for example on days of week
Problems with modifying your model based on what you find, when you didn't have a pre-specified hypothesis:
- While it's not framed exactly like your situation, you may be able to get the idea from my answer here: Algorithms for automatic model selection
Issues with multiple comparisons:
- You might skim some of the CV threads categorized under the multiple-comparisons tag
- the Wikipedia page for multiple comparisons
Nested model tests:
- Although discussed in terms of testing for moderation, my answer here should be clear enough to get the idea: Testing for moderation with continuous vs. categorical moderators
There is no need to include indicator variables for each of the categories. Let's say category A is coming out significant. Your results are suggesting that you consider collapsing the categories into "category A" and "all other categories".
Of course, you should perform an F-test for nested model vs. full model to check if removing indicator variables for other categories make sense.
-
2$\begingroup$ This is possible, but is almost certainly poor a poor choice. $\endgroup$ Commented Dec 5, 2013 at 15:45
-
$\begingroup$ Why do you say that? It is absolutely possible that one category says something and the other categories say nothing. Let's say you have indicator variables for the number of kids someone has. Let's say one indicator for zero kids, one indicator for one kid, etc. But if what really matters is whether or not you have kids, not how many kids you have, the first indicator will be significant and the rest won't. $\endgroup$ Commented Dec 5, 2013 at 15:54
-
3$\begingroup$ There is way too much here to explain in a comment. It may help you to read through my answer & some of the linked resources. If you have number of kids as a variable, you should not be representing it w/ dummy variables; that is a numerical variable. The idea that simply having kids is what matters is perfectly reasonable, if a-priori, & can be tested w/ a spline (see my answer here &/or here). $\endgroup$ Commented Dec 5, 2013 at 16:14
-
3$\begingroup$ From the statistical point of view, perhaps. But it's usually a nightmare for interpretation, because such removal can cause the reference to be overly heterogeneous. For example, if we wish to compare different race/ethnicity using "white" as reference, and then blindly aggregate some other non-significant categories (e.g. "Asian" or "Hispanic") into "white", then the original research question can no longer be answered. To aggregate or not shouldn't be only based on p-values, contexts and hypotheses matter as well. $\endgroup$ Commented Dec 5, 2013 at 16:21
-
2$\begingroup$ You can treat number of kids as categorical, & it may be useful in some case. Most likely, however, it is better to treat it as numerical, since it is numerical. If the point of your study is to see if each additional kid provides an identical increase (decrease), the best way to handle that would be to use number of kids as numerical & add non-linear transformations (eg, a squared term) or a spline to the model. Representing the variable via dummies should not be your default. $\endgroup$ Commented Dec 5, 2013 at 16:46