3

test data frame:

> foo
      x     y     z
1 0.191 0.324 0.620
2 0.229 0.302 0.648
3 0.191 0.351 0.626
4 0.229 0.324 0.630
5 0.152 0.374 0.656
6 0.191 0.295 0.609
7 0.229 0.267 0.665
8 0.152 0.353 0.657
9 0.152 0.355 0.655

Two linear models:

model1 <- lm(z~polym(x,y,degree = 1),data=foo)
model2 <- lm(z~polym(x,y,degree = 2),data=foo)

ANOVA for the two models returns:

> anova(model1,model2)
Analysis of Variance Table

Model 1: z ~ polym(x, y, degree = 1)
Model 2: z ~ polym(x, y, degree = 2)
  Res.Df      RSS Df Sum of Sq    F Pr(>F)  
1      6 0.002988                           
2      3 0.000169  3   0.00282 16.6  0.023 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Why the single *? 0.05 > 0.023 > 0.01, so shouldn't it print a . symbol?

lmo
  • 37,904
  • 9
  • 56
  • 69
DeltaIV
  • 4,773
  • 12
  • 39
  • 86
  • 1
    The table table codes may be a bit difficult to decipher, but: 0.023 is significant at the 0.05 (\*) level, but not at the 0.01 (\*\*) level. The (.) character corresponds to the 0.1 or ten percent level. – lmo Aug 02 '16 at 11:56
  • 1
    `0 ‘***’` / `0.001 ‘**’` / `0.01 ‘*’` / `0.05 ‘.’` / `0.1 ‘ ’` / and for 1 nothing is printed. Your 0.023 falls between 0.01 and 0.05, thus it is marked with one star. – Roman Aug 02 '16 at 11:58

1 Answers1

13

There is nothing wrong.

0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

means:

annotation          p-value          significance level
   ***            [0, 0.001]                0.001
    **         (0.001, 0.01]                0.01
     *          (0.01, 0.05]                0.05
     .           (0.05, 0.1]                0.1
                    (0.1, 1]                1

0.023 is within (0.01, 0.05], so it should be annotated by *.

Zheyuan Li
  • 71,365
  • 17
  • 180
  • 248