
R version 4.5.2 (2025-10-31 ucrt) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.

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.

> library(NewmanOmics)
> 
> data(LungPair)
> lung <- as.matrix(log2(1 + LungPair))
> summary(lung)
 TCGA.38.4625.11A.01R.1758.07 TCGA.38.4625.01A.01R.1758.07
 Min.   : 0.000               Min.   : 0.000              
 1st Qu.: 2.711               1st Qu.: 3.032              
 Median : 7.480               Median : 7.728              
 Mean   : 6.394               Mean   : 6.591              
 3rd Qu.: 9.597               3rd Qu.: 9.734              
 Max.   :18.980               Max.   :19.680              
> 
> set.seed(12345)
> normal <- lung[, 1, drop=FALSE]
> tumor  <- lung[, 2, drop=FALSE]
> 
> ps <- pairedStat(normal, tumor)
> slotNames(ps) # should be five
[1] "nu.statistics" "p.values"      "pairedMean"    "difference"   
[5] "smoothSD"     
> dim(ps@nu.statistics)
[1] 20531     1
> dim(ps@p.values)
[1] 20531     1
> 
> summary(ps@nu.statistics)
 TCGA.38.4625.01A.01R.1758.07
 Min.   : 0.0000             
 1st Qu.: 0.3357             
 Median : 1.0023             
 Mean   : 1.2988             
 3rd Qu.: 1.9462             
 Max.   :18.4447             
> summary(ps@p.values)
 TCGA.38.4625.01A.01R.1758.07
 Min.   :0.0000              
 1st Qu.:0.2721              
 Median :0.5706              
 Mean   :0.5562              
 3rd Qu.:0.8502              
 Max.   :1.0000              
> 
> head(ps@nu.statistics)
            TCGA.38.4625.01A.01R.1758.07
?|100130426                    0.0000000
?|100133144                    0.3084685
?|100134869                    0.7578389
?|10357                        0.5257639
?|10431                        1.6200054
?|136542                       0.0000000
> head(ps@p.values)
     TCGA.38.4625.01A.01R.1758.07
[1,]                     0.998380
[2,]                     0.863026
[3,]                     0.668226
[4,]                     0.767662
[5,]                     0.360644
[6,]                     0.998380
> 
> ps2 <- pairedStat(list(lung))
> summary(ps2@nu.statistics)
 TCGA.38.4625.01A.01R.1758.07
 Min.   : 0.0000             
 1st Qu.: 0.3357             
 Median : 1.0023             
 Mean   : 1.2988             
 3rd Qu.: 1.9462             
 Max.   :18.4447             
> summary(ps2@p.values)
 TCGA.38.4625.01A.01R.1758.07
 Min.   :0.0000              
 1st Qu.:0.2724              
 Median :0.5706              
 Mean   :0.5562              
 3rd Qu.:0.8493              
 Max.   :1.0000              
> 
> summary(ps@nu.statistics - ps2@nu.statistics)
 TCGA.38.4625.01A.01R.1758.07
 Min.   :0                   
 1st Qu.:0                   
 Median :0                   
 Mean   :0                   
 3rd Qu.:0                   
 Max.   :0                   
> summary(pdiff <- ps@p.values - ps2@p.values)
 TCGA.38.4625.01A.01R.1758.07
 Min.   :-1.154e-03          
 1st Qu.:-5.720e-04          
 Median :-8.000e-05          
 Mean   : 1.053e-05          
 3rd Qu.: 5.060e-04          
 Max.   : 1.614e-03          
> 
> plot(ps@nu.statistics, pdiff)
> abline(h=0)
> 
> plot(ps)
> hist(ps)
> 
> proc.time()
   user  system elapsed 
   6.43    0.10    6.54 
