The R Project SVN R

Rev

Rev 51762 | Rev 52129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51762 Rev 52034
Line 1... Line 1...
1
 
1
 
2
R version 2.12.0 Under development (unstable) (2010-04-18 r51761)
2
R version 2.12.0 Under development (unstable) (2010-05-18 r52028)
3
Copyright (C) 2010 The R Foundation for Statistical Computing
3
Copyright (C) 2010 The R Foundation for Statistical Computing
4
ISBN 3-900051-07-0
4
ISBN 3-900051-07-0
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
Line 40... Line 40...
40
> AIC(lm1)
40
> AIC(lm1)
41
[1] 326.0716
41
[1] 326.0716
42
> BIC(lm1)
42
> BIC(lm1)
43
[1] 339.0226
43
[1] 339.0226
44
> 
44
> 
-
 
45
> ## with two models:
-
 
46
> lm1. <- update(lm1, . ~ . -Examination)
-
 
47
> AIC(lm1, lm1.)
-
 
48
     df      AIC
-
 
49
lm1   7 326.0716
-
 
50
lm1.  6 325.2408
-
 
51
> BIC(lm1, lm1.)
-
 
52
     df      AIC
-
 
53
lm1   7 339.0226
-
 
54
lm1.  6 336.3417
-
 
55
> 
45
> ## Don't show: 
56
> ## Don't show: 
46
> ## 2 equivalent ways of calculating the BIC:
57
> ## 2 equivalent ways of calculating the BIC:
47
> stopifnot(all.equal(AIC(lm1, k=log(nrow(swiss))), BIC(lm1)))
58
> stopifnot(all.equal(AIC(lm1, k=log(nrow(swiss))), BIC(lm1)))
48
> ## End Don't show
59
> ## End Don't show
49
> 
60
>