Running ‘test_NpdeLib.R’ [8s/10s]
Running the tests in ‘tests/test_NpdeLib.R’ failed.
Complete output:
  > library(npde)
  Loading required package: mclust
  Package 'mclust' version 5.4
  Type 'citation("mclust")' for citing this R package in publications.
       Loading library npde, version 2.0, August 2012
           please direct bugs, questions and feedback to emmanuelle.comets@inserm.fr
  
  > cat("Running tests for the main computational functions\n")
  Running tests for the main computational functions
  > 
  > data(theopp)
  > data(simtheopp)
  > 
  > xbase1<-autonpde(namobs=theopp,namsim=simtheopp,boolsave=FALSE)
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.0668   (SE= 0.095 )
         variance= 1.074   (SE= 0.14 )
         skewness= 0.511 
         kurtosis= 0.2912 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.481
    Fisher variance test       : 0.55
    SW test of normality       : 0.00273 **
  Global adjusted p-value      : 0.00819 **
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > # Cholesky decomposition
  > xbase1<-autonpde(namobs=theopp,namsim=simtheopp, iid=1,ix=3,iy=4,imdv=0,icens=0,icov=0,boolsave=TRUE,type.graph="eps",
  + namsav="base1",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky", cens.method="omit",units=list(x="hr",y="mg/L"))
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.0668   (SE= 0.095 )
         variance= 1.074   (SE= 0.14 )
         skewness= 0.511 
         kurtosis= 0.2912 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.481
    Fisher variance test       : 0.55
    SW test of normality       : 0.00273 **
  Global adjusted p-value      : 0.00819 **
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > # Decorrelation through the inverse method
  > xbase2<-autonpde(namobs=theopp,namsim=simtheopp, iid=1,ix=3,iy=4,imdv=0,icens=0,icov=0,boolsave=TRUE,type.graph="eps",
  + namsav="base2",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="inverse", cens.method="omit",units=list(x="hr",y="mg/L"))
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= -0.03046   (SE= 0.096 )
         variance= 1.099   (SE= 0.14 )
         skewness= 0.1654 
         kurtosis= 0.9206 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.751
    Fisher variance test       : 0.435
    SW test of normality       : 0.000461 ***
  Global adjusted p-value      : 0.00138 **
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > idx<-xbase1@data@not.miss
  > ytest1<-max(abs(xbase1@results@res$pd[idx]-xbase2@results@res$pd[idx]))
  > 
  > if(zapsmall(ytest1)==0) cat("Cholesky/inverse method: same pd, test successful\n") else cat("Problem with xbase1/xbase2\n")
  Cholesky/inverse method: same pd, test successful
  > 
  > ####### With censoring
  > 
  > dat3<-theopp
  > vec<-rep(1,dim(dat3)[1])
  > loq<-2
  > vec[!is.na(dat3$Conc) & dat3$Conc>=loq]<-0
  > dat3$Conc[!is.na(dat3$Conc) & vec==1]<-loq
  > sex<-ifelse(dat3$Wt>70,"M","F")
  > dat3<-cbind(dat3,Sex=sex,MDV=rep(0,dim(dat3)[1]),cens=vec)
  > 
  > dat4<-dat3
  > dat4$ipred<-dat4$Conc*(1+rnorm(dim(dat4)[1],0,0.1))
  > 
  > # Removing censored data
  > xcens1<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),boolsave=TRUE,type.graph="eps",namsav="cens1",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky",cens.method="omit")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 105 
             mean= 0.1126   (SE= 0.098 )
         variance= 1.009   (SE= 0.14 )
         skewness= 0.4966 
         kurtosis= 0.3645 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.254
    Fisher variance test       : 0.911
    SW test of normality       : 0.0085 **
  Global adjusted p-value      : 0.0255 *
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > ##### Imputing pd for censored data
  > ## default method (cdf)
  > xcens2<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),boolsave=TRUE,type.graph="eps",namsav="cens2",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky",cens.method="cdf")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.07429   (SE= 0.096 )
         variance= 1.104   (SE= 0.14 )
         skewness= 0.41 
         kurtosis= 0.1247 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.44
    Fisher variance test       : 0.414
    SW test of normality       : 0.0128 *
  Global adjusted p-value      : 0.0384 *
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > ## method ipred (automatic detection of ipred)
  > xipred<-autonpde(namobs=dat4,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),boolsave=TRUE,type.graph="eps", namsav="ipred1",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky",cens.method="ipred")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.229   (SE= 0.1 )
         variance= 1.253   (SE= 0.16 )
         skewness= 0.5223 
         kurtosis= -0.202 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.0268 *
    Fisher variance test       : 0.0643 .
    SW test of normality       : 0.00026 ***
  Global adjusted p-value      : 0.00078 ***
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > ## method loq
  > xloq<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),boolsave=TRUE,type.graph="eps",namsav="loq1",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky",cens.method="loq")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.2463   (SE= 0.1 )
         variance= 1.259   (SE= 0.16 )
         skewness= 0.4722 
         kurtosis= -0.2501 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.0177 *
    Fisher variance test       : 0.0587 .
    SW test of normality       : 0.000901 ***
  Global adjusted p-value      : 0.0027 **
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > ## method ypred
  > xypred<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),boolsave=TRUE,type.graph="eps",namsav="ypred1",calc.pd=TRUE,calc.npde=TRUE,verbose=FALSE,decorr.method="cholesky",cens.method="ypred")
  Warning: Censoring method ypred unavailable, switching to default method (cdf)
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.04545   (SE= 0.094 )
         variance= 1.059   (SE= 0.14 )
         skewness= 0.477 
         kurtosis= 0.4241 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.629
    Fisher variance test       : 0.623
    SW test of normality       : 0.00378 **
  Global adjusted p-value      : 0.0113 *
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > # Automatic column recognition
  > # xdetect<-autonpde(namobs=dat4,namsim=simtheopp,icov=c(5,6), namsav="idetect"))
  > 
  > # Without all defaults
  > xcens1.bis<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),namsav="cens1.bis",cens.method="omit")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 105 
             mean= 0.1126   (SE= 0.098 )
         variance= 1.009   (SE= 0.14 )
         skewness= 0.4966 
         kurtosis= 0.3645 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.254
    Fisher variance test       : 0.911
    SW test of normality       : 0.0085 **
  Global adjusted p-value      : 0.0255 *
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > xcens2.bis<-autonpde(namobs=dat3,namsim=simtheopp,iid=1,ix=3,iy=4, imdv=7,icens=8,icov=c(5,6),namsav="cens2.bis")
  ---------------------------------------------
  Distribution of npde :
        nb of obs: 120 
             mean= 0.08003   (SE= 0.095 )
         variance= 1.077   (SE= 0.14 )
         skewness= 0.4858 
         kurtosis= 0.1382 
  ---------------------------------------------
  
  Statistical tests
    t-test                     : 0.4
    Fisher variance test       : 0.533
    SW test of normality       : 0.00605 **
  Global adjusted p-value      : 0.0181 *
  ---
  Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
  ---------------------------------------------
  > 
  > idx<-(dat3$MDV==0 & dat3$cens==0)
  > ytest1<-max(abs(xcens1@results@res$pd[idx]-xcens1.bis@results@res$pd[idx]))
  > 
  > ytest2<-max(abs(xcens2@results@res$pd[idx]-xcens2.bis@results@res$pd[idx]))
  > 
  > ytest3<-max(abs(xcens2@results@res$pd[idx]-xipred@results@res$pd[idx]))
  > 
  > if(zapsmall(ytest1+ytest2+ytest3)==0) cat("Test with censoring successful \n") else cat("Different results, check defaults\n")
  Test with censoring successful 
  > 
  > cat("Testing gof.test function\n")
  Testing gof.test function
  > 
  > gof.test(xbase1)
  Error in UseMethod("gof.test") : 
    no applicable method for 'gof.test' applied to an object of class "NpdeObject"
  Calls: gof.test -> gof.test
  Execution halted