Last updated on 2026-10-24 03:56:13 CEST.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 0.6-11 | 8.54 | 91.11 | 99.65 | OK | |
| r-devel-linux-x86_64-debian-gcc | 0.6-11 | 6.50 | 66.28 | 72.78 | ERROR | |
| r-devel-linux-x86_64-fedora-clang | 0.6-11 | 92.16 | OK | |||
| r-devel-linux-x86_64-fedora-gcc | 0.6-11 | 72.59 | OK | |||
| r-devel-windows-x86_64 | 0.6-11 | 12.00 | 137.00 | 149.00 | OK | |
| r-patched-linux-x86_64 | 0.6-11 | 9.18 | 85.71 | 94.89 | OK | |
| r-release-linux-x86_64 | 0.6-11 | 8.16 | 86.09 | 94.25 | OK | |
| r-release-macos-arm64 | 0.6-11 | 2.00 | 29.00 | 31.00 | OK | |
| r-release-macos-x86_64 | 0.6-11 | 6.00 | 108.00 | 114.00 | OK | |
| r-release-windows-x86_64 | 0.6-11 | 11.00 | 123.00 | 134.00 | OK | |
| r-oldrel-macos-arm64 | 0.6-11 | OK | ||||
| r-oldrel-macos-x86_64 | 0.6-11 | 6.00 | 124.00 | 130.00 | OK | |
| r-oldrel-windows-x86_64 | 0.6-11 | 14.00 | 144.00 | 158.00 | OK |
Version: 0.6-11
Check: examples
Result: ERROR
Running examples in ‘medflex-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: neImpute.default
> ### Title: Expand the dataset and impute nested counterfactual outcomes
> ### Aliases: neImpute.default
>
> ### ** Examples
>
> data(UPBdata)
>
> ## example using glm imputation model with binary exposure
> fit.glm <- glm(UPB ~ factor(attbin) + negaff + gender + educ + age,
+ family = binomial, data = UPBdata)
> impData <- neImpute(fit.glm)
> head(impData)
id attbin0 attbin1 att attcat negaff initiator gender educ age
1 1 1 1 1.0005617 M 0.840461 myself F M 41
2 1 0 1 1.0005617 M 0.840461 myself F M 41
3 2 0 0 -0.7085889 L -1.257465 both M M 42
4 2 1 0 -0.7085889 L -1.257465 both M M 42
5 3 0 0 -0.7085889 L -1.202256 both F H 43
6 3 1 0 -0.7085889 L -1.202256 both F H 43
UPB
1 0.4916179
2 0.3841749
3 0.1870645
4 0.2629165
5 0.1570628
6 0.2241032
>
> ## example using glm imputation model with continuous exposure
> fit.glm <- glm(UPB ~ att + negaff + gender + educ + age,
+ family = binomial, data = UPBdata)
> impData <- neImpute(fit.glm, nRep = 2)
> head(impData)
id att0 att1 attbin attcat negaff initiator gender educ age
1 1 -1.644093 1.0005617 1 M 0.840461 myself F M 41
2 1 1.644109 1.0005617 1 M 0.840461 myself F M 41
3 2 -1.662279 -0.7085889 0 L -1.257465 both M M 42
4 2 1.625923 -0.7085889 0 L -1.257465 both M M 42
5 3 -1.568986 -0.7085889 0 L -1.202256 both F H 43
6 3 1.719217 -0.7085889 0 L -1.202256 both F H 43
UPB
1 0.3091871
2 0.5573637
3 0.1490191
4 0.3300578
5 0.1275219
6 0.2913869
>
> ## example using vglm (yielding identical results as with glm)
> if (requireNamespace("VGAM", quietly = TRUE)) {
+ library(VGAM)
+ fit.vglm <- vglm(UPB ~ att + negaff + gender + educ + age,
+ family = binomialff, data = UPBdata)
+ impData2 <- neImpute(fit.vglm, nRep = 2)
+ head(impData2)
+ }
Loading required package: stats4
Loading required package: splines
id att0 att1 attbin attcat negaff initiator gender educ age
1 1 -1.644093 1.0005617 1 M 0.840461 myself F M 41
2 1 1.644109 1.0005617 1 M 0.840461 myself F M 41
3 2 -1.662279 -0.7085889 0 L -1.257465 both M M 42
4 2 1.625923 -0.7085889 0 L -1.257465 both M M 42
5 3 -1.568986 -0.7085889 0 L -1.202256 both F H 43
6 3 1.719217 -0.7085889 0 L -1.202256 both F H 43
UPB
1 0.3091871
2 0.5573637
3 0.1490191
4 0.3300578
5 0.1275219
6 0.2913869
>
> ## Not run:
> ##D ## example using SuperLearner
> ##D library(Matrix)
> ##D library(SuperLearner)
> ##D SL.library <- c("SL.glm", "SL.glm.interaction", "SL.rpart",
> ##D "SL.step", "SL.stepAIC", "SL.step.interaction",
> ##D "SL.bayesglm", "SL.glmnet")
> ##D pred <- c("att", "negaff", "gender", "educ", "age")
> ##D fit.SL <- SuperLearner(Y = UPBdata$UPB, X = subset(UPBdata, select = pred),
> ##D SL.library = SL.library, family = binomial())
> ##D impSL <- neImpute(fit.SL,
> ##D formula = UPB ~ att + negaff + gender + educ + age,
> ##D data = UPBdata)
> ##D head(impSL)
> ## End(Not run)
>
> ## Don't show:
> rm(list=ls())
> if (requireNamespace("VGAM", quietly = TRUE)) {
+ library(VGAM)
+ expData <- neImpute(UPB ~ factor(attbin) + negaff + gender + educ + age, family = binomialff, data = UPBdata, FUN = vglm)
+ neMod <- neModel(UPB ~ attbin0 + attbin1 + gender + educ + age, family = binomial, expData = expData, nBoot = 2)
+
+ UPBdata$att2 <- ifelse(UPBdata$attbin == "H", 1, 0)
+ UPBdata$att2 <- UPBdata$attbin
+ impData <- neImpute(UPB ~ factor(att2) * negaff + gender + educ + age, family = binomial, data = UPBdata)
+ impFit1 <- neModel(UPB ~ att20 * att21 + gender + educ + age, family = binomial, expData = impData, nBoot = 2)
+ impFit2 <- neModel(UPB ~ factor(att20) * factor(att21) + gender + educ + age, family = binomial, expData = impData, nBoot = 2)
+ summary(impFit1)
+ summary(impFit2)
+
+ head(neImpute(UPB ~ att + negaff + gender + educ + age, data = UPBdata, weights = rep(1, nrow(UPBdata))))
+ fit1 <- vglm(UPB ~ att + negaff + gender + educ + age, family = binomialff, data = UPBdata)
+ head(neImpute(fit1))
+ head(neImpute(UPB ~ att + negaff + gender + educ + age, family = binomialff, data = UPBdata, FUN = vglm, weights = rep(1, nrow(UPBdata))))
+ head(neImpute(UPB ~ att + negaff + gender + educ + age, family = binomial, data = UPBdata, weights = rep(1, nrow(UPBdata))))
+ UPBdata$att <- factor(cut(UPBdata$att, 2), labels = c("low", "high"))
+ fit2 <- glm(UPB ~ att * negaff * gender * educ * age, family = binomial, data = UPBdata)
+ # head(neImpute(fit2, nMed = 3, joint = FALSE))
+ # head(neImpute(UPB ~ att * negaff * gender * educ * age, data = UPBdata, family = binomial, nMed = 3, joint = FALSE))
+ head(neImpute(UPB ~ att + negaff + gender + educ + age, data = UPBdata, family = binomial))
+ head(neImpute(UPB ~ att + negaff + gender + educ + age, data = UPBdata))
+
+ # # test with vglm!
+ impFit <- vglm(UPB ~ att + negaff + gender + educ + age, family = binomialff, data = UPBdata)
+ terms(impFit)
+ # debug(neImpute)
+ impData <- neImpute(impFit)
+ impFit2 <- glm(UPB ~ att + negaff + gender + educ + age, family = binomial, data = UPBdata)
+ impData2 <- neImpute(impFit2)
+ head(impData); head(impData2)
+ # check!!
+ }
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100% id att0 att1 attbin attcat negaff initiator gender educ age UPB att2
1 1 high high 1 M 0.840461 myself F M 41 0.5106796 1
2 1 low high 1 M 0.840461 myself F M 41 0.4059912 1
3 2 low low 0 L -1.257465 both M M 42 0.1999050 0
4 2 high low 0 L -1.257465 both M M 42 0.2761580 0
5 3 low low 0 L -1.202256 both F H 43 0.1668007 0
6 3 high low 0 L -1.202256 both F H 43 0.2341212 0
>
> # test with gam?
> if (requireNamespace("gam", quietly = TRUE)) {
+ library(gam)
+ impFit4 <- gam(UPB ~ att + negaff + gender + educ + age, family = binomial, data = UPBdata)
+ impData4 <- neImpute(impFit4)
+ head(impData2); head(impData4)
+ # check!
+ }
Loading required package: foreach
Loaded gam 1.22-7
Attaching package: ‘gam’
The following object is masked from ‘package:VGAM’:
s
Error in a$specials[[i]] : subscript out of bounds
Calls: neImpute ... predict.glm -> predict.lm -> delete.response -> off
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc