#In this dataset we are looking at Sales Transactions, from numerous amounts of Sales
#Reps selling numerous Amounts of Products

#The Goal of this is to analyze trasactions within the data to see if there are any
#attempts of Fraud by the salesreps


#Different types of variables
#ID of the sales rep
#Prod - unique identifyer of the product they are selling
#Quant - The Numer of units sold
#Val - The Reported total monetary value of the sale
#Insp -  Inspection, if this is OK, Fraud, or Unknown

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.0.5
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
data(sales, package = 'DMwR2')
sales
## # A tibble: 401,146 x 5
##    ID    Prod  Quant   Val Insp 
##    <fct> <fct> <int> <dbl> <fct>
##  1 v1    p1      182  1665 unkn 
##  2 v2    p1     3072  8780 unkn 
##  3 v3    p1    20393 76990 unkn 
##  4 v4    p1      112  1100 unkn 
##  5 v3    p1     6164 20260 unkn 
##  6 v5    p2      104  1155 unkn 
##  7 v6    p2      350  5680 unkn 
##  8 v7    p2      200  4010 unkn 
##  9 v8    p2      233  2855 unkn 
## 10 v9    p2      118  1175 unkn 
## # ... with 401,136 more rows
summary(sales)
##        ID              Prod            Quant                Val         
##  v431   : 10159   p1125  :  3923   Min.   :      100   Min.   :   1005  
##  v54    :  6017   p3774  :  1824   1st Qu.:      107   1st Qu.:   1345  
##  v426   :  3902   p1437  :  1720   Median :      168   Median :   2675  
##  v1679  :  3016   p1917  :  1702   Mean   :     8442   Mean   :  14617  
##  v1085  :  3001   p4089  :  1598   3rd Qu.:      738   3rd Qu.:   8680  
##  v1183  :  2642   p2742  :  1519   Max.   :473883883   Max.   :4642955  
##  (Other):372409   (Other):388860   NA's   :13842       NA's   :1182     
##     Insp       
##  ok   : 14462  
##  unkn :385414  
##  fraud:  1270  
##                
##                
##                
## 
nlevels(sales$ID)
## [1] 6016
nlevels(sales$Prod)
## [1] 4548
filter(sales, is.na(Quant), is.na(Val))
## # A tibble: 888 x 5
##    ID    Prod  Quant   Val Insp 
##    <fct> <fct> <int> <dbl> <fct>
##  1 v29   p808     NA    NA unkn 
##  2 v453  p921     NA    NA unkn 
##  3 v431  p1035    NA    NA unkn 
##  4 v431  p1       NA    NA unkn 
##  5 v431  p1       NA    NA unkn 
##  6 v1039 p1101    NA    NA unkn 
##  7 v1158 p1101    NA    NA unkn 
##  8 v1183 p1103    NA    NA unkn 
##  9 v709  p1125    NA    NA ok   
## 10 v426  p1190    NA    NA unkn 
## # ... with 878 more rows
#Number of fraud detection is very low in the inspection column, this is a very small proportion

table(sales$Insp) /nrow(sales) *100
## 
##        ok      unkn     fraud 
##  3.605171 96.078236  0.316593
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
ggplot(group_by(sales,ID) %>% summarize(nTrans=n()),aes(x=ID,y=nTrans)) +
  geom_bar(stat="identity") +
  theme(axis.text.x = element_blank(), axis.ticks.x=element_blank()) +
  xlab("Salesmen") + ylab("Nr. of Transactions") +
  ggtitle("Nr. of Transactions per Salesman")

 ggplot(group_by(sales,Prod) %>% summarize(nTrans=n()),aes(x=Prod,y=nTrans)) +
  geom_bar(stat="identity") +
  theme(axis.text.x = element_blank(), axis.ticks.x=element_blank()) +
  xlab("Product") + ylab("Nr. of Transactions") +
  ggtitle("Nr. of Transactions per Product")

 #Lets get Unit Price because each transaction sells a different amount of units
 sales <- mutate(sales, Uprice = Val/Quant)

 summary(sales$Uprice)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
##     0.00     8.46    11.89    20.30    19.11 26460.70    14136
#Some products have very few transactions, 4,548 products, 982 have less than 20 transactions
#Lets get the most expensive and cheapest products
 
prods <- group_by(sales,Prod)
mpProds <- summarize(prods,medianPrice = median(Uprice, na.rm = TRUE))
bind_cols(mpProds %>% arrange(medianPrice) %>% slice(1:5),
          mpProds %>% arrange(desc(medianPrice)) %>% slice(1:5))
## New names:
## * Prod -> Prod...1
## * medianPrice -> medianPrice...2
## * Prod -> Prod...3
## * medianPrice -> medianPrice...4
## # A tibble: 5 x 4
##   Prod...1 medianPrice...2 Prod...3 medianPrice...4
##   <fct>              <dbl> <fct>              <dbl>
## 1 p560              0.0169 p3689              9204.
## 2 p559              0.0188 p2453               456.
## 3 p4195             0.0303 p2452               329.
## 4 p601              0.0552 p2456               305.
## 5 p563              0.0558 p2459               284.
#THe distributiion of unit prices for the cheapest and most expensive products.
#We use log scale to avoid the valuyes of the cheapest product becoming indistringuishable

library(ggplot2)
library(forcats)
## Warning: package 'forcats' was built under R version 4.0.5
ggplot(filter(sales,Prod %in% c('p3689', 'p560')), aes(x=fct_drop(Prod), y=Uprice)) +
  geom_boxplot() + scale_y_log10() +
  xlab('') + ylab('log10(UnitPrice)')
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).

#Sales people who bring more (less) money to the company

ids <- group_by(sales, ID)
tvIDs <- summarize(ids, totalVal = sum(Val, na.rm = TRUE))
bind_cols(tvIDs %>% arrange(totalVal) %>% slice(1:5),
          tvIDs %>% arrange(desc(totalVal)) %>% slice(1:5))
## New names:
## * ID -> ID...1
## * totalVal -> totalVal...2
## * ID -> ID...3
## * totalVal -> totalVal...4
## # A tibble: 5 x 4
##   ID...1 totalVal...2 ID...3 totalVal...4
##   <fct>         <dbl> <fct>         <dbl>
## 1 v3355          1050 v431      211489170
## 2 v6069          1080 v54       139322315
## 3 v5876          1115 v19        71983200
## 4 v6058          1115 v4520      64398195
## 5 v4515          1125 v955       63182215
#Top 100 people on this account for almost 40% of income of the company while the bottom
#2,000 out of the 6,016 generate less than 2% of the income


arrange(tvIDs,desc(totalVal)) %>% slice(1:100) %>%
  summarize(t100=sum(totalVal)) /
  (summarize(tvIDs,sum(totalVal))) * 100
##       t100
## 1 38.33277
arrange(tvIDs,totalVal) %>% slice(1:2000) %>%
  summarize(b2000=sum(totalVal)) /
  (summarize(tvIDs,sum(totalVal))) * 100
##      b2000
## 1 1.988716
#Carrying out a similiar analysis in terms of the qwuanitity that is sold for each product

prods <- group_by(sales,Prod)
qtProds <- summarize(prods, totalQty = sum(Quant, na.rm = TRUE))
bind_cols(qtProds %>% arrange(desc(totalQty)) %>% slice(1:5),
          qtProds %>% arrange(totalQty) %>% slice(1:5))
## New names:
## * Prod -> Prod...1
## * totalQty -> totalQty...2
## * Prod -> Prod...3
## * totalQty -> totalQty...4
## # A tibble: 5 x 4
##   Prod...1 totalQty...2 Prod...3 totalQty...4
##   <fct>           <int> <fct>           <int>
## 1 p2516       535301953 p2442               0
## 2 p3599       474050752 p2443               0
## 3 p314        367166615 p1653             108
## 4 p569        107686551 p4101             202
## 5 p319         86818285 p3678             405
arrange(qtProds,desc(totalQty)) %>% slice(1:100) %>%
  summarize(t100=sum(as.numeric(totalQty))) /
  (summarize(qtProds,sum(as.numeric(totalQty)))) * 100
##       t100
## 1 74.63478
arrange(qtProds,totalQty) %>% slice(1:4000) %>%
  summarize(b4000=sum(as.numeric(totalQty))) /
  (summarize(qtProds,sum(as.numeric(totalQty)))) * 100
##      b4000
## 1 8.944681
#Anything out in boxplot.stats is considered an outlier

nouts <- function (x) length(boxplot.stats(x)$out)
noutsProds <- summarise(prods, nOut = nouts(Uprice))
arrange(noutsProds, desc(nOut))
## # A tibble: 4,548 x 2
##    Prod   nOut
##    <fct> <int>
##  1 p1125   376
##  2 p1437   181
##  3 p2273   165
##  4 p1917   156
##  5 p1918   156
##  6 p4089   137
##  7 p538    129
##  8 p3774   125
##  9 p2742   120
## 10 p3338   117
## # ... with 4,538 more rows
#Around 29,000 of our transactions are outliers which is 7% of our data

sum(noutsProds$nOut)
## [1] 29446
sum(noutsProds$nOut) / nrow(sales) *100
## [1] 7.34047
#Our main concern are transactions that have both the missing value of Quant and Val.
#THis below will look at transactions with unknowns on both Val and Quant


prop.naQandV <- function(q,v) 100*sum(is.na(q) & is.na(v)) / length(q)
summarise(ids, nProbs = prop.naQandV(Quant,Val)) %>% arrange(desc(nProbs))
## # A tibble: 6,016 x 2
##    ID    nProbs
##    <fct>  <dbl>
##  1 v1237  13.8 
##  2 v4254   9.52
##  3 v4038   8.33
##  4 v5248   8.33
##  5 v3666   6.67
##  6 v4433   6.25
##  7 v4170   5.56
##  8 v4926   5.56
##  9 v4664   5.49
## 10 v4642   4.76
## # ... with 6,006 more rows
#Looking at respect to the products
summarise(prods, nProbs = prop.naQandV(Quant,Val)) %>% arrange(desc(nProbs))
## # A tibble: 4,548 x 2
##    Prod  nProbs
##    <fct>  <dbl>
##  1 p2689   39.3
##  2 p2675   35.4
##  3 p4061   25  
##  4 p2780   22.7
##  5 p4351   18.2
##  6 p2686   16.7
##  7 p2707   14.3
##  8 p2690   14.1
##  9 p2691   12.9
## 10 p2670   12.8
## # ... with 4,538 more rows
#The option of removing all transactions wiht unknown values on both quantity and the value
#is the best option we have

sales <- filter(sales, !(is.na(Quant) & is.na(Val)))

#Analyze the remaining reporta with unkown values in either quanity or value of transaction

prop.nas <- function(x) 100*sum(is.na(x)) / length(x)
summarise(prods, propNA.Q = prop.nas(Quant)) %>% arrange(desc(propNA.Q))
## # A tibble: 4,548 x 2
##    Prod  propNA.Q
##    <fct>    <dbl>
##  1 p2442    100  
##  2 p2443    100  
##  3 p1653     90.9
##  4 p4101     85.7
##  5 p4243     68.4
##  6 p903      66.7
##  7 p3678     66.7
##  8 p4061     66.7
##  9 p3955     64.3
## 10 p4313     63.6
## # ... with 4,538 more rows
#Looking into two products (p2442 and p2443 that have all of their transactions with 
#unknown values of the quantity)

filter(sales, Prod %in% c('p2242', 'p2443')) %>%
  group_by(Insp) %>% count()
## # A tibble: 3 x 2
## # Groups:   Insp [3]
##   Insp      n
##   <fct> <int>
## 1 ok        1
## 2 unkn     32
## 3 fraud     2
#We will delete them

sales <- droplevels(filter(sales, !(Prod %in% c('p2242', 'p2443'))))
#Are there sales people with all transactions with an unknown quality
summarise(ids, propNA.Q = prop.nas(Quant)) %>% arrange(desc(propNA.Q))
## # A tibble: 6,016 x 2
##    ID    propNA.Q
##    <fct>    <dbl>
##  1 v2925    100  
##  2 v4356    100  
##  3 v5537    100  
##  4 v5836    100  
##  5 v6044    100  
##  6 v6058    100  
##  7 v6065    100  
##  8 v2923     90  
##  9 v4368     88.9
## 10 v2920     85.7
## # ... with 6,006 more rows
#Carrying out similiar analysis for the value column
summarise(prods, propNA.V = prop.nas(Val)) %>% arrange(desc(propNA.V))
## # A tibble: 4,548 x 2
##    Prod  propNA.V
##    <fct>    <dbl>
##  1 p2689     39.3
##  2 p2675     35.4
##  3 p1110     25  
##  4 p4061     25  
##  5 p2780     22.7
##  6 p4351     18.2
##  7 p4491     18.2
##  8 p2707     17.9
##  9 p1462     17.8
## 10 p1022     17.6
## # ... with 4,538 more rows
#Now with respect to the sales person
summarise(ids, propNA.V = prop.nas(Val)) %>% arrange(desc(propNA.V))
## # A tibble: 6,016 x 2
##    ID    propNA.V
##    <fct>    <dbl>
##  1 v5647    37.5 
##  2 v74      22.2 
##  3 v5946    20   
##  4 v5290    15.4 
##  5 v4022    14.0 
##  6 v1237    13.8 
##  7 v4472    12.5 
##  8 v975      9.57
##  9 v4254     9.52
## 10 v2814     9.09
## # ... with 6,006 more rows
#Proportions are not too high, At this stage we have removed all reports that had insufficient
#information, for remaining NA values, we will start by obtaining typical unit price 
#for each product. We will use the edian unit price of the transactions as typical price
#of respective products

tPrice <- filter(sales, Insp != 'fraud') %>%
  group_by(Prod) %>%
  summarise(medianPrice = median(Uprice, nana.rm = TRUE))
#We now have a typical unit price for each product, we can use it to calculate any of the two 
#possibly missing values. We can do this because we currently do not have transactions with both missing values

noQuantMedPrices <- filter(sales, is.na(Quant)) %>%
  inner_join(tPrice) %>%
  select(medianPrice)
## Joining, by = "Prod"
noValMedPrice <- filter(sales, is.na(Val)) %>%
  inner_join(tPrice) %>%
  select(medianPrice)
## Joining, by = "Prod"
noQuant <- which(is.na(sales$Quant))
noVal <- which(is.na(sales$Val))

sales[noQuant, 'Quant'] <- ceiling(sales[noQuant, 'Val'] / noQuantMedPrices)
sales[noVal, 'Val'] <- sales[noVal,'Quant'] *noValMedPrice


sales$Uprice <- sales$Val / sales$Quant
ms <- filter(sales, Insp != 'fraud') %>%
  group_by(Prod) %>%
  summarize(median = median(Uprice, na.rm = TRUE),
            iqr = IQR(Uprice, na.rm = TRUE),
            nTrans = n(),
            fewTrans = ifelse(nTrans>20, FALSE,TRUE))

ms
## # A tibble: 4,546 x 5
##    Prod  median    iqr nTrans fewTrans
##    <fct>  <dbl>  <dbl>  <int> <lgl>   
##  1 p1     11.4  10.4      196 FALSE   
##  2 p2     10.9   5.61      81 FALSE   
##  3 p3     10     5.73      31 FALSE   
##  4 p4      9.91  6.00     111 FALSE   
##  5 p5     11     8.30     161 FALSE   
##  6 p6     13.3   6.97      63 FALSE   
##  7 p7      4.85  0.547     52 FALSE   
##  8 p8      3.85  0.728     11 TRUE    
##  9 p9      1.94  0.343     38 FALSE   
## 10 p10    42.2  33.0       38 FALSE   
## # ... with 4,536 more rows
ggplot(ms,aes(x=median,y=iqr, color = fewTrans)) +
  geom_point() + 
  xlab('Median') + ylab('IQR')
## Warning: Removed 1 rows containing missing values (geom_point).

ggplot(ms,aes(x=median,y=iqr, color = fewTrans)) +
  geom_point() + 
  scale_y_log10() + scale_x_log10() +
  xlab('log(Median)') + ylab('log(IQR)')
## Warning: Transformation introduced infinite values in continuous y-axis
## Removed 1 rows containing missing values (geom_point).

#We will use a non paramentric test to compare distributions of unit prices
#Kolmoorov_Sminorv test used to test the validitiy of the null hypothesis, both come from the same distribution
#If two distributiuons are similiar are calculated from statistic, the distance should be small
#For each product with few transactions, we have searcheded for the product with the most similiar  media and IQR

ms <- mutate(ms, smedian = scale(median), siqr = scale(iqr))
smalls <- which(ms$fewTrans)
nsmalls <- as.character(ms$Prod[smalls])

similar <- matrix(data = NA, length(smalls),7,dimnames = list(nsmalls,
                                  c('RowSimProd,', 'ks.stat',
                                    'ks.p', 'medP', 'iqrP', 'medS',
                                    'iqrS')))
xprods <- tapply(sales$Uprice, sales$Prod, list)

for(i in seq_along(smalls)) {
  d <- scale(ms[,c("smedian","siqr")],
             c(ms$smedian[smalls[i]],ms$siqr[smalls[i]]),
             FALSE)
  d <- sqrt(drop(d^2 %*% rep(1, ncol(d))))
  stat <- ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]])
  similar[i, ] <- c(order(d)[2], stat$statistic, stat$p.value,
                    ms$median[smalls[i]],ms$iqr[smalls[i]],
                    ms$median[order(d)[2]],ms$iqr[order(d)[2]])
}
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): p-value will be
## approximate in the presence of ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): p-value will be
## approximate in the presence of ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): p-value will be
## approximate in the presence of ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): p-value will be
## approximate in the presence of ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): p-value will be
## approximate in the presence of ties
## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties

## Warning in ks.test(xprods[[nsmalls[i]]], xprods[[order(d)[2]]]): cannot compute
## exact p-value with ties
head(similar)
##     RowSimProd,   ks.stat      ks.p     medP      iqrP     medS      iqrS
## p8         2564 0.3286713 0.5404426 3.850211 0.7282168 3.889186 0.6903691
## p18         213 0.2568922 0.2581586 5.187266 8.0359968 5.274884 7.8207052
## p38        1044 0.3650794 0.1130832 5.490758 6.4162095 5.651818 6.2436224
## p39        2655 0.3701299 0.3675215 7.986486 1.4229755 7.904192 1.3410302
## p40        3971 0.3333333 0.1389203 9.674797 1.6104511 9.668854 1.5109890
## p47        1387 0.3125000 0.4854058 2.504092 2.5625835 2.413498 2.6402087
bind_rows(filter(ms,Prod==rownames(similar)[1]),
          ms[similar[1,1],])
## # A tibble: 2 x 7
##   Prod  median   iqr nTrans fewTrans smedian[,1] siqr[,1]
##   <fct>  <dbl> <dbl>  <int> <lgl>          <dbl>    <dbl>
## 1 p8      3.85 0.728     11 TRUE         -0.0813  -0.0719
## 2 p2566   3.89 0.690     13 TRUE         -0.0810  -0.0721
nrow(similar[similar[,'ks.p'] >= 0.9, ])
## [1] 145
sum(similar[,'ks.p'] >= .9)
## [1] 145
#Precision and Recall curves are visual representations of the performance of a model
#n Terms of position and recall statistics
#These working points can be given by different cut off limits
#ROCR is a package that contains several functions that are very useful for evaluating binary classifiers
#Plot can give us different performances curves

library(ROCR)
## Warning: package 'ROCR' was built under R version 4.0.5
data("ROCR.simple")
pred <- prediction(ROCR.simple$predictions, ROCR.simple$labels)
perf <- performance(pred,'prec', 'rec')

plot(perf)

PRcurve <- function(preds, trues,...) {
  require(ROCR, quietly = TRUE)
  pd <- prediction(preds, trues)
  pf <- performance(pd,'prec','rec')
  pf@y.values <- lapply(pf@y.values, function(x) rev(cummax(rev(x))))
  plot(pf, ...)
}


PRcurve(ROCR.simple$predictions, ROCR.simple$labels)

#Lift charts provide a different perspective of the model predictions.
# X axis is the rate of positive predictions, which is the probability that model
#predicts a positive class
#This estimated by the proportion of positive class predictions dived by the total number
#of test cases, Y axis is the value of recall divded by the value of RPP


pred <- prediction(ROCR.simple$predictions, ROCR.simple$labels)
perf <- performance(pred, "lift", "rpp")
plot(perf, main = "Lift Chart")

#SHows the recall values in terms of the inspection effort that is captured by the RPP
#Cumulative Recall Chart

CRchart <- function(preds, trues, ...) {
  require(ROCR, quietly = T)
  pd <- prediction(preds, trues)
  pf <- performance(pd, "rec", "rpp")
  plot(pf, ...)
}

CRchart(ROCR.simple$predictions, ROCR.simple$labels, 
        main='Cumulative Recall Chart')

#Normalized Distance to Typical Price


avgNDTP <- function(toInsp,train,stats) {
  if (missing(train) && missing(stats)) 
    stop('Provide either the training data or the product stats')
  if (missing(stats)) {
    stats <- as.matrix(filter(train,Insp != 'fraud') %>%
                         group_by(Prod) %>%
                         summarise(median=median(Uprice),iqr=IQR(Uprice)) %>%
                         select(median,iqr))
    rownames(stats) <- levels(train$Prod)
    stats[which(stats[,'iqr']==0),'iqr'] <- stats[which(stats[,'iqr']==0),'median']
  }
  
  return(mean(abs(toInsp$Uprice-stats[toInsp$Prod,'median']) /
                stats[toInsp$Prod,'iqr']))
}
#Random Stratified Sample
evalOutlierRanking <- function(testSet,rankOrder,Threshold,statsProds,...) 
{
  ordTS <- testSet[rankOrder,]
  N <- nrow(testSet)
  nF <- if (Threshold < 1) as.integer(Threshold*N) else Threshold
  cm <- table(c(rep('fraud',nF),rep('ok',N-nF)),ordTS$Insp)
  prec <- cm['fraud','fraud']/sum(cm['fraud',])
  rec <- cm['fraud','fraud']/sum(cm[,'fraud'])
  AVGndtp <- avgNDTP(ordTS[1:nF,],stats=statsProds)
  return(c(Precision=prec,Recall=rec,avgNDTP=AVGndtp))
}
#Unsupervised Approaches
#NDTP is a unitless metric and can mix together the values for the different products
#To get a scaled ranking for each product
#Gives a ranking order and score for potential outliers



BPrule.wf <- function(form,train,test,...) {
    require(dplyr, quietly=TRUE)
    ms <- as.matrix(filter(train,Insp != 'fraud') %>%
                    group_by(Prod) %>%
                    summarise(median=median(Uprice),iqr=IQR(Uprice)) %>%
                    select(median,iqr))
    rownames(ms) <- levels(train$Prod)
    ms[which(ms[,'iqr']==0),'iqr'] <- ms[which(ms[,'iqr']==0),'median']
    ORscore <- abs(test$Uprice-ms[test$Prod,'median']) /
               ms[test$Prod,'iqr']
    rankOrder <- order(ORscore,decreasing=TRUE)
    res <- list(testSet=test,rankOrder=rankOrder,
                probs=matrix(c(ORscore,ifelse(test$Insp=='fraud',1,0)),
                             ncol=2))
    res
}