0

I ran a multiple linear regression model, and the results came out like this:

   Coefficients:
                Estimate Std. Error t value Pr(>|t|)    
    (Intercept)  9221.74    2358.14   3.911 0.000101 ***
    d_weekend    4264.47     392.03  10.878  < 2e-16 ***
    d_month04     -41.35    2377.77  -0.017 0.986131    
    d_month05    1256.96    2380.71   0.528 0.597679    
    d_month06    -346.43    2378.97  -0.146 0.884261    
    d_month07    -138.77    2393.50  -0.058 0.953784    
    d_month08     -56.06    2382.24  -0.024 0.981233    
    d_month09     756.34    2385.95   0.317 0.751340    
    d_month10    9569.29    2913.05   3.285 0.001070 ** 
    rain          -33.27      17.44  -1.907 0.056889 .  

The problem is, there should be a "d_month03" level that was omitted in the summary
(the model used data ranging from d_month03 to d_month10)
Is there any way I could solve this and show d_month03 on the summary?

  • When fitting a model with a categorical variable and an intercept, you can't get estimates for all levels. Typically you choose one level to be a reference level. Alternatively you can omit the intercept. But you can't get both; that would be an over specified model. – MrFlick Oct 04 '19 at 20:45
  • @MrFlick Thanks for the information! I checked out the other post. But I still have a question. In the case where there are more than one categorical variables, the intercept is the first level of the first categorical variable, but no coefficients are found for the first level of the second categorical variable – viatmincode Oct 04 '19 at 21:11
  • Again, you cannot estimate all those parameters. The model would be over-specified. This is just the way linear regression works. You might want to review a statistical textbook for a more detailed discussion of why this is the case. This is not a programming problem that R can solve for you. This is just how the maths work for default contrasts. – MrFlick Oct 04 '19 at 21:14

0 Answers0