https://github.com/cran/MASS
Raw File
Tip revision: c157e9d0ab7c3e1eef0d66f7d0481b1a19b773df authored by Brian Ripley on 21 March 2015, 00:00:00 UTC
version 7.3-40
Tip revision: c157e9d
regression.Rout.save

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 
back to top