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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: flip2sss
> ### Title: flipscores 2-Stage Summary Statistics approach
> ### Aliases: flip2sss
> 
> ### ** Examples
> 
> library(jointest)
> set.seed(123)
> # Simulate data
> N=20
> n=rpois(N,20)
> reff=rep(rnorm(N),n)
> 
> D=data.frame(X1=rnorm(length(reff)),
+              X2=rep(rnorm(N),n),
+              Grp=factor(rep(rep(LETTERS[1:3],length.out=N),n)),
+              Subj=rep(1:N,n))
> D$Y=rbinom(n=nrow(D),prob=plogis( 2*D$X1 * (D$Grp=="B") +  2*D$X2+reff),size=1)
> 
> # model of interest formula <- Y ~ Grp * X1 + X2
> # clusters structure defined by cluster <- factor(D$Subj)
> # The 2-Stage Summary Statistics via flipscore: 
> res <- flip2sss(Y ~ Grp * X1 + X2, data=D, 
+                cluster=D$Subj, family="binomial")
> summary(res)
        Model       Coeff   Estimate       Score Std. Error     z value
1 .Intercept. (Intercept)  4.3128538  29.0261330  24.152830  1.20176943
2 .Intercept.        GrpB -0.3824975  -1.1599283  15.511347 -0.07477934
3 .Intercept.        GrpC -1.7121985  -5.5300048  16.061350 -0.34430510
4 .Intercept.          X2  9.5446012 151.9594953  51.196709  2.96814969
5          X1          X1  0.2882803   2.0179621   2.658795  0.75897611
6          X1     GrpB:X1  1.1367411   3.9785937   2.073856  1.91845180
7          X1     GrpC:X1  0.1228905   0.3970308   1.779620  0.22309867
    Part. Cor      p
1  0.29147190 0.1682
2 -0.01813665 0.9400
3 -0.08350625 0.6882
4  0.71988204 0.0062
5  0.17889239 0.1894
6  0.45218343 0.0352
7  0.05258486 0.7872
> # This is an ANOVA-like overall test:
> summary(combine(res))
    Model Coeff Stat nTests        S      p
1 Overall  many maxT      7 151.9595 0.0062
> # This is an ANOVA-like test:
> summary(combine_contrasts(res))
        Model       Coeff        Stat nTests          S      p
1 .Intercept. (Intercept) Mahalanobis      1 0.02057700 0.1682
2 .Intercept.         Grp Mahalanobis      2 0.19176868 0.9276
3 .Intercept.          X2 Mahalanobis      1 0.03393411 0.0062
4          X1          X1 Mahalanobis      1 0.02096200 0.1894
5          X1      Grp:X1 Mahalanobis      2 3.69226237 0.1532
> 
> # An alternative and more flexible definition of the model:
> # Define the summary statistics (here we propose the glm with firth correction 
> # from the logistf package)
> summstats_within <- 'logistf::logistf(Y ~ X1, family = binomial(link = "logit"),
+ control=logistf::logistf.control(maxit=100))'
> # however also the classic glm function can be used:
> #summstats_within <- 'glm(Y ~ X1, family = binomial(link = "logit"))'
> 
> # Then, compute the 2-Stage Summary Statistics approach
> # specifying the summary statistics (within cluster/subject)
> res <- flip2sss(Y ~ Grp * X1 + X2, data=D, cluster=D$Subj, 
+                    summstats_within=summstats_within)
Error in loadNamespace(x) : there is no package called ‘logistf’
Calls: flip2sss ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted