# R - Analysis of a Qualitative Predictor with 30 levels [duplicate]

I'm running a multiple linear regression in R.

In my linear regression I have 'country' as a qualitative predictor, which dramatically increases the adjusted R^2 value, and lowers my BIC. I want to include it in my regression model, but only around 2/3 of the counties I've mentioned are statistically different from the dummy variable.

Is it correct to bundle these countries together to have "zero" weight when compared to the dummy variable?

When I run my training model on some test data, how can I stop it using these from adding 'artificial statistically insignificant weights' to the model.

For example, Australia adds 2.6 to the model, but its p value is 0.34. I would like it to add 0 instead of 2.6.

Thank you very much!

## marked as duplicate by rolando2, Nick Cox, kjetil b halvorsen, mdewey, gung♦ regression StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 5 '17 at 16:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## 1 Answer

I don't think you can do this and I don't see any reason you would want to do it. As far as I know, there is no such thing as 'artificial statistically insignificant weights'; that seems to be based on a misunderstanding of p values.

However, if you have 30 countries, you may be able to combine some. Whether this is a good idea depends on the specifics of your situation (e.g. Are there natural ways to combine countries? Do you have overfitting problems?).

• My understanding is you are allowed to combine countries if you have a good reason to. For example, you could group countries by continent, or tourism numbers. Is this correct? I do have overfitting problems with my current model, and my worry is that my model will not work on testing data. – rjadler Apr 5 '17 at 12:29
• Yes, you are right. "Good reason" is context specific. Countries that are similar in one context might be very different in another. – Peter Flom Apr 5 '17 at 12:32