How to get P-Values of Categorical Features? I have dataframe which contains numerical and categorical features. I am trying to get p-values of these variables using OLS.
I'm creating dummies to get p-values of categorical features. But in this way im getting p-value for all values in categorical features. My purpose is that get p-value of feature not all values of feature.
How should i interpret of OLS result which contains p-values of dummies? Should i use chi2 test for get the p-value of categorical features? If yes can i use p-values of numerical features from OLS and p-values of categorical features from chi2 test for all data?
 A: You can test the fit of a model with that factor and it’s levels omitted against the full model. That’s basically what’s going on to calculate the p-values of each individual parameter.
The model with the factor and it’s levels is going to fit better, but then the test, in some sense, says if the increase in fit is worth the additional model complexity.
You’re doing an OLS linear model, so the standard test would be an F-test of the sums of squared errors:
$$
\dfrac{\frac{SSE_{reduced}-SSE_{full}}{p_{full}-p_{reduced}}}{\frac{SSE_{full}}{n-p_{full}}}\overset{H_0}{\sim} F_{p_{full}-p_{reduced}, n-p_{full}}
$$
“Reduced” means the model with the variables (factor with it’s levels) missing; “full” means the model with those variables included. “SSE” is the sum of squared errors (technically residuals) from the model. “p” is the number of parameters in the model. “n” is the number of observations. “$\overset{H_0}{\sim}$” means distribution under the null hypothesis that the factor does not influence the outcome.
In R, the “lmtest” package has tools to do comparisons like this. The “anova” function in base R might be able to take nested models as inputs, too.
A: In case you aren't aware, the p-values returned for each category you are tested assess if the individual dummy is significantly different than your determined reference group. I believe you are looking for a global test to assess if the variable itself is significant. In this case you would use a "chunk test" AKA a "general linear F-test". 
See this thread:
What are chunk tests?
It is important to note that some dummies in your categorical variable may not be significant, but they should still be left in the model. 
