2
$\begingroup$

I have just run a NBGLM and want to know something. If I am aiming to drop the least significant explanatory variables until all explanatory variables are significantly correlated wih the response variable (i.e. model selection finding the strongest variables). What do I do when there is a factor within the model that has a level within it insignificant?

                     Estimate Std. Error z value Pr(>|z|)    
     (Intercept)             6.3081079  1.6497143   3.824 0.000131 ***
          Height_            0.0247727  0.0081857   3.026 0.002475 ** 
          Width             -0.0017481  0.0006614  -2.643 0.008215 ** 
     Upper_Field_Layer      -0.0257683  0.0119503  -2.156 0.031061 *  
     MeanMin                -0.2361341  0.1420208  -1.663 0.096378 .  
     as.factor(Site_Treat)2 -0.7361044  0.1866798  -3.943 8.04e-05 ***
     as.factor(Change)2     -0.5002666  0.1810585  -2.763 0.005727 ** 
     as.factor(Change)3     -0.1910862  0.1821139  -1.049 0.294055    
     ---

0.29 in change 3 is the most obvious to drop but as it is a factor it means dropping all other levels also. Could I reformat the excel spreadsheet to look like this? Where C=Change. A row for change 1, change 2 & change 3. Would these then be okay to put in as discrete nominal variables whereby on insignificant levels can be removed?

C   C1  C2  C3
1   1   0   0
2   0   1   0
3   0   0   1
1   1   0   0
2   0   1   0
3   0   0   1
1   1   0   0
2   0   1   0
3   0   0   1
1   1   0   0
2   0   1   0
3   0   0   1

Best Wishes

$\endgroup$

1 Answer 1

5
$\begingroup$

It is not appropriate to remove "insignificant" levels or insignificant components when a continuous variable is expanded into multiple terms (e.g. $x, x^{2}$). This will bias the model and ruin the meaning of $P$-values. Also note that the judgments you are making are heavily dependent on how you code the factors. Other topics on the site address this issue in detail. There are cases in which it is OK to combine infrequent levels if you do not use $Y$ to guide the process.

$\endgroup$
3
  • 1
    $\begingroup$ @ Frank Harrell Thanks again, I think I have discussed this in length with you before on this site. I am not an advocate of removing variables in any case. Removing obvious collinearity during data exploration is fine but subsequent variables "left over" to run the GLM may still hinge on each other, such is the natural world. My problem is that a certain insect emerged in large numbers from my site habitats and this occured during change two. Should the overall factor "change" be left in the model so? $\endgroup$
    – Platypezid
    Commented Jan 26, 2012 at 14:28
  • 1
    $\begingroup$ Yes there is no reason to remove them, and it would be an arbitrary process anyway, dependent on coding choices. Also, keeping "insignificant" things in the model keeps the standard errors and confidence intervals correct. $\endgroup$ Commented Jan 26, 2012 at 17:12
  • $\begingroup$ @ Frank Harrell Thanks a lot Frank, very informative as always, I am indebted :-) $\endgroup$
    – Platypezid
    Commented Jan 26, 2012 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.