Running 'test.pleio.glm.test.R' [176s]
Running the tests in 'tests/test.pleio.glm.test.R' failed.
Complete output:
  > ## test script for pleio (pleiotropy R package)
  > 
  > require(pleio)
  Loading required package: pleio
  Loading required package: rms
  Loading required package: Hmisc
  
  Attaching package: 'Hmisc'
  
  The following objects are masked from 'package:base':
  
      format.pval, units
  
  Loading required package: Matrix
  > data("pleio.demo")
  > 
  > 
  > ## test without covars
  > fams <- c("gaussian","binomial","ordinal")
  > obj <- pleio.glm.fit(y, geno, glm.family=fams)
  > stat <- pleio.glm.test(obj, count.nonzero.coef = 0)
  > stat$stat
  [1] 4.191602
  > stat$pval
  [1] 0.241504
  > pleio.glm.sequential(obj, pval.threshold=.5)
  $pval
  [1] 0.531151
  
  $count
  [1] 2
  
  $index.nonzero.coef
  [1] 1 2
  
  > 
  > ## test with covars
  > 
  > 
  > ## length of index.cov must be the number of traits,
  > ## no. cols of y
  > 
  > index.cov <- list()
  > ## cols 1 and 2 are covariates for trait 1, etc.
  > index.cov[[1]] <- c(1:2)
  > index.cov[[2]] <- c(2:4)
  > index.cov[[3]] <- c(4,5)
  > 
  > obj <- pleio.glm.fit(y, geno, glm.family=fams, x.all=x, x.index.list=index.cov)
  > stat <- pleio.glm.test(obj, count.nonzero.coef = 0)
  > stat$stat
  [1] 3.974983
  > stat$pval
  [1] 0.2641783
  > 
  > plseq <- pleio.glm.sequential(obj, pval.threshold=.52)
  > print(plseq)
  $pval
  [1] 0.5272492
  
  $count
  [1] 2
  
  $index.nonzero.coef
  [1] 1 2
  
  > 
  > ## test with other numbers of covariates
  > ## if no covariates for one of the traits, breaks
  > index.cov[[1]] <- 1:2
  > index.cov[[2]] <- 2:4
  > index.cov[[3]] <- 0
  > ## index.cov[[3]] <- c(3,4)
  > ## Used to get an error, now works
  > obj <- pleio.glm.fit(y, geno, glm.family=fams, x.all=x, x.index.list=index.cov)
  > stat <- pleio.glm.test(obj, count.nonzero.coef = 0)
  > stat$stat
  [1] 3.957769
  > stat$pval
  [1] 0.2660606
  > 
  > plseq <- pleio.glm.sequential(obj, pval.threshold=.55)
  > print(plseq)
  $pval
  [1] 1
  
  $count
  [1] 3
  
  $index.nonzero.coef
  [1] 1 2 3
  
  > 
  > ## should return all NA results
  > gmono <- rep(1, nrow(y))
  > obj <- pleio.glm.fit(y, gmono, glm.family=fams, x.all=x, x.index.list=index.cov)
  Warning message:
  In pleio.glm.fit(y, gmono, glm.family = fams, x.all = x, x.index.list = index.cov) :
    genotypes (g) are all the same
  > stat <- pleio.glm.test(obj, count.nonzero.coef = 0)
  > stat$stat
  [1] NA
  > stat$pval
  [1] NA
  > 
  > plseq <- pleio.glm.sequential(obj, pval.threshold=.6)
  > print(plseq)
  $pval
  [1] NA
  
  $count
  [1] NA
  
  $index.nonzero.coef
  [1] NA
  
  > 
  > 
  > ## used to give an error passing data.frame , but fixed to allow matrix and df 10/1/18
  > xdf <- as.data.frame(x)
  > ydf <- as.data.frame(y)
  > objdf <- pleio.glm.fit(ydf, geno, glm.family=fams, x.all=xdf, x.index.list=index.cov)
  > 
  > plseq <- pleio.glm.sequential(objdf, pval.threshold=.55)
  > print(plseq)
  $pval
  [1] 1
  
  $count
  [1] 3
  
  $index.nonzero.coef
  [1] 1 2 3
  
  > 
  > proc.time()
     user  system elapsed 
     3.01    0.54    3.54