Running examples in ‘weightedRank-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: dwgtRank
> ### Title: Weighted Rank Statistics for Evidence Factors with Two Control
> ###   Groups
> ### Aliases: dwgtRank
> ### Keywords: nonparametric htest
> 
> ### ** Examples
> 
> # The calculation below reproduce analyses from Rosenbaum (2023b).
> 
> data(aBP)
> attach(aBP)
> 
> yD<-t(matrix(bpDiastolic,3,207))
> yS<-t(matrix(bpSystolic,3,207))
> vS<-c(yS[,1]-yS[,2],yS[,1]-yS[,3],yS[,2]-yS[,3])
> vD<-c(yD[,1]-yD[,2],yD[,1]-yD[,3],yD[,2]-yD[,3])
> y<-(yD/median(abs(vD)))+(yS/median(abs(vS)))
> 
> # The following analysis contrasts the second P control
> # with the pooled group consisting of the treated B
> # binge drinker and the N control.  That contrast creates
> # a second evidence factor, not redundant with the comparison
> # of B and N, yet avoids dilution of the effect by using
> # a statistic like that of Conover and Salsburg (1988)
> # that allows for nonresponders.
> 
> # SECOND EVIDENCE FACTOR: CONTROL2 VS TREATED+CONTROL1
> dwgtRank(y[,3:1],gamma=1.45,alternative="less",
+      scores=c(1,2,5),range=FALSE,m=8,m1=8,m2=8)
$pval
[1] 0.04805611

$detail
      Deviate     Statistic   Expectation      Variance         Gamma 
-1.6640010016  0.2572228338  0.3055030327  0.0008418427  1.4500000000 

> 
> amplify(1.45, 2.5)
2.5 
2.5 
> 
> # This is a much less sensitive result than is obtained
> # from the stratified Wilcoxon rank sum statistic wiht
> # I strata,
> 
> dwgtRank(y[,3:1],gamma=1.45,alternative="less",
+           scores=c(1,2,3),m=1,m1=1,m2=1)
$pval
[1] 0.933545

$detail
    Deviate   Statistic Expectation    Variance       Gamma 
1.502724798 1.956521739 1.869565217 0.003348462 1.450000000 

> 
> # and theory leads us to expect this difference
> # in performance of the two statistics; see Rosenbaum (2023b)
> 
> # EVIDENCE FACTOR ANALYSIS, COMBINING TWO FACTORS
> # The evidence factor analysis compares treated to the first control group,
> # then compares the second control group to the pooled group consisting of
> # treated and first control, then combines the two analyses using meta-analysis.
> # Treated/first-control matched pairs are compared using the method in
> # Rosenbaum (2011).
> 
> p1<-dwgtRank(y[,1:2],gamma=2.3,alternative="greater",
+           m=8,m1=7,m2=8)$pval
> p2<-dwgtRank(y[,3:1],gamma=1.45,alternative="less",
+           scores=c(1,2,5),range=FALSE,m=8,m1=8,m2=8)$pval
> c(p1,p2)
[1] 0.04597588 0.04805611
> sensitivitymv::truncatedP(c(p1,p2))
[1] 0.01214331
> amplify(2.3,4)
       4 
4.823529 
> amplify(1.45,2.5)
2.5 
2.5 
> 
> # THE COMBINED ANALYSIS IS INSENSITIVE TO LARGER BIASES
> # The combined analysis is insensitive to larger biases
> # than are its components
> p1<-dwgtRank(y[,1:2],gamma=2.6,alternative="greater",
+           m=8,m1=7,m2=8)$pval
> p2<-dwgtRank(y[,3:1],gamma=1.7,alternative="less",
+           scores=c(1,2,5),range=FALSE,m=8,m1=8,m2=8)$pval
> c(p1,p2)
[1] 0.1084381 0.1036220
> sensitivitymv::truncatedP(c(p1,p2))
[1] 0.04348223
> 
> amplify(2.6,5)
5 
5 
> amplify(1.7,3)
       3 
3.153846 
> 
> # CONNECTION WITH OTHER PACKAGES
> # Although dwgtRank() computes the matched pair P-value bound,
> dwgtRank(y[,1:2],gamma=2.3,alternative="greater",
+          m=8,m1=7,m2=8)$pval
[1] 0.04597588
> # a simpler way to do it uses senU() in the DOS2 package
> DOS2::senU(y[,1]-y[,2],m=8,m1=7,m2=8,gamma=2.3)
Error in loadNamespace(x) : there is no package called ‘DOS2’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted