HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/R/R-4.4.0/library/MASS/tests/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