File: regression.Rout.save

package info (click to toggle)
r-cran-mass 7.3-51.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,148 kB
  • sloc: ansic: 664; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,623 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

R version 2.10.0 Under development (unstable) (2009-07-31 r49037)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ### regression tests
> 
> library(MASS)
> 
> contr.sdif(6)
         2-1        3-2  4-3        5-4        6-5
1 -0.8333333 -0.6666667 -0.5 -0.3333333 -0.1666667
2  0.1666667 -0.6666667 -0.5 -0.3333333 -0.1666667
3  0.1666667  0.3333333 -0.5 -0.3333333 -0.1666667
4  0.1666667  0.3333333  0.5 -0.3333333 -0.1666667
5  0.1666667  0.3333333  0.5  0.6666667 -0.1666667
6  0.1666667  0.3333333  0.5  0.6666667  0.8333333
> contr.sdif(6, sparse=TRUE)
         2-1        3-2  4-3        5-4        6-5
1 -0.8333333 -0.6666667 -0.5 -0.3333333 -0.1666667
2  0.1666667 -0.6666667 -0.5 -0.3333333 -0.1666667
3  0.1666667  0.3333333 -0.5 -0.3333333 -0.1666667
4  0.1666667  0.3333333  0.5 -0.3333333 -0.1666667
5  0.1666667  0.3333333  0.5  0.6666667 -0.1666667
6  0.1666667  0.3333333  0.5  0.6666667  0.8333333
> stopifnot(all(contr.sdif(6) == contr.sdif(6, sparse=TRUE)))
> 
> 
> proc.time()
   user  system elapsed 
  2.298   0.078   2.377