* using log directory ‘/data/localhost/ripley/R/packages/tests-MKL/MRStdCRT.Rcheck’
* using R Under development (unstable) (2026-10-30 r90804)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2)
    GNU Fortran (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2)
* running under: Fedora Linux 44 (Server Edition)
* using session charset: UTF-8
* current time: 2026-10-30 16:48:37 UTC
* using option ‘--no-stop-on-test-error’
* checking for file ‘MRStdCRT/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘MRStdCRT’ version ‘0.1.3’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘MRStdCRT’ can be installed ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [11s/12s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘estimand-specific.R’
  Running ‘input-encoding.R’ [80s/84s]
  Running ‘log-inference.R’ [14s/15s]
  Running ‘regression.R’ [12s/12s]
  Running ‘weighted-models.R’ [104s/108s]
 [216s/226s] ERROR
Running the tests in ‘tests/estimand-specific.R’ failed.
Complete output:
  > library(MRStdCRT)
  > source(file.path("helpers", "weighted-reference.R"))
  > 
  > specific_unweighted_reference <- function(data, method, family, corstr,
  +                                            probability, interactions = FALSE) {
  +   d <- reference_data(data, probability)
  +   fixed <- outcome ~ intervention + within_x + between_x + H
  +   if (interactions) fixed <- update(fixed, . ~ . + intervention:within_x +
  +                                                        intervention:between_x)
  +   mixed <- update(fixed, . ~ . + (1 | reference_id))
  +   model <- switch(method,
  +     GEE = geepack::geeglm(fixed, d, id = reference_id,
  +                         family = family, corstr = corstr),
  +     LMM = nlme::lme(fixed, random = ~ 1 | reference_id, data = d),
  +     GLMM = if (family$family == "gaussian")
  +       lme4::lmer(mixed, data = d, REML = FALSE) else
  +       lme4::glmer(mixed, data = d, family = family))
  +   beta <- if (method == "GEE") coef(model) else lme4::fixef(model)
  +   tau2 <- if (method == "GLMM")
  +     as.data.frame(lme4::VarCorr(model))$vcov[1] else NA_real_
  +   predictions <- vapply(c(1, 0), function(a) {
  +     nd <- d
  +     nd$intervention <- a
  +     design <- model.matrix(fixed, nd)
  +     stopifnot(setequal(colnames(design), names(beta)))
  +     lp <- drop(design[, names(beta), drop = FALSE] %*% beta)
  +     if (method == "GEE") family$linkinv(lp)
  +     else if (method == "LMM" || family$family == "gaussian") lp
  +     else if (family$family == "binomial")
  +       plogis(lp / sqrt(1 + 3 * tau2 / pi^2))
  +     else exp(lp + tau2 / 2)
  +   }, numeric(nrow(d)))
  +   reference_aggregate(list(data = d, predictions = predictions))
  + }
  > 
  > specific_reference <- function(data, method, family, corstr, scale,
  +                                 probability = NULL, interactions = FALSE) {
  +   if (is.null(probability)) {
  +     assignments <- data$intervention[!duplicated(data$cluster)]
  +     probability <- rep(mean(assignments), nrow(data))
  +   }
  +   weighted <- reference_aggregate(reference_fitting(data, method, family,
  +     corstr, interactions = interactions, probability = probability))
  +   unweighted <- specific_unweighted_reference(data, method, family, corstr,
  +     probability, interactions)
  +   means <- rbind(cATE = weighted$means["cATE", ],
  +                  iATE = unweighted$means["iATE", ])
  +   list(effect = reference_effect(means, scale), means = means)
  + }
  > 
  > specific_deleted_reference <- function(data, method, family, corstr, scale,
  +                                         probability = NULL,
  +                                         interactions = FALSE) {
  +   t(vapply(unique(data$cluster), function(id) {
  +     keep <- data$cluster != id
  +     specific_reference(data[keep, ], method, family, corstr, scale,
  +       if (is.null(probability)) NULL else probability[keep], interactions)$effect
  +   }, numeric(3)))
  + }
  > 
  > specific_check <- function(data, corstr, scale, probability = NULL,
  +                             row_probability = probability,
  +                             interactions = FALSE) {
  +   family <- gaussian()
  +   alpha <- .10
  +   full <- specific_reference(data, "GEE", family, corstr, scale,
  +                               row_probability, interactions)
  +   deleted <- specific_deleted_reference(data, "GEE", family, corstr, scale,
  +                                           row_probability, interactions)
  +   expected <- reference_inference(full$effect, deleted, scale, alpha)
  +   formula <- if (interactions) outcome ~ intervention * x + H else
  +     outcome ~ intervention + x + H
  +   fit <- MRStdCRT_fit(formula, data, "cluster", "intervention", probability,
  +     family = family, method = "GEE", corstr = corstr, scale = scale,
  +     alpha = alpha, model_weights = "estimand_specific")
  +   assert_close(fit$estimate, expected$estimate)
  +   assert_close(fit$ics, expected$ics)
  +   stopifnot(identical(names(fit$ics), c("statistic", "p.value")),
  +             identical(fit$model_weights, "estimand_specific"),
  +             identical(rownames(fit$estimate), c("cATE", "iATE")),
  +             fit$m == length(unique(data$cluster)))
  +   # The paired difference retains covariance between the two model fits.
  +   naive_se <- sqrt(sum(expected$se[1:2]^2))
  +   stopifnot(abs(expected$se[3] - naive_se) > 1e-4)
  +   if (scale == "RR") {
  +     logged <- MRStdCRT_fit(formula, data, "cluster", "intervention", probability,
  +       family = family, method = "GEE", corstr = corstr, scale = scale,
  +       alpha = alpha, model_weights = "estimand_specific", inference_scale = "log")
  +     m <- nrow(deleted)
  +     log_deleted <- log(deleted[, 1:2, drop = FALSE])
  +     log_se <- sqrt((m - 1) / m *
  +       colSums(sweep(log_deleted, 2, colMeans(log_deleted))^2))
  +     cutoff <- qt(1 - alpha / 2, m - 1)
  +     assert_close(logged$log_se, log_se)
  +     assert_close(logged$estimate[["CI lower"]],
  +                   exp(log(full$effect[1:2]) - cutoff * log_se))
  +     assert_close(logged$estimate[["CI upper"]],
  +                   exp(log(full$effect[1:2]) + cutoff * log_se))
  +     assert_close(logged$estimate[["p-value"]],
  +       2 * pt(abs(log(full$effect[1:2]) / log_se), m - 1, lower.tail = FALSE))
  +     stopifnot(identical(logged$ics, fit$ics),
  +               identical(logged$estimate[, 1:2], fit$estimate[, 1:2]))
  +   }
  +   invisible(fit)
  + }
  > 
  > # Named probabilities follow cluster IDs despite shuffled rows and names.
  > d <- weighted_fixture()
  > d$outcome <- d$continuous + .25 * d$intervention * d$x
  > set.seed(1892)
  > d <- d[sample(nrow(d)), ]
  > p <- setNames(seq(.4, .65, length.out = 12), as.character(1:12))
  > specific_check(d, "exchangeable", "RR", probability = p[12:1],
  +                row_probability = unname(p[as.character(d$cluster)]),
  +                interactions = TRUE)
  Error in specific_check(d, "exchangeable", "RR", probability = p[12:1],  : 
    identical(logged$ics, fit$ics) is not TRUE
  Calls: specific_check -> stopifnot
  Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... [158s/162s] ERROR
Error(s) in re-building vignettes:
--- re-building ‘introduction.Rmd’ using rmarkdown

Quitting from introduction.Rmd:586-606 [log-inference-example]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error:
! identical(ratio_original$estimate[, c("Estimate", "Std. Error")],  .... is not TRUE
---
Backtrace:
    ▆
 1. └─base::stopifnot(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'introduction.Rmd' failed with diagnostics:
identical(ratio_original$estimate[, c("Estimate", "Std. Error")],  .... is not TRUE
--- failed re-building ‘introduction.Rmd’

SUMMARY: processing the following file failed:
  ‘introduction.Rmd’

Error: Vignette re-building failed.
Execution halted

* checking PDF version of manual ... OK
* checking HTML version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 2 ERRORs
See
  ‘/data/localhost/ripley/R/packages/tests-MKL/MRStdCRT.Rcheck/00check.log’
for details.

Command exited with non-zero status 1
Time 7:41.52, 429.73 + 11.31
