Package check result: NOTE Check: CRAN incoming feasibility, Result: NOTE Maintainer: ‘Terry M Therneau ’ Size of tarball: 9413529 bytes Changes to worse in reverse depends: Package: AER Check: examples New result: ERROR Running examples in ‘AER-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: PSID1976 > ### Title: Labor Force Participation Data > ### Aliases: PSID1976 > ### Keywords: datasets > > ### ** Examples > > ## Don't show: > if(!requireNamespace("sampleSelection")) { + if(interactive() || is.na(Sys.getenv("_R_CHECK_PACKAGE_NAME_", NA))) { + stop("not all packages required for the example are installed") + } else q() } > ## End(Don't show) > ## data and transformations > data("PSID1976") > PSID1976$kids <- with(PSID1976, factor((youngkids + oldkids) > 0, + levels = c(FALSE, TRUE), labels = c("no", "yes"))) > PSID1976$nwincome <- with(PSID1976, (fincome - hours * wage)/1000) > PSID1976$partnum <- as.numeric(PSID1976$participation) - 1 > > ################### > ## Greene (2003) ## > ################### > > ## Example 4.1, Table 4.2 > ## (reproduced in Example 7.1, Table 7.1) > gr_lm <- lm(log(hours * wage) ~ age + I(age^2) + education + kids, + data = PSID1976, subset = participation == "yes") > summary(gr_lm) Call: lm(formula = log(hours * wage) ~ age + I(age^2) + education + kids, data = PSID1976, subset = participation == "yes") Residuals: Min 1Q Median 3Q Max -4.5305 -0.5266 0.3003 0.8474 1.7568 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.2400965 1.7674296 1.833 0.06747 . age 0.2005573 0.0838603 2.392 0.01721 * I(age^2) -0.0023147 0.0009869 -2.345 0.01947 * education 0.0674727 0.0252486 2.672 0.00782 ** kidsyes -0.3511952 0.1475326 -2.380 0.01773 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.19 on 423 degrees of freedom Multiple R-squared: 0.041, Adjusted R-squared: 0.03193 F-statistic: 4.521 on 4 and 423 DF, p-value: 0.001382 > vcov(gr_lm) (Intercept) age I(age^2) education kidsyes (Intercept) 3.12380756 -1.440901e-01 1.661740e-03 -9.260920e-03 2.674867e-02 age -0.14409007 7.032544e-03 -8.232369e-05 5.085495e-05 -2.641203e-03 I(age^2) 0.00166174 -8.232369e-05 9.739279e-07 -4.976114e-07 3.841018e-05 education -0.00926092 5.085495e-05 -4.976114e-07 6.374903e-04 -5.461931e-05 kidsyes 0.02674867 -2.641203e-03 3.841018e-05 -5.461931e-05 2.176587e-02 > > ## Example 4.5 > summary(gr_lm) Call: lm(formula = log(hours * wage) ~ age + I(age^2) + education + kids, data = PSID1976, subset = participation == "yes") Residuals: Min 1Q Median 3Q Max -4.5305 -0.5266 0.3003 0.8474 1.7568 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.2400965 1.7674296 1.833 0.06747 . age 0.2005573 0.0838603 2.392 0.01721 * I(age^2) -0.0023147 0.0009869 -2.345 0.01947 * education 0.0674727 0.0252486 2.672 0.00782 ** kidsyes -0.3511952 0.1475326 -2.380 0.01773 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.19 on 423 degrees of freedom Multiple R-squared: 0.041, Adjusted R-squared: 0.03193 F-statistic: 4.521 on 4 and 423 DF, p-value: 0.001382 > ## or equivalently > gr_lm1 <- lm(log(hours * wage) ~ 1, data = PSID1976, subset = participation == "yes") > anova(gr_lm1, gr_lm) Analysis of Variance Table Model 1: log(hours * wage) ~ 1 Model 2: log(hours * wage) ~ age + I(age^2) + education + kids Res.Df RSS Df Sum of Sq F Pr(>F) 1 427 625.08 2 423 599.46 4 25.625 4.5206 0.001382 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > ## Example 21.4, p. 681, and Tab. 21.3, p. 682 > gr_probit1 <- glm(participation ~ age + I(age^2) + I(fincome/10000) + education + kids, + data = PSID1976, family = binomial(link = "probit") ) > gr_probit2 <- glm(participation ~ age + I(age^2) + I(fincome/10000) + education, + data = PSID1976, family = binomial(link = "probit")) > gr_probit3 <- glm(participation ~ kids/(age + I(age^2) + I(fincome/10000) + education), + data = PSID1976, family = binomial(link = "probit")) > ## LR test of all coefficients > lrtest(gr_probit1) Likelihood ratio test Model 1: participation ~ age + I(age^2) + I(fincome/10000) + education + kids Model 2: participation ~ 1 #Df LogLik Df Chisq Pr(>Chisq) 1 6 -490.85 2 1 -514.87 -5 48.051 3.468e-09 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > ## Chow-type test > lrtest(gr_probit2, gr_probit3) Likelihood ratio test Model 1: participation ~ age + I(age^2) + I(fincome/10000) + education Model 2: participation ~ kids/(age + I(age^2) + I(fincome/10000) + education) #Df LogLik Df Chisq Pr(>Chisq) 1 5 -496.87 2 10 -489.48 5 14.774 0.01137 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > ## equivalently: > anova(gr_probit2, gr_probit3, test = "Chisq") Analysis of Deviance Table Model 1: participation ~ age + I(age^2) + I(fincome/10000) + education Model 2: participation ~ kids/(age + I(age^2) + I(fincome/10000) + education) Resid. Df Resid. Dev Df Deviance Pr(>Chi) 1 748 993.73 2 743 978.96 5 14.774 0.01137 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > ## Table 21.3 > summary(gr_probit1) Call: glm(formula = participation ~ age + I(age^2) + I(fincome/10000) + education + kids, family = binomial(link = "probit"), data = PSID1976) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -4.1568189 1.4040095 -2.961 0.003070 ** age 0.1853957 0.0662076 2.800 0.005107 ** I(age^2) -0.0024259 0.0007762 -3.125 0.001775 ** I(fincome/10000) 0.0458029 0.0430557 1.064 0.287417 education 0.0981824 0.0228932 4.289 1.8e-05 *** kidsyes -0.4489872 0.1300252 -3.453 0.000554 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 1029.7 on 752 degrees of freedom Residual deviance: 981.7 on 747 degrees of freedom AIC: 993.7 Number of Fisher Scoring iterations: 4 > > ## Example 22.8, Table 22.7, p. 786 > library("sampleSelection") Loading required package: maxLik Loading required package: miscTools Please cite the 'maxLik' package as: Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1. If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site: https://r-forge.r-project.org/projects/maxlik/ > gr_2step <- selection(participation ~ age + I(age^2) + fincome + education + kids, + wage ~ experience + I(experience^2) + education + city, + data = PSID1976, method = "2step") > gr_ml <- selection(participation ~ age + I(age^2) + fincome + education + kids, + wage ~ experience + I(experience^2) + education + city, + data = PSID1976, method = "ml") > gr_ols <- lm(wage ~ experience + I(experience^2) + education + city, + data = PSID1976, subset = participation == "yes") > ## NOTE: ML estimates agree with Greene, 5e errata. > ## Standard errors are based on the Hessian (here), while Greene has BHHH/OPG. > > > ####################### > ## Wooldridge (2002) ## > ####################### > > ## Table 15.1, p. 468 > wl_lpm <- lm(partnum ~ nwincome + education + experience + I(experience^2) + + age + youngkids + oldkids, data = PSID1976) > wl_logit <- glm(participation ~ nwincome + education + experience + I(experience^2) + + age + youngkids + oldkids, family = binomial, data = PSID1976) > wl_probit <- glm(participation ~ nwincome + education + experience + I(experience^2) + + age + youngkids + oldkids, family = binomial(link = "probit"), data = PSID1976) > ## (same as Altman et al.) > > ## convenience functions > pseudoR2 <- function(obj) 1 - as.vector(logLik(obj)/logLik(update(obj, . ~ 1))) > misclass <- function(obj) 1 - sum(diag(prop.table(table( + model.response(model.frame(obj)), round(fitted(obj)))))) > > coeftest(wl_logit) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.4254524 0.8603645 0.4945 0.620951 nwincome -0.0213452 0.0084214 -2.5346 0.011256 * education 0.2211704 0.0434393 5.0915 3.553e-07 *** experience 0.2058695 0.0320567 6.4220 1.345e-10 *** I(experience^2) -0.0031541 0.0010161 -3.1041 0.001909 ** age -0.0880244 0.0145729 -6.0403 1.538e-09 *** youngkids -1.4433541 0.2035828 -7.0898 1.343e-12 *** oldkids 0.0601122 0.0747893 0.8038 0.421539 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > logLik(wl_logit) 'log Lik.' -401.7652 (df=8) > misclass(wl_logit) [1] 0.2642762 > pseudoR2(wl_logit) [1] 0.2196814 > > coeftest(wl_probit) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.27007357 0.50807817 0.5316 0.595031 nwincome -0.01202364 0.00493917 -2.4343 0.014919 * education 0.13090397 0.02539873 5.1540 2.550e-07 *** experience 0.12334717 0.01875869 6.5755 4.850e-11 *** I(experience^2) -0.00188707 0.00059993 -3.1455 0.001658 ** age -0.05285244 0.00846236 -6.2456 4.222e-10 *** youngkids -0.86832468 0.11837727 -7.3352 2.213e-13 *** oldkids 0.03600561 0.04403026 0.8177 0.413502 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > logLik(wl_probit) 'log Lik.' -401.3022 (df=8) > misclass(wl_probit) [1] 0.2656042 > pseudoR2(wl_probit) [1] 0.2205805 > > ## Table 16.2, p. 528 > form <- hours ~ nwincome + education + experience + I(experience^2) + age + youngkids + oldkids > wl_ols <- lm(form, data = PSID1976) > wl_tobit <- tobit(form, data = PSID1976) > summary(wl_ols) Call: lm(formula = form, data = PSID1976) Residuals: Min 1Q Median 3Q Max -1511.3 -537.8 -146.9 538.1 3555.6 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1330.4824 270.7846 4.913 1.10e-06 *** nwincome -3.4466 2.5440 -1.355 0.1759 education 28.7611 12.9546 2.220 0.0267 * experience 65.6725 9.9630 6.592 8.23e-11 *** I(experience^2) -0.7005 0.3246 -2.158 0.0312 * age -30.5116 4.3639 -6.992 6.04e-12 *** youngkids -442.0899 58.8466 -7.513 1.66e-13 *** oldkids -32.7792 23.1762 -1.414 0.1577 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 750.2 on 745 degrees of freedom Multiple R-squared: 0.2656, Adjusted R-squared: 0.2587 F-statistic: 38.5 on 7 and 745 DF, p-value: < 2.2e-16 > summary(wl_tobit) Call: tobit(formula = hours ~ nwincome + education + experience + I(experience^2) + age + youngkids + oldkids, data = PSID1976) Observations: Total Left-censored Uncensored Right-censored 753 325 428 0 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 965.30528 446.43614 2.162 0.030599 * nwincome -8.81424 4.45910 -1.977 0.048077 * education 80.64561 21.58324 3.736 0.000187 *** experience 131.56430 17.27939 7.614 2.66e-14 *** I(experience^2) -1.86416 0.53766 -3.467 0.000526 *** age -54.40501 7.41850 -7.334 2.24e-13 *** youngkids -894.02174 111.87804 -7.991 1.34e-15 *** oldkids -16.21800 38.64139 -0.420 0.674701 Log(scale) 7.02289 0.03706 189.514 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Scale: 1122 Gaussian distribution Number of Newton-Raphson Iterations: 4 Log-likelihood: -3819 on 9 Df Wald-statistic: 253.9 on 7 Df, p-value: < 2.22e-16 > > > ####################### > ## McCullough (2004) ## > ####################### > > ## p. 203 > mc_probit <- glm(participation ~ nwincome + education + experience + I(experience^2) + + age + youngkids + oldkids, family = binomial(link = "probit"), data = PSID1976) > mc_tobit <- tobit(hours ~ nwincome + education + experience + I(experience^2) + age + + youngkids + oldkids, data = PSID1976) > coeftest(mc_probit) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.27007357 0.50807817 0.5316 0.595031 nwincome -0.01202364 0.00493917 -2.4343 0.014919 * education 0.13090397 0.02539873 5.1540 2.550e-07 *** experience 0.12334717 0.01875869 6.5755 4.850e-11 *** I(experience^2) -0.00188707 0.00059993 -3.1455 0.001658 ** age -0.05285244 0.00846236 -6.2456 4.222e-10 *** youngkids -0.86832468 0.11837727 -7.3352 2.213e-13 *** oldkids 0.03600561 0.04403026 0.8177 0.413502 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > coeftest(mc_tobit) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 965.305283 446.436144 2.1622 0.0305991 * nwincome -8.814243 4.459100 -1.9767 0.0480771 * education 80.645606 21.583237 3.7365 0.0001866 *** experience 131.564299 17.279392 7.6139 2.659e-14 *** I(experience^2) -1.864158 0.537662 -3.4672 0.0005260 *** age -54.405011 7.418502 -7.3337 2.239e-13 *** youngkids -894.021739 111.878035 -7.9910 1.338e-15 *** oldkids -16.217996 38.641391 -0.4197 0.6747008 Log(scale) 7.022887 0.037057 189.5142 < 2.2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > coeftest(mc_tobit, vcov = vcovOPG) Error in model.matrix.default(terms(x), mf) : model frame and formula mismatch in model.matrix() Calls: coeftest ... estfun.survreg -> model.matrix -> model.matrix.default Execution halted Package: AER Check: tests New result: ERROR Running ‘Ch-Basics.R’ [2s/2s] Comparing ‘Ch-Basics.Rout’ to ‘Ch-Basics.Rout.save’ ... OK Running ‘Ch-Intro.R’ [2s/2s] Comparing ‘Ch-Intro.Rout’ to ‘Ch-Intro.Rout.save’ ... OK Running ‘Ch-LinearRegression.R’ [6s/6s] Comparing ‘Ch-LinearRegression.Rout’ to ‘Ch-LinearRegression.Rout.save’ ... OK Running ‘Ch-Microeconometrics.R’ [3s/3s] Running ‘Ch-Programming.R’ [26s/26s] Comparing ‘Ch-Programming.Rout’ to ‘Ch-Programming.Rout.save’ ... OK Running ‘Ch-TimeSeries.R’ [4s/4s] Comparing ‘Ch-TimeSeries.Rout’ to ‘Ch-TimeSeries.Rout.save’ ... OK Running ‘Ch-Validation.R’ [43s/44s] Comparing ‘Ch-Validation.Rout’ to ‘Ch-Validation.Rout.save’ ... OK Running the tests in ‘tests/Ch-Microeconometrics.R’ failed. Complete output: > if(!requireNamespace("ROCR") || + !requireNamespace("MASS") || + !requireNamespace("pscl") || + !requireNamespace("np") || + !requireNamespace("nnet")) q() Loading required namespace: ROCR Loading required namespace: MASS Loading required namespace: pscl Loading required namespace: np Loading required namespace: nnet > > ################################################### > ### chunk number 1: setup > ################################################### > options(prompt = "R> ", continue = "+ ", width = 64, + digits = 4, show.signif.stars = FALSE, useFancyQuotes = FALSE) R> R> options(SweaveHooks = list(onefig = function() {par(mfrow = c(1,1))}, + twofig = function() {par(mfrow = c(1,2))}, + threefig = function() {par(mfrow = c(1,3))}, + fourfig = function() {par(mfrow = c(2,2))}, + sixfig = function() {par(mfrow = c(3,2))})) R> R> library("AER") Loading required package: car Loading required package: carData Loading required package: lmtest Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, as.Date.numeric Loading required package: sandwich Loading required package: survival R> R> suppressWarnings(RNGversion("3.5.0")) R> set.seed(1071) R> R> R> ################################################### R> ### chunk number 2: swisslabor-data R> ################################################### R> data("SwissLabor") R> swiss_probit <- glm(participation ~ . + I(age^2), + data = SwissLabor, family = binomial(link = "probit")) R> summary(swiss_probit) Call: glm(formula = participation ~ . + I(age^2), family = binomial(link = "probit"), data = SwissLabor) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.7491 1.4069 2.66 0.0077 income -0.6669 0.1320 -5.05 4.3e-07 age 2.0753 0.4054 5.12 3.1e-07 education 0.0192 0.0179 1.07 0.2843 youngkids -0.7145 0.1004 -7.12 1.1e-12 oldkids -0.1470 0.0509 -2.89 0.0039 foreignyes 0.7144 0.1213 5.89 3.9e-09 I(age^2) -0.2943 0.0499 -5.89 3.8e-09 (Dispersion parameter for binomial family taken to be 1) Null deviance: 1203.2 on 871 degrees of freedom Residual deviance: 1017.2 on 864 degrees of freedom AIC: 1033 Number of Fisher Scoring iterations: 4 R> R> R> ################################################### R> ### chunk number 3: swisslabor-plot eval=FALSE R> ################################################### R> ## plot(participation ~ age, data = SwissLabor, ylevels = 2:1) R> R> R> ################################################### R> ### chunk number 4: swisslabor-plot-refined R> ################################################### R> plot(participation ~ education, data = SwissLabor, ylevels = 2:1) R> fm <- glm(participation ~ education + I(education^2), data = SwissLabor, family = binomial) R> edu <- sort(unique(SwissLabor$education)) R> prop <- sapply(edu, function(x) mean(SwissLabor$education <= x)) R> lines(predict(fm, newdata = data.frame(education = edu), type = "response") ~ prop, col = 2) R> R> plot(participation ~ age, data = SwissLabor, ylevels = 2:1) R> fm <- glm(participation ~ age + I(age^2), data = SwissLabor, family = binomial) R> ag <- sort(unique(SwissLabor$age)) R> prop <- sapply(ag, function(x) mean(SwissLabor$age <= x)) R> lines(predict(fm, newdata = data.frame(age = ag), type = "response") ~ prop, col = 2) R> R> R> ################################################### R> ### chunk number 5: effects1 R> ################################################### R> fav <- mean(dnorm(predict(swiss_probit, type = "link"))) R> fav * coef(swiss_probit) (Intercept) income age education youngkids 1.241930 -0.220932 0.687466 0.006359 -0.236682 oldkids foreignyes I(age^2) -0.048690 0.236644 -0.097505 R> R> R> ################################################### R> ### chunk number 6: effects2 R> ################################################### R> av <- colMeans(SwissLabor[, -c(1, 7)]) R> av <- data.frame(rbind(swiss = av, foreign = av), + foreign = factor(c("no", "yes"))) R> av <- predict(swiss_probit, newdata = av, type = "link") R> av <- dnorm(av) R> av["swiss"] * coef(swiss_probit)[-7] (Intercept) income age education youngkids 1.495137 -0.265976 0.827628 0.007655 -0.284938 oldkids I(age^2) -0.058617 -0.117384 R> R> R> ################################################### R> ### chunk number 7: effects3 R> ################################################### R> av["foreign"] * coef(swiss_probit)[-7] (Intercept) income age education youngkids 1.136517 -0.202180 0.629115 0.005819 -0.216593 oldkids I(age^2) -0.044557 -0.089229 R> R> R> ################################################### R> ### chunk number 8: mcfadden R> ################################################### R> swiss_probit0 <- update(swiss_probit, formula = . ~ 1) R> 1 - as.vector(logLik(swiss_probit)/logLik(swiss_probit0)) [1] 0.1546 R> R> R> ################################################### R> ### chunk number 9: confusion-matrix R> ################################################### R> table(true = SwissLabor$participation, + pred = round(fitted(swiss_probit))) pred true 0 1 no 337 134 yes 146 255 R> R> R> ################################################### R> ### chunk number 10: confusion-matrix1 R> ################################################### R> tab <- table(true = SwissLabor$participation, + pred = round(fitted(swiss_probit))) R> tabp <- round(100 * c(tab[1,1] + tab[2,2], tab[2,1] + tab[1,2])/sum(tab), digits = 2) R> R> R> ################################################### R> ### chunk number 11: roc-plot eval=FALSE R> ################################################### R> ## library("ROCR") R> ## pred <- prediction(fitted(swiss_probit), R> ## SwissLabor$participation) R> ## plot(performance(pred, "acc")) R> ## plot(performance(pred, "tpr", "fpr")) R> ## abline(0, 1, lty = 2) R> R> R> ################################################### R> ### chunk number 12: roc-plot1 R> ################################################### R> library("ROCR") R> pred <- prediction(fitted(swiss_probit), + SwissLabor$participation) R> plot(performance(pred, "acc")) R> plot(performance(pred, "tpr", "fpr")) R> abline(0, 1, lty = 2) R> R> R> ################################################### R> ### chunk number 13: rss R> ################################################### R> deviance(swiss_probit) [1] 1017 R> sum(residuals(swiss_probit, type = "deviance")^2) [1] 1017 R> sum(residuals(swiss_probit, type = "pearson")^2) [1] 866.5 R> R> R> ################################################### R> ### chunk number 14: coeftest eval=FALSE R> ################################################### R> ## coeftest(swiss_probit, vcov = sandwich) R> R> R> ################################################### R> ### chunk number 15: murder R> ################################################### R> data("MurderRates") R> ## murder_logit <- glm(I(executions > 0) ~ time + income + ## IGNORE_RDIFF, excluded due to small numeric deviations on different platforms R> ## noncauc + lfp + southern, data = MurderRates, R> ## family = binomial) R> ## R> ## R> ## ################################################### R> ## ### chunk number 16: murder-coeftest R> ## ################################################### R> ## coeftest(murder_logit) R> ## R> ## R> ## ################################################### R> ## ### chunk number 17: murder2 R> ## ################################################### R> ## murder_logit2 <- glm(I(executions > 0) ~ time + income + R> ## noncauc + lfp + southern, data = MurderRates, R> ## family = binomial, control = list(epsilon = 1e-15, R> ## maxit = 50, trace = FALSE)) R> ## R> ## R> ## ################################################### R> ## ### chunk number 18: murder2-coeftest R> ## ################################################### R> ## coeftest(murder_logit2) R> R> R> ################################################### R> ### chunk number 19: separation R> ################################################### R> table(I(MurderRates$executions > 0), MurderRates$southern) no yes FALSE 9 0 TRUE 20 15 R> R> R> ################################################### R> ### chunk number 20: countreg-pois R> ################################################### R> data("RecreationDemand") R> rd_pois <- glm(trips ~ ., data = RecreationDemand, + family = poisson) R> R> R> ################################################### R> ### chunk number 21: countreg-pois-coeftest R> ################################################### R> coeftest(rd_pois) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.26499 0.09372 2.83 0.0047 quality 0.47173 0.01709 27.60 < 2e-16 skiyes 0.41821 0.05719 7.31 2.6e-13 income -0.11132 0.01959 -5.68 1.3e-08 userfeeyes 0.89817 0.07899 11.37 < 2e-16 costC -0.00343 0.00312 -1.10 0.2713 costS -0.04254 0.00167 -25.47 < 2e-16 costH 0.03613 0.00271 13.34 < 2e-16 R> R> R> ################################################### R> ### chunk number 22: countreg-pois-logLik R> ################################################### R> logLik(rd_pois) 'log Lik.' -1529 (df=8) R> R> R> ################################################### R> ### chunk number 23: countreg-odtest1 R> ################################################### R> dispersiontest(rd_pois) Overdispersion test data: rd_pois z = 2.4, p-value = 0.008 alternative hypothesis: true dispersion is greater than 1 sample estimates: dispersion 6.566 R> R> R> ################################################### R> ### chunk number 24: countreg-odtest2 R> ################################################### R> dispersiontest(rd_pois, trafo = 2) Overdispersion test data: rd_pois z = 2.9, p-value = 0.002 alternative hypothesis: true alpha is greater than 0 sample estimates: alpha 1.316 R> R> R> ################################################### R> ### chunk number 25: countreg-nbin R> ################################################### R> library("MASS") R> rd_nb <- glm.nb(trips ~ ., data = RecreationDemand) R> coeftest(rd_nb) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.12194 0.21430 -5.24 1.6e-07 quality 0.72200 0.04012 18.00 < 2e-16 skiyes 0.61214 0.15030 4.07 4.6e-05 income -0.02606 0.04245 -0.61 0.539 userfeeyes 0.66917 0.35302 1.90 0.058 costC 0.04801 0.00918 5.23 1.7e-07 costS -0.09269 0.00665 -13.93 < 2e-16 costH 0.03884 0.00775 5.01 5.4e-07 R> logLik(rd_nb) 'log Lik.' -825.6 (df=9) R> R> R> ################################################### R> ### chunk number 26: countreg-se R> ################################################### R> round(sqrt(rbind(diag(vcov(rd_pois)), + diag(sandwich(rd_pois)))), digits = 3) (Intercept) quality skiyes income userfeeyes costC costS [1,] 0.094 0.017 0.057 0.02 0.079 0.003 0.002 [2,] 0.432 0.049 0.194 0.05 0.247 0.015 0.012 costH [1,] 0.003 [2,] 0.009 R> R> R> ################################################### R> ### chunk number 27: countreg-sandwich R> ################################################### R> coeftest(rd_pois, vcov = sandwich) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.26499 0.43248 0.61 0.54006 quality 0.47173 0.04885 9.66 < 2e-16 skiyes 0.41821 0.19387 2.16 0.03099 income -0.11132 0.05031 -2.21 0.02691 userfeeyes 0.89817 0.24691 3.64 0.00028 costC -0.00343 0.01470 -0.23 0.81549 costS -0.04254 0.01173 -3.62 0.00029 costH 0.03613 0.00939 3.85 0.00012 R> R> R> ################################################### R> ### chunk number 28: countreg-OPG R> ################################################### R> round(sqrt(diag(vcovOPG(rd_pois))), 3) (Intercept) quality skiyes income userfeeyes 0.025 0.007 0.020 0.010 0.033 costC costS costH 0.001 0.000 0.001 R> R> R> ################################################### R> ### chunk number 29: countreg-plot R> ################################################### R> plot(table(RecreationDemand$trips), ylab = "") R> R> R> ################################################### R> ### chunk number 30: countreg-zeros R> ################################################### R> rbind(obs = table(RecreationDemand$trips)[1:10], exp = round( + sapply(0:9, function(x) sum(dpois(x, fitted(rd_pois)))))) 0 1 2 3 4 5 6 7 8 9 obs 417 68 38 34 17 13 11 2 8 1 exp 277 146 68 41 30 23 17 13 10 7 R> R> R> ################################################### R> ### chunk number 31: countreg-pscl R> ################################################### R> library("pscl") Classes and Methods for R originally developed in the Political Science Computational Laboratory Department of Political Science Stanford University (2002-2015), by and under the direction of Simon Jackman. hurdle and zeroinfl functions by Achim Zeileis. R> R> R> ################################################### R> ### chunk number 32: countreg-zinb R> ################################################### R> rd_zinb <- zeroinfl(trips ~ . | quality + income, + data = RecreationDemand, dist = "negbin") R> R> R> ################################################### R> ### chunk number 33: countreg-zinb-summary R> ################################################### R> summary(rd_zinb) Call: zeroinfl(formula = trips ~ . | quality + income, data = RecreationDemand, dist = "negbin") Pearson residuals: Min 1Q Median 3Q Max -1.0889 -0.2004 -0.0570 -0.0451 40.0139 Count model coefficients (negbin with log link): Estimate Std. Error z value Pr(>|z|) (Intercept) 1.09663 0.25668 4.27 1.9e-05 quality 0.16891 0.05303 3.19 0.0014 skiyes 0.50069 0.13449 3.72 0.0002 income -0.06927 0.04380 -1.58 0.1138 userfeeyes 0.54279 0.28280 1.92 0.0549 costC 0.04044 0.01452 2.79 0.0053 costS -0.06621 0.00775 -8.55 < 2e-16 costH 0.02060 0.01023 2.01 0.0441 Log(theta) 0.19017 0.11299 1.68 0.0924 Zero-inflation model coefficients (binomial with logit link): Estimate Std. Error z value Pr(>|z|) (Intercept) 5.743 1.556 3.69 0.00022 quality -8.307 3.682 -2.26 0.02404 income -0.258 0.282 -0.92 0.35950 Theta = 1.209 Number of iterations in BFGS optimization: 26 Log-likelihood: -722 on 12 Df R> R> R> ################################################### R> ### chunk number 34: countreg-zinb-expected R> ################################################### R> round(colSums(predict(rd_zinb, type = "prob")[,1:10])) 0 1 2 3 4 5 6 7 8 9 433 47 35 27 20 16 12 10 8 7 R> R> R> ################################################### R> ### chunk number 35: countreg-hurdle R> ################################################### R> rd_hurdle <- hurdle(trips ~ . | quality + income, + data = RecreationDemand, dist = "negbin") R> summary(rd_hurdle) Call: hurdle(formula = trips ~ . | quality + income, data = RecreationDemand, dist = "negbin") Pearson residuals: Min 1Q Median 3Q Max -1.610 -0.207 -0.185 -0.164 12.111 Count model coefficients (truncated negbin with log link): Estimate Std. Error z value Pr(>|z|) (Intercept) 0.8419 0.3828 2.20 0.0278 quality 0.1717 0.0723 2.37 0.0176 skiyes 0.6224 0.1901 3.27 0.0011 income -0.0571 0.0645 -0.88 0.3763 userfeeyes 0.5763 0.3851 1.50 0.1345 costC 0.0571 0.0217 2.63 0.0085 costS -0.0775 0.0115 -6.71 1.9e-11 costH 0.0124 0.0149 0.83 0.4064 Log(theta) -0.5303 0.2611 -2.03 0.0423 Zero hurdle model coefficients (binomial with logit link): Estimate Std. Error z value Pr(>|z|) (Intercept) -2.7663 0.3623 -7.64 2.3e-14 quality 1.5029 0.1003 14.98 < 2e-16 income -0.0447 0.0785 -0.57 0.57 Theta: count = 0.588 Number of iterations in BFGS optimization: 18 Log-likelihood: -765 on 12 Df R> R> R> ################################################### R> ### chunk number 36: countreg-hurdle-expected R> ################################################### R> round(colSums(predict(rd_hurdle, type = "prob")[,1:10])) 0 1 2 3 4 5 6 7 8 9 417 74 42 27 19 14 10 8 6 5 R> R> R> ################################################### R> ### chunk number 37: tobit1 R> ################################################### R> data("Affairs") R> aff_tob <- tobit(affairs ~ age + yearsmarried + + religiousness + occupation + rating, data = Affairs) R> summary(aff_tob) Call: tobit(formula = affairs ~ age + yearsmarried + religiousness + occupation + rating, data = Affairs) Observations: Total Left-censored Uncensored Right-censored 601 451 150 0 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 8.1742 2.7414 2.98 0.0029 age -0.1793 0.0791 -2.27 0.0234 yearsmarried 0.5541 0.1345 4.12 3.8e-05 religiousness -1.6862 0.4038 -4.18 3.0e-05 occupation 0.3261 0.2544 1.28 0.2000 rating -2.2850 0.4078 -5.60 2.1e-08 Log(scale) 2.1099 0.0671 31.44 < 2e-16 Scale: 8.25 Gaussian distribution Number of Newton-Raphson Iterations: 4 Log-likelihood: -706 on 7 Df Wald-statistic: 67.7 on 5 Df, p-value: 3.1e-13 R> R> R> ################################################### R> ### chunk number 38: tobit2 R> ################################################### R> aff_tob2 <- update(aff_tob, right = 4) R> summary(aff_tob2) Call: tobit(formula = affairs ~ age + yearsmarried + religiousness + occupation + rating, right = 4, data = Affairs) Observations: Total Left-censored Uncensored Right-censored 601 451 70 80 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 7.9010 2.8039 2.82 0.00483 age -0.1776 0.0799 -2.22 0.02624 yearsmarried 0.5323 0.1412 3.77 0.00016 religiousness -1.6163 0.4244 -3.81 0.00014 occupation 0.3242 0.2539 1.28 0.20162 rating -2.2070 0.4498 -4.91 9.3e-07 Log(scale) 2.0723 0.1104 18.77 < 2e-16 Scale: 7.94 Gaussian distribution Number of Newton-Raphson Iterations: 4 Log-likelihood: -500 on 7 Df Wald-statistic: 42.6 on 5 Df, p-value: 4.5e-08 R> R> R> ################################################### R> ### chunk number 39: tobit3 R> ################################################### R> linearHypothesis(aff_tob, c("age = 0", "occupation = 0"), + vcov = sandwich) Error in model.matrix.default(terms(x), mf) : model frame and formula mismatch in model.matrix() Calls: linearHypothesis ... estfun.survreg -> model.matrix -> model.matrix.default Execution halted Package: boot.pval Check: examples New result: ERROR Running examples in ‘boot.pval-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: censboot_summary > ### Title: Summarising Survival Regression Models Using the Bootstrap > ### Aliases: censboot_summary > > ### ** Examples > > library(survival) > # Weibull AFT model: > # Note that model = TRUE is required for use with censboot_summary: > model <- survreg(formula = Surv(time, status) ~ age + sex, data = lung, + dist = "weibull", model = TRUE) > censboot_summary(model, R = 99) Using exponentiated coefficients. Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: censboot_summary -> -> statistic -> Execution halted Package: CauchyCP Check: examples New result: ERROR Running examples in ‘CauchyCP-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: CauchyCP > ### Title: A robust test under non-proportional hazards using Cauchy > ### combination of change-point Cox regressions. > ### Aliases: CauchyCP > > ### ** Examples > > data(gast) > CauchyCP(time=gast$time, status=gast$status, x=gast$trt) Error in anova.coxphlist(object, test = test) : models do not have the same strata Calls: CauchyCP -> anova -> anova.coxph -> anova.coxphlist Execution halted Package: cg Check: examples New result: ERROR Running examples in ‘cg-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: globalTest > ### Title: Perform a global test of significance > ### Aliases: globalTest > > ### ** Examples > > data(canine) > canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", + analysisname="Canine", + endptname="Prostate Volume", + endptunits=expression(plain(cm)^3), + digits=1, logscale=TRUE, refgrp="CC") > canine.fit <- fit(canine.data) > > canine.globalTest <- globalTest(canine.fit) Global Test P-value of Canine Endpoint: Prostate Volume Classical Least Squares Model Fit: <0.001 Resistant & Robust Model Fit: <0.001 > > data(gmcsfcens) > gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", + analysisname="cytokine", + endptname="GM-CSF (pg/ml)", + logscale=TRUE) > > gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") > > gmcsfcens.globalTest <- globalTest(gmcsfcens.fit) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: globalTest -> globalTest -> survreg Execution halted Package: eventglm Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘example-analysis.Rmd’ using rmarkdown ** Processing: /home/hornik/tmp/CRAN_recheck/eventglm.Rcheck/vign_test/eventglm/vignettes/example-analysis_files/figure-html/unnamed-chunk-3-1.png 672x456 pixels, 3x8 bits/pixel, RGB Input IDAT size = 24912 bytes Input file size = 25026 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 19552 zc = 9 zm = 8 zs = 1 f = 0 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 19552 Output IDAT size = 19552 bytes (5360 bytes decrease) Output file size = 19630 bytes (5396 bytes = 21.56% decrease) ** Processing: /home/hornik/tmp/CRAN_recheck/eventglm.Rcheck/vign_test/eventglm/vignettes/example-analysis_files/figure-html/unnamed-chunk-4-1.png 672x456 pixels, 8 bits/pixel, 255 colors in palette Reducing image to 8 bits/pixel, grayscale Input IDAT size = 8187 bytes Input file size = 9042 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 6886 zc = 9 zm = 8 zs = 1 f = 0 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 6886 Output IDAT size = 6886 bytes (1301 bytes decrease) Output file size = 6964 bytes (2078 bytes = 22.98% decrease) ** Processing: /home/hornik/tmp/CRAN_recheck/eventglm.Rcheck/vign_test/eventglm/vignettes/example-analysis_files/figure-html/unnamed-chunk-21-1.png 672x456 pixels, 3x8 bits/pixel, RGB Input IDAT size = 38963 bytes Input file size = 39089 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 30144 zc = 9 zm = 8 zs = 1 f = 0 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 30144 Output IDAT size = 30144 bytes (8819 bytes decrease) Output file size = 30222 bytes (8867 bytes = 22.68% decrease) ** Processing: /home/hornik/tmp/CRAN_recheck/eventglm.Rcheck/vign_test/eventglm/vignettes/example-analysis_files/figure-html/unnamed-chunk-25-1.png 672x456 pixels, 8 bits/pixel, 256 colors in palette Reducing image to 8 bits/pixel, grayscale Input IDAT size = 6578 bytes Input file size = 7436 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 5356 zc = 9 zm = 8 zs = 1 f = 0 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 5356 Output IDAT size = 5356 bytes (1222 bytes decrease) Output file size = 5434 bytes (2002 bytes = 26.92% decrease) ** Processing: /home/hornik/tmp/CRAN_recheck/eventglm.Rcheck/vign_test/eventglm/vignettes/example-analysis_files/figure-html/unnamed-chunk-25-2.png 672x456 pixels, 8 bits/pixel, 255 colors in palette Reducing image to 8 bits/pixel, grayscale Input IDAT size = 5913 bytes Input file size = 6768 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 5170 zc = 9 zm = 8 zs = 1 f = 0 IDAT size = 5170 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 1 f = 0 IDAT size = 5170 Output IDAT size = 5170 bytes (743 bytes decrease) Output file size = 5248 bytes (1520 bytes = 22.46% decrease) --- finished re-building ‘example-analysis.Rmd’ --- re-building ‘extenstions.Rmd’ using rmarkdown Quitting from lines 75-85 [unnamed-chunk-4] (extenstions.Rmd) Error: processing vignette 'extenstions.Rmd' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘extenstions.Rmd’ --- re-building ‘stata-sas-comparason.Rmd’ using rmarkdown [WARNING] Div at stata-sas-comparason.knit.md line 198 column 1 unclosed at stata-sas-comparason.knit.md line 271 column 1, closing implicitly. --- finished re-building ‘stata-sas-comparason.Rmd’ SUMMARY: processing the following file failed: ‘extenstions.Rmd’ Error: Vignette re-building failed. Execution halted Package: eventPred Check: examples New result: ERROR Running examples in ‘eventPred-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: fitDropout > ### Title: Fit time-to-dropout model > ### Aliases: fitDropout > > ### ** Examples > > > dropout_fit <- fitDropout(df = interimData2, + dropout_model = "exponential") Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: fitDropout -> Execution halted Package: eventPred Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘event_prediction_after_enrollment_completion.Rmd’ using rmarkdown Quitting from lines 29-40 [unnamed-chunk-2] (event_prediction_after_enrollment_completion.Rmd) Error: processing vignette 'event_prediction_after_enrollment_completion.Rmd' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘event_prediction_after_enrollment_completion.Rmd’ --- re-building ‘event_prediction_at_the_design_stage.Rmd’ using rmarkdown --- finished re-building ‘event_prediction_at_the_design_stage.Rmd’ --- re-building ‘event_prediction_before_enrollment_completion.Rmd’ using rmarkdown Quitting from lines 28-40 [unnamed-chunk-2] (event_prediction_before_enrollment_completion.Rmd) Error: processing vignette 'event_prediction_before_enrollment_completion.Rmd' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘event_prediction_before_enrollment_completion.Rmd’ --- re-building ‘event_prediction_incorporating_covariates.Rmd’ using rmarkdown Quitting from lines 29-45 [unnamed-chunk-2] (event_prediction_incorporating_covariates.Rmd) Error: processing vignette 'event_prediction_incorporating_covariates.Rmd' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘event_prediction_incorporating_covariates.Rmd’ --- re-building ‘event_prediction_incorporating_prior_information.Rmd’ using rmarkdown Quitting from lines 28-48 [unnamed-chunk-2] (event_prediction_incorporating_prior_information.Rmd) Error: processing vignette 'event_prediction_incorporating_prior_information.Rmd' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘event_prediction_incorporating_prior_information.Rmd’ SUMMARY: processing the following files failed: ‘event_prediction_after_enrollment_completion.Rmd’ ‘event_prediction_before_enrollment_completion.Rmd’ ‘event_prediction_incorporating_covariates.Rmd’ ‘event_prediction_incorporating_prior_information.Rmd’ Error: Vignette re-building failed. Execution halted Package: GenEst Check: examples New result: ERROR Running examples in ‘GenEst-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: aicc.cpm > ### Title: Extract AIC and AICc for a carcass persistence model > ### Aliases: aicc.cpm > > ### ** Examples > > data(wind_RP) > mod <- cpm(formula_l = l ~ Season, formula_s = s ~ Season, + data = wind_RP$CP, left = "LastPresent", right = "FirstAbsent") Error in cpm0(formula_l = formula_l, formula_s = formula_s, data = data, : Failed CP model optimization. Calls: cpm -> cpm0 Execution halted Package: GenEst Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘GenEstGUI.Rmd’ using rmarkdown --- finished re-building ‘GenEstGUI.Rmd’ --- re-building ‘command-line-example.Rmd’ using rmarkdown ** Processing: /home/hornik/tmp/CRAN_recheck/GenEst.Rcheck/vign_test/GenEst/vignettes/command-line-example_files/figure-html/unnamed-chunk-8-1.png 672x672 pixels, 3x8 bits/pixel, RGB Input IDAT size = 36356 bytes Input file size = 36482 bytes Trying: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 28395 zc = 9 zm = 8 zs = 1 f = 0 zc = 1 zm = 8 zs = 2 f = 0 zc = 9 zm = 8 zs = 3 f = 0 zc = 9 zm = 8 zs = 0 f = 5 zc = 9 zm = 8 zs = 1 f = 5 zc = 1 zm = 8 zs = 2 f = 5 zc = 9 zm = 8 zs = 3 f = 5 Selecting parameters: zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 28395 Output IDAT size = 28395 bytes (7961 bytes decrease) Output file size = 28473 bytes (8009 bytes = 21.95% decrease) Quitting from lines 212-217 [unnamed-chunk-17] (command-line-example.Rmd) Error: processing vignette 'command-line-example.Rmd' failed with diagnostics: Failed CP model optimization. --- failed re-building ‘command-line-example.Rmd’ --- re-building ‘solar-examples.Rmd’ using rmarkdown Quitting from lines 184-188 [cp] (solar-examples.Rmd) Error: processing vignette 'solar-examples.Rmd' failed with diagnostics: Failed CP model optimization. --- failed re-building ‘solar-examples.Rmd’ --- re-building ‘wind-examples.Rmd’ using rmarkdown Quitting from lines 234-238 [unnamed-chunk-11] (wind-examples.Rmd) Error: processing vignette 'wind-examples.Rmd' failed with diagnostics: Failed CP model optimization. --- failed re-building ‘wind-examples.Rmd’ SUMMARY: processing the following files failed: ‘command-line-example.Rmd’ ‘solar-examples.Rmd’ ‘wind-examples.Rmd’ Error: Vignette re-building failed. Execution halted Package: ggRandomForests Check: tests New result: ERROR Running ‘test-all.R’ [217s/118s] Running the tests in ‘tests/test-all.R’ failed. Complete output: > library(testthat) > > test_check("ggRandomForests") Loading required package: ggRandomForests Loading required package: randomForestSRC randomForestSRC 3.3.1 Type rfsrc.news() to see new features, changes, and bug fixes. Loading required package: randomForest randomForest 4.7-1.2 Type rfNews() to see new features/changes/bug fixes. Method: maxsubtree No. of variables: 4 Variables sorted by minimal depth?: TRUE Petal.Width Petal.Length Sepal.Length Sepal.Width Petal.Width 0.16 0.49 0.64 0.65 Petal.Length 0.47 0.20 0.63 0.66 Sepal.Length 0.67 0.67 0.45 0.75 Sepal.Width 0.84 0.84 0.88 0.62 Method: maxsubtree No. of variables: 13 Variables sorted by minimal depth?: TRUE lstat rm nox ptratio crim dis tax indus age black rad chas zn lstat 0.09 0.19 0.25 0.30 0.25 0.23 0.32 0.38 0.30 0.35 0.49 0.76 0.73 rm 0.22 0.11 0.33 0.32 0.34 0.30 0.33 0.43 0.33 0.40 0.50 0.77 0.72 nox 0.33 0.40 0.20 0.58 0.39 0.43 0.60 0.65 0.51 0.53 0.76 0.87 0.88 ptratio 0.37 0.35 0.51 0.21 0.50 0.47 0.53 0.57 0.46 0.52 0.67 0.85 0.83 crim 0.35 0.42 0.43 0.65 0.22 0.43 0.63 0.68 0.46 0.51 0.79 0.89 0.91 dis 0.37 0.39 0.52 0.60 0.48 0.24 0.57 0.64 0.49 0.54 0.74 0.90 0.86 tax 0.50 0.43 0.63 0.64 0.60 0.57 0.30 0.69 0.56 0.64 0.75 0.92 0.88 indus 0.50 0.46 0.62 0.64 0.63 0.58 0.64 0.30 0.56 0.66 0.76 0.89 0.86 age 0.47 0.47 0.62 0.63 0.53 0.53 0.64 0.64 0.31 0.60 0.77 0.88 0.90 black 0.59 0.58 0.73 0.77 0.64 0.63 0.76 0.78 0.63 0.34 0.84 0.95 0.95 rad 0.68 0.66 0.81 0.81 0.78 0.77 0.79 0.82 0.74 0.79 0.44 0.96 0.93 chas 0.80 0.81 0.86 0.90 0.84 0.86 0.90 0.92 0.84 0.87 0.93 0.66 0.98 zn 0.88 0.84 0.92 0.90 0.92 0.90 0.92 0.93 0.90 0.92 0.95 0.98 0.67 Method: maxsubtree No. of variables: 13 Variables sorted by minimal depth?: TRUE lstat rm nox ptratio crim dis tax indus age black rad chas zn lstat 0.09 0.19 0.25 0.30 0.25 0.23 0.32 0.38 0.30 0.35 0.49 0.76 0.73 rm 0.22 0.11 0.33 0.32 0.34 0.30 0.33 0.43 0.33 0.40 0.50 0.77 0.72 nox 0.33 0.40 0.20 0.58 0.39 0.43 0.60 0.65 0.51 0.53 0.76 0.87 0.88 ptratio 0.37 0.35 0.51 0.21 0.50 0.47 0.53 0.57 0.46 0.52 0.67 0.85 0.83 crim 0.35 0.42 0.43 0.65 0.22 0.43 0.63 0.68 0.46 0.51 0.79 0.89 0.91 dis 0.37 0.39 0.52 0.60 0.48 0.24 0.57 0.64 0.49 0.54 0.74 0.90 0.86 tax 0.50 0.43 0.63 0.64 0.60 0.57 0.30 0.69 0.56 0.64 0.75 0.92 0.88 indus 0.50 0.46 0.62 0.64 0.63 0.58 0.64 0.30 0.56 0.66 0.76 0.89 0.86 age 0.47 0.47 0.62 0.63 0.53 0.53 0.64 0.64 0.31 0.60 0.77 0.88 0.90 black 0.59 0.58 0.73 0.77 0.64 0.63 0.76 0.78 0.63 0.34 0.84 0.95 0.95 rad 0.68 0.66 0.81 0.81 0.78 0.77 0.79 0.82 0.74 0.79 0.44 0.96 0.93 chas 0.80 0.81 0.86 0.90 0.84 0.86 0.90 0.92 0.84 0.87 0.93 0.66 0.98 zn 0.88 0.84 0.92 0.90 0.92 0.90 0.92 0.93 0.90 0.92 0.95 0.98 0.67 minimal depth variable selection ... ----------------------------------------------------------- family : class var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 4 sample size : 150 ntree : 500 nsplit : 10 mtry : 2 nodesize : 1 refitted forest : FALSE model size : 2 depth threshold : 2.1141 PE (true OOB) : 0.0533 0.02 0.08 0.06 Top variables: depth vimp.all vimp.setosa vimp.versicolor vimp.virginica Petal.Width 0.894 0.616 1.693 2.026 1.237 Petal.Length 1.058 0.532 1.338 1.804 1.141 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : regr var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 13 sample size : 506 ntree : 500 nsplit : 10 mtry : 5 nodesize : 5 refitted forest : FALSE model size : 10 depth threshold : 5.5329 PE (true OOB) : 11.4276 Top variables: depth vimp lstat 1.106 143.672 rm 1.338 114.172 ptratio 2.378 12.138 nox 2.664 10.429 crim 2.728 8.006 dis 2.934 22.560 tax 3.590 7.394 indus 3.682 7.098 age 3.846 3.700 black 4.164 2.641 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : regr var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 13 sample size : 506 ntree : 500 nsplit : 10 mtry : 5 nodesize : 5 refitted forest : FALSE model size : 10 depth threshold : 5.5176 PE (true OOB) : 11.3761 Top variables: depth vimp lstat 1.110 145.004 rm 1.290 116.108 nox 2.532 10.983 ptratio 2.582 10.230 crim 2.656 9.445 dis 3.012 20.756 tax 3.578 7.115 indus 3.810 7.778 age 3.910 3.574 black 4.110 2.873 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : class var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 4 sample size : 150 ntree : 500 nsplit : 10 mtry : 2 nodesize : 1 refitted forest : FALSE model size : 2 depth threshold : 2.1372 PE (true OOB) : 0.0467 0 0.08 0.06 Top variables: depth vimp.all vimp.setosa vimp.versicolor vimp.virginica Petal.Width 0.902 0.629 1.711 2.088 1.279 Petal.Length 1.110 0.541 1.414 1.792 1.159 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : regr var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 13 sample size : 506 ntree : 500 nsplit : 10 mtry : 5 nodesize : 5 refitted forest : FALSE model size : 10 depth threshold : 5.5673 PE (true OOB) : 11.2759 Top variables: depth vimp lstat 1.128 133.073 rm 1.288 114.983 nox 2.588 11.165 ptratio 2.636 10.955 crim 2.704 8.576 dis 3.018 21.296 tax 3.448 7.982 indus 3.774 7.141 age 3.792 4.061 black 4.012 3.444 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : regr var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 13 sample size : 506 ntree : 500 nsplit : 10 mtry : 5 nodesize : 5 refitted forest : FALSE model size : 10 depth threshold : 5.5193 PE (true OOB) : 11.535 Top variables: depth vimp lstat 1.100 153.633 rm 1.338 109.965 ptratio 2.602 11.629 nox 2.612 10.597 crim 2.684 8.839 dis 2.928 21.961 tax 3.620 7.664 age 3.730 3.561 indus 3.838 7.291 black 4.100 3.001 ----------------------------------------------------------- minimal depth variable selection ... ----------------------------------------------------------- family : regr var. selection : Minimal Depth conservativeness : medium x-weighting used? : TRUE dimension : 13 sample size : 506 ntree : 500 nsplit : 10 mtry : 5 nodesize : 5 refitted forest : FALSE model size : 11 depth threshold : 5.5321 PE (true OOB) : 11.6408 Top variables: depth vimp lstat 1.146 149.260 rm 1.324 109.474 ptratio 2.642 11.922 nox 2.716 9.374 crim 2.808 8.032 dis 2.976 20.339 tax 3.468 7.171 indus 3.584 7.999 age 3.708 3.169 black 4.132 3.133 rad 5.522 3.951 ----------------------------------------------------------- pbc: rfsrc [1] "gg_partial" "data.frame" "regr" [ FAIL 1 | WARN 4 | SKIP 4 | PASS 302 ] ══ Skipped tests (4) ═══════════════════════════════════════════════════════════ • On CRAN (1): 'test_survival_datasets.R:5:3' • Skip: Test currently fails (partial.rfsrc problem) (3): 'test_partial.rfsrc.R:17:3', 'test_partial.rfsrc.R:105:3', 'test_partial.rfsrc.R:134:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test_gg_survival.R:17:3'): gg_survival survival ───────────────────── Error in ``[.data.frame`(mf, ll)`: undefined columns selected Backtrace: ▆ 1. └─ggRandomForests::gg_survival(...) at test_gg_survival.R:17:3 2. └─ggRandomForests::kaplan(...) 3. ├─survival::survfit(srv ~ survival::strata(data[, by]), ...) 4. └─survival::survfit.formula(...) 5. ├─survival::strata(mf[ll]) 6. ├─mf[ll] 7. └─base::`[.data.frame`(mf, ll) [ FAIL 1 | WARN 4 | SKIP 4 | PASS 302 ] Error: Test failures Execution halted Package: gravity Check: examples New result: ERROR Running examples in ‘gravity-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: ek_tobit > ### Title: Eaton and Kortum (2001) Tobit model (EK Tobit) > ### Aliases: ek_tobit > > ### ** Examples > > # Example for CRAN checks: > # Executable in < 5 sec > library(dplyr) Attaching package: ‘dplyr’ The following objects are masked from ‘package:stats’: filter, lag The following objects are masked from ‘package:base’: intersect, setdiff, setequal, union > data("gravity_no_zeros") > > # Choose 5 countries for testing > countries_chosen <- c("AUS", "CHN", "GBR", "BRA", "CAN") > grav_small <- filter(gravity_no_zeros, iso_o %in% countries_chosen) > > grav_small <- grav_small %>% + mutate( + flow = ifelse(flow < 5, 0, flow), # cutoff for testing purposes + lgdp_o = log(gdp_o), + lgdp_d = log(gdp_d) + ) > > fit <- ek_tobit( + dependent_variable = "flow", + distance = "distw", + additional_regressors = c("distw", "rta", "lgdp_o", "lgdp_d"), + code_destination = "iso_d", + robust = FALSE, + data = grav_small + ) Warning: There were 4 warnings in `mutate()`. The first warning was: ℹ In argument: `exportmin = min(y_log_ek, na.rm = TRUE)`. ℹ In group 21: `iso_d = "BTN"`. Caused by warning in `min()`: ! no non-missing arguments to min; returning Inf ℹ Run `dplyr::last_dplyr_warnings()` to see the 3 remaining warnings. Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: ek_tobit -> Execution halted Package: gravity Check: tests New result: ERROR Running ‘testthat.R’ [8s/9s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(gravity) Gravity 1.1 If this package is useful, please support it. https://www.buymeacoffee.com/pacha. Attaching package: 'gravity' The following object is masked from 'package:stats': nls > > test_check("gravity") [ FAIL 1 | WARN 5 | SKIP 0 | PASS 15 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-ek_tobit.R:20:3'): EK Tobit returns a valid output ───────────── Error in `environment(temp$formula) <- coxenv`: cannot set attribute on a symbol Backtrace: ▆ 1. └─gravity::ek_tobit(...) at test-ek_tobit.R:20:3 2. └─survival::survreg(form, data = d, dist = "gaussian", robust = robust) [ FAIL 1 | WARN 5 | SKIP 0 | PASS 15 ] Error: Test failures Execution halted Package: InformativeCensoring Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘gamma_imputation_Jackson_2014.Rnw’ using knitr Quitting from lines 153-154 [unnamed-chunk-7] (gamma_imputation_Jackson_2014.Rnw) Error: processing vignette 'gamma_imputation_Jackson_2014.Rnw' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘gamma_imputation_Jackson_2014.Rnw’ --- re-building ‘risk_score_imputation_Hsu_2009.Rnw’ using knitr --- finished re-building ‘risk_score_imputation_Hsu_2009.Rnw’ SUMMARY: processing the following file failed: ‘gamma_imputation_Jackson_2014.Rnw’ Error: Vignette re-building failed. Execution halted Package: InformativeCensoring Check: tests New result: ERROR Running ‘testthat.R’ [157s/157s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library("InformativeCensoring") Loading required package: survival Attaching package: 'InformativeCensoring' The following object is masked from 'package:survival': cox.zph > > test_check("InformativeCensoring") [ FAIL 1 | WARN 0 | SKIP 0 | PASS 493 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-gammaStat.R:54:3'): weibull_and_exponential ──────────────────── Error in `environment(temp$formula) <- coxenv`: cannot set attribute on a symbol Backtrace: ▆ 1. ├─InformativeCensoring::ImputeStat(df, method = "weibull") at test-gammaStat.R:54:3 2. └─InformativeCensoring:::ImputeStat.GammaImputedData(df, method = "weibull") 3. └─InformativeCensoring:::.imputeStat.internal(...) 4. └─switch(method, logrank = .Testlogrank, Wilcoxon = .Testwilcoxon, ... 5. └─InformativeCensoring:::.Testsurv(...) 6. └─survival (local) model.function(formula, data = object$data, model = TRUE, ...) [ FAIL 1 | WARN 0 | SKIP 0 | PASS 493 ] Error: Test failures Execution halted Package: lnmixsurv Check: tests New result: ERROR Running ‘testthat.R’ [34s/34s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(lnmixsurv) Loading required package: parsnip Loading required package: survival Loading required package: ggplot2 > > test_check("lnmixsurv") [ FAIL 2 | WARN 0 | SKIP 6 | PASS 50 ] ══ Skipped tests (6) ═══════════════════════════════════════════════════════════ • On CRAN (6): 'test-join_empirical_hazard.R:6:3', 'test-plot_fit_on_data.R:6:3', 'test-plot_fit_on_data.R:34:3', 'test-survival_ln_mixture-print-summary.R:3:3', 'test-survival_ln_mixture_em-methods.R:25:3', 'test-survival_ln_mixture_em-print-summary.R:3:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-plot_fit_on_data.R:20:3'): plot_fit_on_data works for Bayesian model with intercept only ── Error in ``[.data.frame`(mf, ll)`: undefined columns selected Backtrace: ▆ 1. └─testthat::expect_snapshot(...) at test-plot_fit_on_data.R:20:3 2. └─rlang::cnd_signal(state$error) ── Error ('test-plot_fit_on_data.R:42:3'): plot_fit_on_data works for EM model with intercept only ── Error in ``[.data.frame`(mf, ll)`: undefined columns selected Backtrace: ▆ 1. └─testthat::expect_snapshot(plot_fit_on_data(mod, data_model, type = "survival")$preds) at test-plot_fit_on_data.R:42:3 2. └─rlang::cnd_signal(state$error) [ FAIL 2 | WARN 0 | SKIP 6 | PASS 50 ] Error: Test failures Execution halted Package: MASS Check: differences from ‘MASS-Ex.Rout’ to ‘MASS-Ex.Rout.save’ New result: NOTE 2691c2691 < Number of Newton-Raphson Iterations: 8 --- > Number of Newton-Raphson Iterations: 7 Package: mlt.docreg Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘mlt.Rnw’ using knitr trying URL 'https://zenodo.org/record/17179/files/DVC.tgz' Content type 'application/octet-stream' length 2292581 bytes (2.2 MB) ================================================== downloaded 2.2 MB Quitting from lines 1058-1067 [mlt-GBSG2-2-exp] (mlt.Rnw) Error: processing vignette 'mlt.Rnw' failed with diagnostics: cannot set attribute on a symbol --- failed re-building ‘mlt.Rnw’ SUMMARY: processing the following file failed: ‘mlt.Rnw’ Error: Vignette re-building failed. Execution halted Package: My.stepwise Check: examples New result: ERROR Running examples in ‘My.stepwise-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: My.stepwise.coxph > ### Title: Stepwise Variable Selection Procedure for Cox's Proportional > ### Hazards Model and Cox's Model > ### Aliases: My.stepwise.coxph > > ### ** Examples > > ## Not run: > ##D The data 'lung' is available in the 'survival' package. > ## End(Not run) > > if (requireNamespace("survival", quietly = TRUE)) { + lung <- survival::lung + } > > names(lung) [1] "inst" "time" "status" "age" "sex" "ph.ecog" [7] "ph.karno" "pat.karno" "meal.cal" "wt.loss" > dim(lung) [1] 228 10 > my.data <- na.omit(lung) > dim(my.data) [1] 167 10 > head(my.data) inst time status age sex ph.ecog ph.karno pat.karno meal.cal wt.loss 2 3 455 2 68 1 0 90 90 1225 15 4 5 210 2 57 1 1 90 60 1150 11 6 12 1022 1 74 1 1 50 80 513 0 7 7 310 2 68 2 2 70 60 384 10 8 11 361 2 71 2 2 60 80 538 1 9 1 218 2 53 1 1 70 80 825 16 > my.data$status1 <- ifelse(my.data$status==2,1,0) > my.variable.list <- c("inst", "age", "sex", "ph.ecog", "ph.karno", "pat.karno") > My.stepwise.coxph(Time = "time", Status = "status1", variable.list = my.variable.list, + in.variable = c("meal.cal", "wt.loss"), data = my.data) # -------------------------------------------------------------------------------------------------- # Initial Model: Call: coxph(formula = as.formula(paste("Surv(", Time, ", ", Status, ") ~ ", paste(in.variable, collapse = "+"), sep = "")), data = data, method = "efron") n= 167, number of events= 120 coef exp(coef) se(coef) z Pr(>|z|) meal.cal -1.198e-04 9.999e-01 2.430e-04 -0.493 0.622 wt.loss -4.974e-05 1.000e+00 6.798e-03 -0.007 0.994 exp(coef) exp(-coef) lower .95 upper .95 meal.cal 0.9999 1 0.9994 1.000 wt.loss 1.0000 1 0.9867 1.013 Concordance= 0.534 (se = 0.031 ) Likelihood ratio test= 0.25 on 2 df, p=0.9 Wald test = 0.24 on 2 df, p=0.9 Score (logrank) test = 0.24 on 2 df, p=0.9 --------------- Variance Inflating Factor (VIF) --------------- Multicollinearity Problem: Variance Inflating Factor (VIF) is bigger than 10 (Continuous Variable) or is bigger than 2.5 (Categorical Variable) meal.cal wt.loss 1.027017 1.027017 Warning in min(anova.pvalue2, na.rm = TRUE) : no non-missing arguments to min; returning Inf Warning in min(anova.pvalue2, na.rm = TRUE) : no non-missing arguments to min; returning Inf # ================================================================================================== *** Stepwise Final Model (in.lr.test: sle = 0.15; variable selection restrict in vif = 999): Call: coxph(formula = as.formula(paste("Surv(", Time, ", ", Status, ") ~ ", paste(in.variable, collapse = "+"), sep = "")), data = data, method = "efron") n= 167, number of events= 120 coef exp(coef) se(coef) z Pr(>|z|) meal.cal -1.198e-04 9.999e-01 2.430e-04 -0.493 0.622 wt.loss -4.974e-05 1.000e+00 6.798e-03 -0.007 0.994 exp(coef) exp(-coef) lower .95 upper .95 meal.cal 0.9999 1 0.9994 1.000 wt.loss 1.0000 1 0.9867 1.013 Concordance= 0.534 (se = 0.031 ) Likelihood ratio test= 0.25 on 2 df, p=0.9 Wald test = 0.24 on 2 df, p=0.9 Score (logrank) test = 0.24 on 2 df, p=0.9 > > my.variable.list <- c("inst", "age", "sex", "ph.ecog", "ph.karno", "pat.karno", "meal.cal", + "wt.loss") > My.stepwise.coxph(Time = "time", Status = "status1", variable.list = my.variable.list, + data = my.data, sle = 0.25, sls = 0.25) Error in coxph(as.formula(paste("Surv(", Time, ", ", Status, ") ~ ", paste(in.variable, : Response must be a survival object Calls: My.stepwise.coxph -> coxph Execution halted Package: netdiffuseR Check: examples New result: ERROR Running examples in ‘netdiffuseR-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: exposure > ### Title: Ego exposure > ### Aliases: exposure > ### Keywords: univar > > ### ** Examples > > # Calculating lagged exposure ----------------------------------------------- > > set.seed(8) > graph <- rdiffnet(20, 4) Warning in (function (graph, p, algorithm = "endpoints", both.ends = FALSE, : The option -copy.first- is set to TRUE. In this case, the first graph will be treated as a baseline, and thus, networks after T=1 will be replaced with T-1. > > expo0 <- exposure(graph) > expo1 <- exposure(graph, lags = 1) > > # These should be equivalent > stopifnot(all(expo0[, -4] == expo1[, -1])) # No stop! > > > # Calculating the exposure based on Structural Equivalence ------------------ > set.seed(113132) > graph <- rdiffnet(100, 4) Warning in (function (graph, p, algorithm = "endpoints", both.ends = FALSE, : The option -copy.first- is set to TRUE. In this case, the first graph will be treated as a baseline, and thus, networks after T=1 will be replaced with T-1. > > SE <- lapply(struct_equiv(graph), "[[", "SE") > SE <- lapply(SE, function(x) { + x <- 1/x + x[!is.finite(x)] <- 0 + x + }) > > > # These three lines are equivalent to: > expo_se2 <- exposure(graph, alt.graph="se", valued=TRUE) > # Notice that we are setting valued=TRUE, but this is not necesary since when > # alt.graph = "se" the function checks this to be setted equal to TRUE > > # Weighted Exposure using degree -------------------------------------------- > eDE <- exposure(graph, attrs=dgr(graph)) > > # Which is equivalent to > graph[["deg"]] <- dgr(graph) > eDE2 <- exposure(graph, attrs="deg") > > # Comparing using incoming edges ------------------------------------------- > eIN <- exposure(graph, outgoing=FALSE) > > # Structral equivalence for different communities --------------------------- > data(medInnovationsDiffNet) > > # Only using 4 time slides, this is for convenience > medInnovationsDiffNet <- medInnovationsDiffNet[, , 1:4] > > # METHOD 1: Using the c.diffnet method: > > # Creating subsets by city > cities <- unique(medInnovationsDiffNet[["city"]]) > > diffnet <- medInnovationsDiffNet[medInnovationsDiffNet[["city"]] == cities[1]] > diffnet[["expo_se"]] <- exposure(diffnet, alt.graph="se", valued=TRUE) *** caught segfault *** address (nil), cause 'unknown' Traceback: 1: .M2C(newTMat(i = c(ij1[, 1], ij2[, 1]), j = c(ij1[, 2], ij2[, 2]), x = if (Generic == "+") c(e1@x, e2@x) else c(e1@x, -e2@x))) 2: .Arith.Csparse(e1, e2, .Generic, class. = "dgCMatrix") 3: d[, ids[, 1]] - d[, ids[, 2]] 4: d[, ids[, 1]] - d[, ids[, 2]] 5: euclidean_distance(gdist) 6: struct_equiv_new(geod, v) 7: struct_equiv.dgCMatrix(methods::as(graph[[i]], "dgCMatrix"), v, inf.replace, groupvar, ...) 8: struct_equiv.list(graph, v, inf.replace, groupvar, ...) 9: struct_equiv(graph, groupvar = groupvar, ...) 10: lapply(struct_equiv(graph, groupvar = groupvar, ...), "[[", "SE") 11: exposure(diffnet, alt.graph = "se", valued = TRUE) An irrecoverable exception occurred. R is aborting now ... Segmentation fault Package: RESI Check: tests New result: ERROR Running ‘testthat.R’ [116s/116s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(RESI) > > test_check("RESI") Loading required package: carData Loading required namespace: splines Loading required namespace: survival Loading required namespace: pscl Loading required namespace: gee Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 running glm to get initial regression estimate (Intercept) diagnosesevere drugstandard time -0.08759224 -1.31391092 0.05960381 1.49985707 drugstandard:time -1.01744498 Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 running glm to get initial regression estimate (Intercept) 0.0902573 Loading required namespace: geepack Loading required namespace: lme4 boundary (singular) fit: see help('isSingular') Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 running glm to get initial regression estimate (Intercept) diagnosesevere drugstandard time -0.08759224 -1.31391092 0.05960381 1.49985707 drugstandard:time -1.01744498 Updating model fit failed. Try running with providing data argument Updating model fit failed. Try running with providing data argument [ FAIL 7 | WARN 0 | SKIP 0 | PASS 50 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-resi.R:142:3'): Specifying non-allowed vcov produces warning ─── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-resi.R:142:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. ├─RESI::resi(mod.surv, data = data.surv, nboot = 1, vcovfunc = sandwich::vcovHC) 8. └─RESI:::resi.survreg(mod.surv, data = data.surv, nboot = 1, vcovfunc = sandwich::vcovHC) 9. └─RESI:::resi.default(...) 10. ├─RESI::resi_pe(...) 11. └─RESI:::resi_pe.survreg(...) 12. └─RESI:::resi_pe.default(...) 13. └─base::tryCatch(...) 14. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 15. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 16. └─value[[3L]](cond) ── Error ('test-resi.R:192:3'): resi produces the correct estimates ──────────── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-resi.R:192:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─base::unname(resi(mod.surv, nboot = 1, data = data.surv)$estimates) 5. ├─RESI::resi(mod.surv, nboot = 1, data = data.surv) 6. └─RESI:::resi.survreg(mod.surv, nboot = 1, data = data.surv) 7. └─RESI:::resi.default(...) 8. ├─RESI::resi_pe(...) 9. └─RESI:::resi_pe.survreg(...) 10. └─RESI:::resi_pe.default(...) 11. └─base::tryCatch(...) 12. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 13. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 14. └─value[[3L]](cond) ── Error ('test-resi.R:280:3'): unbiased = FALSE returns same abs. RESI as Chi-sq/F ── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─RESI::resi(mod.surv, data = data.surv, nboot = 1, unbiased = FALSE) at test-resi.R:280:3 2. └─RESI:::resi.survreg(mod.surv, data = data.surv, nboot = 1, unbiased = FALSE) 3. └─RESI:::resi.default(...) 4. ├─RESI::resi_pe(...) 5. └─RESI:::resi_pe.survreg(...) 6. └─RESI:::resi_pe.default(...) 7. └─base::tryCatch(...) 8. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 9. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 10. └─value[[3L]](cond) ── Error ('test-resi.R:304:3'): Specifying a reduced model only changes overall output ── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─RESI::resi(mod.surv, data = data.surv, nboot = 1) at test-resi.R:304:3 2. └─RESI:::resi.survreg(mod.surv, data = data.surv, nboot = 1) 3. └─RESI:::resi.default(...) 4. ├─RESI::resi_pe(...) 5. └─RESI:::resi_pe.survreg(...) 6. └─RESI:::resi_pe.default(...) 7. └─base::tryCatch(...) 8. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 9. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 10. └─value[[3L]](cond) ── Error ('test-resi.R:322:3'): specifying additional Anova args works ───────── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─testthat::expect_false(...) at test-resi.R:322:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─RESI::resi(mod.surv, data = data.surv, nboot = 1, Anova.args = list(type = "3")) 5. └─RESI:::resi.survreg(mod.surv, data = data.surv, nboot = 1, Anova.args = list(type = "3")) 6. └─RESI:::resi.default(...) 7. ├─RESI::resi_pe(...) 8. └─RESI:::resi_pe.survreg(...) 9. └─RESI:::resi_pe.default(...) 10. └─base::tryCatch(...) 11. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 12. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 13. └─value[[3L]](cond) ── Error ('test-resi.R:343:3'): tibbles work ─────────────────────────────────── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-resi.R:343:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─base::unname(resi(mod.surv.tib, nboot = 1, data = data.surv)$estimates) 5. ├─RESI::resi(mod.surv.tib, nboot = 1, data = data.surv) 6. └─RESI:::resi.survreg(mod.surv.tib, nboot = 1, data = data.surv) 7. └─RESI:::resi.default(...) 8. ├─RESI::resi_pe(...) 9. └─RESI:::resi_pe.survreg(...) 10. └─RESI:::resi_pe.default(...) 11. └─base::tryCatch(...) 12. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 13. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 14. └─value[[3L]](cond) ── Error ('test-resi.R:366:5'): intercept-only full model works and doesn't have overall element ── Error in `value[[3L]](cond)`: car::Anova failed. Try rerunning with anova = FALSE Backtrace: ▆ 1. ├─testthat::expect_true(...) at test-resi.R:366:5 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─RESI::resi(mod.surv.int, data = data.surv, nboot = 1, Anova.args = list(type = 3)) 5. └─RESI:::resi.survreg(...) 6. └─RESI:::resi.default(...) 7. ├─RESI::resi_pe(...) 8. └─RESI:::resi_pe.survreg(...) 9. └─RESI:::resi_pe.default(...) 10. └─base::tryCatch(...) 11. └─base (local) tryCatchList(expr, classes, parentenv, handlers) 12. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 13. └─value[[3L]](cond) [ FAIL 7 | WARN 0 | SKIP 0 | PASS 50 ] Error: Test failures Execution halted Package: rineq Check: examples New result: ERROR Running examples in ‘rineq-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: contribution > ### Title: Function to decompose the Relative Concentration Index into its > ### components > ### Aliases: contribution > > ### ** Examples > > data(housing) > > ## Linear regression direct decomposition > fit.lm <- lm(bmi ~ sex + tenure + place + age,data = housing) > > # decompose relative concentration index > contrib.lm <- contribution(fit.lm, housing$income) > summary(contrib.lm) Overall CI: 0.121004 95% confidence interval: 0.1181791 0.123829 Decomposition: Contribution (%) Contribution (Abs) Elasticity residual 38.2448886 0.0462779 0.0000000 sexmale 70.3033532 0.0850699 0.2241433 tenureirregular -16.8438839 -0.0203818 0.0307882 tenureown_apartment 0.0751962 0.0000910 0.0018771 tenureown_house 1.3489119 0.0016322 0.0136284 tenurerent 6.6988511 0.0081059 0.0517000 placeurban 0.0671404 0.0000812 -0.0123887 age 0.1055426 0.0001277 0.0324067 Concentration Index lower 5% upper 5% Corrected residual NA NA NA no sexmale 0.3795336 0.3691540 0.3899131 no tenureirregular -0.6619993 -0.6980505 -0.6259481 no tenureown_apartment 0.0484737 0.0260028 0.0709447 no tenureown_house 0.1197676 0.0926766 0.1468586 no tenurerent 0.1567869 0.1440879 0.1694859 no placeurban -0.0065578 -0.0188208 0.0057052 no age 0.0039409 -0.0000583 0.0079401 no > plot(contrib.lm, decreasing = FALSE, horiz = TRUE) > > > # GLM: Decomposition based on predicted outcome > fit.logit <-glm(high.bmi ~ sex + tenure + place + age, data = housing) > > contrib.logit <- contribution(fit.logit, housing$income) > summary(contrib.logit) Overall CI: 0.2502025 95% confidence interval: 0.2429066 0.2574983 Decomposition: Contribution (%) Contribution (Abs) Elasticity residual 0.0000000 0.0000000 0.0000000 sexmale 108.4563232 0.2713604 0.7149839 tenureirregular -17.2872968 -0.0432532 0.0653373 tenureown_apartment 0.1140275 0.0002853 0.0058857 tenureown_house 1.4916426 0.0037321 0.0311614 tenurerent 7.0608518 0.0176664 0.1126780 placeurban 0.0573415 0.0001435 -0.0218778 age 0.1071102 0.0002680 0.0680031 Concentration Index lower 5% upper 5% Corrected residual NA NA NA no sexmale 0.3795336 0.3691540 0.3899131 no tenureirregular -0.6619993 -0.6980505 -0.6259481 no tenureown_apartment 0.0484737 0.0260028 0.0709447 no tenureown_house 0.1197676 0.0926766 0.1468586 no tenurerent 0.1567869 0.1440879 0.1694859 no placeurban -0.0065578 -0.0188208 0.0057052 no age 0.0039409 -0.0000583 0.0079401 no > plot(contrib.logit, decreasing = FALSE,horiz = TRUE) > > > # GLM probit: Decomposition based on predicted outcome > fit.probit <-glm(high.bmi ~ sex + tenure + place + age, data = housing, + family = binomial(link = probit)) > > # binary, set type to 'CIw' > contrib.probit <- contribution(fit.probit, housing$income, type = "CIw") > summary(contrib.probit) Overall CI: -0.26355 95% confidence interval: -0.2718336 -0.2552664 (based on a corrected value) Decomposition: Contribution (%) Contribution (Abs) Elasticity residual 272.0517695 -0.7169924 0.0000000 sexmale -179.3760257 0.4727455 0.6287769 tenureirregular 25.5830437 -0.0674241 0.0866431 tenureown_apartment -0.1800413 0.0004745 0.0077997 tenureown_house -2.1688445 0.0057160 0.0404237 tenurerent -15.7773222 0.0415811 0.1471374 placeurban -0.1352142 0.0003564 -0.0293442 age 0.0026347 -0.0000069 0.0893297 Concentration Index lower 5% upper 5% Corrected residual NA NA NA no sexmale 0.7518494 0.7312877 0.7724110 no tenureirregular -0.7781818 -0.8205601 -0.7358035 no tenureown_apartment 0.0608355 0.0326340 0.0890370 no tenureown_house 0.1414021 0.1094175 0.1733867 no tenurerent 0.2826007 0.2597114 0.3054901 no placeurban -0.0121440 -0.0348533 0.0105652 no age -0.0000777 -0.0001566 0.0000012 no > plot(contrib.probit, decreasing = FALSE,horiz = TRUE) > > > # Marginal effects probit using package 'mfx': Decomposition based on predicted outcome > fit.mfx <-mfx::probitmfx(high.bmi ~ sex + tenure + place + age, data = housing) > > contrib.mfx <- contribution(fit.mfx, housing$income, type = "CIw") > summary(contrib.mfx, type="CIw") Overall CI: 0.6906082 95% confidence interval: 0.6694697 0.7117467 Decomposition: Contribution (%) Contribution (Abs) Elasticity residual 22.2833787 0.1538908 0.0000000 sexmale 80.4392036 0.5555197 0.7388710 tenureirregular -12.5529543 -0.0866917 0.1114029 tenureown_apartment 0.0984600 0.0006800 0.0111772 tenureown_house 1.1582469 0.0079989 0.0565688 tenurerent 8.5011533 0.0587097 0.2077477 placeurban 0.0739535 0.0005107 -0.0420559 age -0.0014417 -0.0000100 0.1280922 Concentration Index lower 5% upper 5% Corrected residual NA NA NA no sexmale 0.7518494 0.7312877 0.7724110 no tenureirregular -0.7781818 -0.8205601 -0.7358035 no tenureown_apartment 0.0608355 0.0326340 0.0890370 no tenureown_house 0.1414021 0.1094175 0.1733867 no tenurerent 0.2826007 0.2597114 0.3054901 no placeurban -0.0121440 -0.0348533 0.0105652 no age -0.0000777 -0.0001566 0.0000012 no > plot(contrib.mfx, decreasing = FALSE, horiz = TRUE) > > > # package survey svy > des = survey::svydesign(~1, data= housing, weights = rep(1, NROW(housing))) > fit.svy = survey::svyglm(bmi ~ tenure+height+weight, design = des) > contrib.svy = contribution(fit.svy, housing$income) > > > # adopted from the `coxph` example in survival package > testcph <- data.frame(time = c(4,3,1,1,2,2,3), + status = c(1,1,1,0,1,1,0), + x = c(0,2,1,1,1,0,0), + sex = c(0,0,0,0,1,1,1), + income = c(100,50, 20, 20, 50, 60,100)) > > # Fit a stratified model > fit.coxph = survival::coxph(survival::Surv(time, status) ~ x + survival::strata(sex), testcph) > contrib.coxph = contribution(fit.coxph, testcph$income) Error in model.matrix(object)[, names(object$coefficients)][, -1, drop = F] : incorrect number of dimensions Calls: contribution -> contribution.coxph Execution halted Package: riskRegression Check: examples New result: ERROR Running examples in ‘riskRegression-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: simPBC > ### Title: simulating data alike the pbc data > ### Aliases: simPBC > > ### ** Examples > > library(survival) > library(lava) > # simulate data alike pbc data > set.seed(98) > d=simPBC(847) > d$protimegrp1 <- d$protimegrp=="10-11" > d$protimegrp2 <- d$protimegrp==">11" > d$sex <- factor(d$sex,levels=0:1,labels=c("m","f")) > sF1 <- survreg(Surv(time,status==1)~sex+age+logbili+protimegrp1+protimegrp2+stage3+stage4, + data=d) > coxF1 <- coxph(Surv(time,status==1)~sex+age+logbili+protimegrp1+protimegrp2+stage3+stage4, + data=d) > # load real pbc data > data(pbc,package="survival") > pbc <- na.omit(pbc[,c("time","status","age","sex","stage","bili","protime","trt")]) > pbc$stage <- factor(pbc$stage) > levels(pbc$stage) <- list("1/2"=c(1,2),"3"=3,"4"=4) > pbc$logbili <- log(pbc$bili) > pbc$logprotime <- log(pbc$protime) > pbc$stage3 <- 1*(pbc$stage=="3") > pbc$stage4 <- 1*(pbc$stage=="4") > pbc$protimegrp <- cut(pbc$protime,c(-Inf,10,11,Inf),labels=c("<=10","10-11",">11")) > pbc$protimegrp1 <- pbc$protimegrp=="10-11" > pbc$protimegrp2 <- pbc$protimegrp==">11" > form1=Surv(time,status==1)~sex+age+logbili+protimegrp1+protimegrp2+stage3+stage4 > F1 <- survival::survreg(form1,data=pbc) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: Execution halted Package: sandwich Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘sandwich-CL.Rnw’ using Sweave Loading required package: geepack Loading required package: lattice Loading required package: lme4 Loading required package: Matrix Loading required package: lmtest Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: multiwayvcov Loading required package: pcse Attaching package: ‘pcse’ The following object is masked from ‘package:sandwich’: vcovPC Loading required package: plm Loading required package: pscl Classes and Methods for R originally developed in the Political Science Computational Laboratory Department of Political Science Stanford University (2002-2015), by and under the direction of Simon Jackman. hurdle and zeroinfl functions by Achim Zeileis. --- finished re-building ‘sandwich-CL.Rnw’ --- re-building ‘sandwich-OOP.Rnw’ using Sweave Loading required package: AER Loading required package: car Loading required package: carData Loading required package: lmtest Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich Loading required package: survival Loading required package: MASS Error: processing vignette 'sandwich-OOP.Rnw' failed with diagnostics: chunk 10 Error in model.matrix.default(terms(x), mf) : model frame and formula mismatch in model.matrix() --- failed re-building ‘sandwich-OOP.Rnw’ --- re-building ‘sandwich.Rnw’ using Sweave Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: strucchange Loading required package: lmtest Loading required package: scatterplot3d --- finished re-building ‘sandwich.Rnw’ SUMMARY: processing the following file failed: ‘sandwich-OOP.Rnw’ Error: Vignette re-building failed. Execution halted Package: sandwich Check: running R code from vignettes New result: ERROR Errors in running code in vignettes: when running code in ‘sandwich-OOP.Rnw’ ... > options(prompt = "R> ", continue = "+ ") > if (!require("AER")) tobit <- glm Loading required package: AER Loading required package: car Loading required package: carData Loading required package: lmtest Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich Loading required package: survival > if (!require("MASS")) glm.nb <- glm Loading required package: MASS > if (!require("lmtest")) coeftest <- function(object, + ...) summary(object)$coefficients > warn <- if (require("AER") & require("MASS") & require("lmtest")) "" else "{\\\\large\\\\bf\\\\color{Red}\n Not all required packages were availab ..." ... [TRUNCATED] > par(mar = rep(0, 4)) > plot(0, 0, xlim = c(0, 85), ylim = c(0, 110), type = "n", + axes = FALSE, xlab = "", ylab = "") > lgrey <- grey(0.88) > dgrey <- grey(0.75) > rect(45, 90, 70, 110, lwd = 2, col = dgrey) > rect(20, 40, 40, 60, col = lgrey) > rect(30, 40, 40, 60, col = dgrey) > rect(20, 40, 40, 60, lwd = 2) > rect(5, 0, 20, 20, lwd = 2, col = lgrey) > rect(22.5, 0, 37.5, 20, lwd = 2, col = lgrey) > rect(40, 0, 55, 20, lwd = 2, col = lgrey) > rect(40, 0, 55, 20, lwd = 2, col = lgrey) > rect(60, 0, 80, 20, col = lgrey) > rect(70, 0, 80, 20, col = dgrey) > rect(60, 0, 80, 20, lwd = 2) > text(57.5, 100, "fitted model object\n(class: foo)") > text(25, 50, "estfun") > text(35, 50, "foo") > text(12.5, 10, "meatHC") > text(30, 10, "meatHAC") > text(47.5, 10, "meat") > text(65, 10, "bread") > text(75, 10, "foo") > arrows(57.5, 89, 70, 21, lwd = 1.5, length = 0.15, + angle = 20) > arrows(57.5, 89, 30, 61, lwd = 1.5, length = 0.15, + angle = 20) > arrows(30, 39, 30, 21, lwd = 1.5, length = 0.15, angle = 20) > arrows(30, 39, 12.5, 21, lwd = 1.5, length = 0.15, + angle = 20) > arrows(30, 39, 47.5, 21, lwd = 1.5, length = 0.15, + angle = 20) > suppressWarnings(RNGversion("3.5.0")) > set.seed(123) > x <- rnorm(250) > y <- rnbinom(250, mu = exp(1 + x), size = 1) > fm_pois <- glm(y ~ x + I(x^2), family = poisson) > coeftest(fm_pois) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.063268 0.041357 25.7094 < 2e-16 *** x 0.996072 0.053534 18.6062 < 2e-16 *** I(x^2) -0.049124 0.023146 -2.1223 0.03381 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > coeftest(fm_pois, vcov = sandwich) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.063268 0.083776 12.6918 <2e-16 *** x 0.996072 0.105217 9.4668 <2e-16 *** I(x^2) -0.049124 0.036284 -1.3539 0.1758 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > fm_qpois <- glm(y ~ x + I(x^2), family = quasipoisson) > coeftest(fm_qpois) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.063268 0.090435 11.7572 <2e-16 *** x 0.996072 0.117063 8.5088 <2e-16 *** I(x^2) -0.049124 0.050613 -0.9706 0.3318 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > fm_nbin <- glm.nb(y ~ x + I(x^2)) > coeftest(fm_nbin) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.066057 0.088574 12.0358 <2e-16 *** x 0.999616 0.094894 10.5340 <2e-16 *** I(x^2) -0.052652 0.064883 -0.8115 0.4171 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > if (require("AER")) { + library("AER") + data("Affairs", package = "AER") + fm_tobit <- tobit(affairs ~ age + yearsmarried + religiousne .... [TRUNCATED] > coeftest(fm_tobit) z test of coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 8.174197 2.741446 2.9817 0.002866 ** age -0.179333 0.079093 -2.2674 0.023368 * yearsmarried 0.554142 0.134518 4.1195 3.798e-05 *** religiousness -1.686220 0.403752 -4.1764 2.962e-05 *** occupation 0.326053 0.254425 1.2815 0.200007 rating -2.284973 0.407828 -5.6028 2.109e-08 *** Log(scale) 2.109859 0.067098 31.4444 < 2.2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > coeftest(fm_tobit, vcov = sandwich) When sourcing ‘sandwich-OOP.R’: Error: model frame and formula mismatch in model.matrix() Execution halted ‘sandwich-CL.Rnw’... [8s/8s] OK ‘sandwich-OOP.Rnw’... failed ‘sandwich.Rnw’... [1s/1s] OK Package: sglg Check: examples New result: ERROR Running examples in ‘sglg-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: ssurvglg > ### Title: Fitting semi-parametric generalized log-gamma regression models > ### under the presence of right censored data. > ### Aliases: ssurvglg > > ### ** Examples > > require(survival) Loading required package: survival > rows <- 150 > columns <- 2 > t_beta <- c(0.5, 2) > t_sigma <- 0.5 > t_lambda <- 1 > set.seed(8142030) > x1 <- rbinom(rows, 1, 0.5) > x2 <- runif(rows, 0, 1) > X <- cbind(x1,x2) > t_knot1 <- 6 > ts1 <- seq(0, 1, length = t_knot1) > t_g1 <- 0.4 * sin(pi * ts1) > BasisN <- function(n, knot) { + N <- matrix(0, n, knot) + m <- n/knot + block <- rep(1,m) + for (i in 1:knot) { + l <- (i - 1) * m + 1 + r <- i * m + N[l:r, i] <- block } + return(N) + } > s_N1 <- BasisN(rows, length(ts1)) > x3 <- s_N1 %*% ts1 > colnames(x3) <- 'x3' > sys <- X %*% t_beta + s_N1%*%t_g1 > t_ini1 <- exp(sys) * rweibull(rows,1/t_sigma,1) > cens.time <- rweibull(rows, 1.5, 14) > delta <- ifelse(t_ini1 > cens.time, 1, 0) > obst1 = t_ini1 > for(i in 1:rows) { + if (delta[i] == 1) { + obst1[i] = cens.time[i] + } + } > d_example <- data.frame(obst1, delta, X, x3) > fit4 <- ssurvglg(Surv(log(obst1),delta)~ x1 + x2 - 1,npc=x3,data = d_example,shape=0.9) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: ssurvglg -> survreg Execution halted Package: simexaft Check: examples New result: ERROR Running examples in ‘simexaft-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: plotsimexaft > ### Title: Plot the Extrapolation Curve > ### Aliases: plotsimexaft > > ### ** Examples > > ###########example for the dataset with known variance.################ > library("simexaft") > library("survival") > data("BHS") > dataset <- BHS > dataset$SBP <- log(dataset$SBP-50) > > set.seed(120) > formula <- Surv(SURVTIME,DTHCENS)~SBP+CHOL+AGE+BMI+SMOKE1+SMOKE2 > > ind <- c("SBP", "CHOL") > err.mat <- diag(rep(0.5625, 2)) > > ### fit an AFT model with quadratic extrapolation > out2 <- simexaft(formula = formula, data = dataset, SIMEXvariable = ind, + repeated = FALSE, repind = list(), err.mat = err.mat, B = 50, + lambda=seq(0, 2, 0.1),extrapolation="quadratic", dist="weibull") Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: simexaft -> survreg Execution halted Package: skpr Check: examples New result: ERROR Running examples in ‘skpr-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: eval_design_custom_mc > ### Title: Monte Carlo power evaluation for experimental designs with > ### user-supplied libraries > ### Aliases: eval_design_custom_mc > > ### ** Examples > > #To demonstrate how a user can use their own libraries for Monte Carlo power generation, > #We will recreate eval_design_survival_mc using the eval_design_custom_mc framework. > > #To begin, first let us generate the same design and random generation function shown in the > #eval_design_survival_mc examples: > > basicdesign = expand.grid(a = c(-1, 1), b = c("a","b","c")) > design = gen_design(candidateset = basicdesign, model = ~a + b + a:b, trials = 100, + optimality = "D", repeats = 100) > > #Random number generating function > > rsurvival = function(X, b) { + Y = rexp(n = nrow(X), rate = exp(-(X %*% b))) + censored = Y > 1 + Y[censored] = 1 + return(survival::Surv(time = Y, event = !censored, type = "right")) + } > > #We now need to tell the package how we want to fit our data, > #given the formula and the model matrix X (and, if needed, the list of contrasts). > #If the contrasts aren't required, "contrastslist" should be set to NULL. > #This should return some type of fit object. > > fitsurv = function(formula, X, contrastslist = NULL) { + return(survival::survreg(formula, data = X, dist = "exponential")) + } > > > #We now need to tell the package how to extract the p-values from the fit object returned > #from the fit function. This is how to extract the p-values from the survreg fit object: > > pvalsurv = function(fit) { + return(summary(fit)$table[, 4]) + } > > #And now we evaluate the design, passing the fitting function and p-value extracting function > #in along with the standard inputs for eval_design_mc. > #This has the exact same behavior as eval_design_survival_mc for the exponential distribution. > eval_design_custom_mc(design = design, model = ~a + b + a:b, + alpha = 0.05, nsim = 100, + fitfunction = fitsurv, pvalfunction = pvalsurv, + rfunction = rsurvival, effectsize = 1) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: eval_design_custom_mc -> fitfunction -> Execution halted Package: SurvRegCensCov Check: examples New result: ERROR Running examples in ‘SurvRegCensCov-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: WeibullReg > ### Title: Weibull Regression for Survival Data > ### Aliases: WeibullReg > ### Keywords: survival regression > > ### ** Examples > > data(larynx) > WR <- WeibullReg(Surv(time, death) ~ factor(stage) + age, data = larynx) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: WeibullReg -> Execution halted Package: SurvRegCensCov Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘weibull.Rnw’ using Sweave Loading required package: SurvRegCensCov Loading required package: survival Error: processing vignette 'weibull.Rnw' failed with diagnostics: chunk 3 (label = WeibullReg) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol --- failed re-building ‘weibull.Rnw’ SUMMARY: processing the following file failed: ‘weibull.Rnw’ Error: Vignette re-building failed. Execution halted Package: tern Check: tests New result: ERROR Running ‘testthat.R’ [168s/169s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > pkg_name <- "tern" > library(testthat) > test_check(pkg_name, reporter = ParallelProgressReporter$new()) Loading required package: tern Loading required package: rtables Loading required package: formatters Attaching package: 'formatters' The following object is masked from 'package:base': %||% Loading required package: magrittr Attaching package: 'magrittr' The following objects are masked from 'package:testthat': equals, is_less_than, not Attaching package: 'rtables' The following object is masked from 'package:utils': str Registered S3 method overwritten by 'tern': method from tidy.glm broom Attaching package: 'dplyr' The following object is masked from 'package:testthat': matches The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union ✔ | F W S OK | Context ⠋ [ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ] Starting up... ✔ | 7 7 | abnormal [1.6s] ✔ | 5 8 | abnormal_by_baseline ✔ | 3 4 | abnormal_by_marked [6.6s] ✔ | 2 3 | abnormal_by_worst_grade ✔ | 8 12 | abnormal_by_worst_grade_worsen [1.6s] ✔ | 31 47 | analyze_variables [4.2s] ✔ | 7 8 | analyze_vars_in_cols [3.3s] ✔ | 2 6 | bland-altman ✔ | 16 | combination_function ✔ | 9 17 | compare_variables ✔ | 1 3 | control_logistic ✔ | 1 4 | control_step ✔ | 3 11 | control_survival ✔ | 6 6 | count_cumulative ✔ | 5 5 | count_missed_doses ✔ | 8 15 | count_occurrences ✔ | 13 15 | count_occurrences_by_grade [2.5s] ✔ | 4 4 | count_patients_events_in_cols ✔ | 6 6 | count_patients_with_event ✔ | 8 8 | count_patients_with_flags [1.0s] ✔ | 10 10 | count_values skipping term strata(ecog.ps) ✔ | 5 11 | coxph ✖ | 1 24 49 | coxreg [1.2s] ──────────────────────────────────────────────────────────────────────────────── Failure ('test-coxreg.R:563:3'): fit_coxreg_multivar works correctly also without treatment arm stats::formula(result$mod) (`actual`) not equal to survival::Surv(time, status) ~ 1 + covar1 + covar2 (`expected`). `actual`: `Surv(time, status) ~ 1 + covar1 + covar2` `expected`: `survival::Surv(time, status) ~ 1 + covar1 + covar2` ──────────────────────────────────────────────────────────────────────────────── ✔ | 2 13 | decorate_grob [1.2s] ✔ | 5 5 | desctools_binom_diff ✔ | 5 12 | df_explicit_na ✔ | 3 7 | estimate_multinom_rsp ✔ | 17 17 | estimate_proportion ✔ | 3 13 | fit_rsp_step ✔ | 3 9 | fit_survival_step ✔ | 21 33 | formatting_functions ✔ | 3 18 | g_forest [8.7s] ✔ | 9 18 | g_km [10.8s] ✔ | 6 11 | g_lineplot [7.6s] ✔ | 4 10 | g_step ✔ | 2 2 | g_waterfall ✔ | 5 1 | h_adsl_adlb_merge_using_worst_flag ✔ | 1 1 | h_format_row ✔ | 5 5 | h_incidence_rate ✔ | 13 21 | h_km [1.0s] ✔ | 16 38 | h_logistic_regression ✔ | 7 7 | h_map_for_count_abnormal ✔ | 2 2 | h_pkparam_sort ✔ | 5 5 | h_response_biomarkers_subgroups ✔ | 14 15 | h_response_subgroups ✔ | 3 5 | h_stack_by_baskets ✔ | 8 43 | h_step ✔ | 4 8 | h_survival_biomarkers_subgroups ✔ | 16 17 | h_survival_duration_subgroups ✔ | 2 0 | imputation_rule ✔ | 8 12 | incidence_rate ✔ | 7 | individual_patient_plot ✔ | 6 21 | logistic_regression [4.0s] ✔ | 7 19 | make_afun ✔ | 7 8 | odds_ratio ✔ | 11 19 | prop_diff ✔ | 7 14 | prune_occurrences [4.8s] ✔ | 6 10 | response_biomarkers_subgroups [3.7s] ✔ | 14 16 | response_subgroups [9.4s] ✔ | 5 8 | rtables_access [3.8s] ✔ | 5 8 | score_occurrences [2.0s] ✔ | 15 19 | split_cols_by_groups [1.1s] ✔ | 9 11 | stat ✔ | 5 11 | summarize_ancova [2.0s] ✔ | 4 4 | summarize_change ✔ | 3 3 | summarize_colvars [1.4s] ✔ | 13 15 | summarize_coxreg [7.0s] ✔ | 17 25 | summarize_glm_count [2.5s] ✔ | 16 16 | summarize_num_patients [1.7s] ✔ | 9 9 | summarize_patients_exposure_in_cols [1.6s] ✔ | 7 10 | survival_biomarkers_subgroups [5.4s] ✔ | 8 9 | survival_coxph_pairwise [1.3s] ✔ | 14 17 | survival_duration_subgroups [9.8s] ✔ | 7 9 | survival_time ✔ | 10 11 | survival_timepoint [1.3s] ✔ | 11 12 | test_proportion_diff [1.1s] ✔ | 59 79 | utils [1.4s] ✔ | 42 | utils_checkmate ✔ | 6 24 | utils_default_stats_formats_labels ✔ | 13 26 | utils_factor ✔ | 3 3 | utils_ggplot [2.2s] ✔ | 8 | utils_grid ✔ | 19 24 | utils_rtables [7.5s] ✔ | 6 13 | utils_split_fun [3.0s] ══ Results ═════════════════════════════════════════════════════════════════════ Duration: 151.4 s ── Skipped tests (682) ───────────────────────────────────────────────────────── • On CRAN (682): 'test-abnormal.R:24:3', 'test-abnormal.R:51:3', 'test-abnormal.R:80:3', 'test-abnormal.R:103:3', 'test-abnormal.R:134:3', 'test-abnormal.R:160:3', 'test-abnormal.R:186:3', 'test-abnormal_by_baseline.R:16:3', 'test-abnormal_by_baseline.R:46:3', 'test-abnormal_by_baseline.R:80:3', 'test-abnormal_by_baseline.R:94:3', 'test-abnormal_by_baseline.R:113:3', 'test-abnormal_by_marked.R:80:3', 'test-abnormal_by_marked.R:135:3', 'test-abnormal_by_marked.R:254:3', 'test-abnormal_by_worst_grade.R:43:3', 'test-abnormal_by_worst_grade.R:71:3', 'test-abnormal_by_worst_grade_worsen.R:64:3', 'test-abnormal_by_worst_grade_worsen.R:82:3', 'test-abnormal_by_worst_grade_worsen.R:102:3', 'test-abnormal_by_worst_grade_worsen.R:122:3', 'test-abnormal_by_worst_grade_worsen.R:142:3', 'test-abnormal_by_worst_grade_worsen.R:162:3', 'test-abnormal_by_worst_grade_worsen.R:184:3', 'test-abnormal_by_worst_grade_worsen.R:211:3', 'test-analyze_variables.R:7:3', 'test-analyze_variables.R:17:3', 'test-analyze_variables.R:31:3', 'test-analyze_variables.R:39:3', 'test-analyze_variables.R:48:3', 'test-analyze_variables.R:62:3', 'test-analyze_variables.R:72:3', 'test-analyze_variables.R:81:3', 'test-analyze_variables.R:90:3', 'test-analyze_variables.R:113:3', 'test-analyze_variables.R:127:3', 'test-analyze_variables.R:134:3', 'test-analyze_variables.R:143:3', 'test-analyze_variables.R:152:3', 'test-analyze_variables.R:171:3', 'test-analyze_variables.R:228:3', 'test-analyze_variables.R:245:3', 'test-analyze_variables.R:275:3', 'test-analyze_variables.R:295:3', 'test-analyze_variables.R:310:3', 'test-analyze_variables.R:321:3', 'test-analyze_variables.R:332:3', 'test-analyze_variables.R:343:3', 'test-analyze_variables.R:378:3', 'test-analyze_variables.R:389:3', 'test-analyze_variables.R:437:3', 'test-analyze_variables.R:448:3', 'test-analyze_variables.R:474:3', 'test-analyze_variables.R:492:3', 'test-analyze_variables.R:502:3', 'test-analyze_variables.R:521:3', 'test-analyze_vars_in_cols.R:11:3', 'test-analyze_vars_in_cols.R:53:3', 'test-analyze_vars_in_cols.R:105:3', 'test-analyze_vars_in_cols.R:180:3', 'test-analyze_vars_in_cols.R:251:3', 'test-analyze_vars_in_cols.R:319:3', 'test-analyze_vars_in_cols.R:422:3', 'test-bland-altman.R:79:3', 'test-bland-altman.R:103:3', 'test-compare_variables.R:9:3', 'test-compare_variables.R:20:3', 'test-compare_variables.R:29:3', 'test-compare_variables.R:47:3', 'test-compare_variables.R:69:3', 'test-compare_variables.R:78:3', 'test-compare_variables.R:100:3', 'test-compare_variables.R:115:3', 'test-compare_variables.R:125:3', 'test-control_logistic.R:8:3', 'test-control_step.R:5:3', 'test-control_survival.R:7:3', 'test-control_survival.R:21:3', 'test-control_survival.R:36:3', 'test-count_cumulative.R:12:3', 'test-count_cumulative.R:30:3', 'test-count_cumulative.R:44:3', 'test-count_cumulative.R:62:3', 'test-count_cumulative.R:81:3', 'test-count_cumulative.R:103:3', 'test-count_missed_doses.R:8:3', 'test-count_missed_doses.R:17:3', 'test-count_missed_doses.R:24:3', 'test-count_missed_doses.R:35:3', 'test-count_missed_doses.R:55:3', 'test-count_occurrences.R:10:3', 'test-count_occurrences.R:65:3', 'test-count_occurrences.R:109:3', 'test-count_occurrences.R:135:3', 'test-count_occurrences.R:161:3', 'test-count_occurrences.R:175:3', 'test-count_occurrences.R:230:3', 'test-count_occurrences.R:245:3', 'test-count_occurrences_by_grade.R:26:3', 'test-count_occurrences_by_grade.R:40:3', 'test-count_occurrences_by_grade.R:48:3', 'test-count_occurrences_by_grade.R:67:3', 'test-count_occurrences_by_grade.R:84:3', 'test-count_occurrences_by_grade.R:135:3', 'test-count_occurrences_by_grade.R:149:3', 'test-count_occurrences_by_grade.R:174:3', 'test-count_occurrences_by_grade.R:200:3', 'test-count_occurrences_by_grade.R:235:3', 'test-count_occurrences_by_grade.R:282:3', 'test-count_occurrences_by_grade.R:314:3', 'test-count_occurrences_by_grade.R:397:3', 'test-count_patients_events_in_cols.R:23:3', 'test-count_patients_events_in_cols.R:39:3', 'test-count_patients_events_in_cols.R:55:3', 'test-count_patients_events_in_cols.R:75:3', 'test-count_patients_with_event.R:14:3', 'test-count_patients_with_event.R:31:3', 'test-count_patients_with_event.R:63:3', 'test-count_patients_with_event.R:101:3', 'test-count_patients_with_event.R:121:3', 'test-count_patients_with_event.R:137:3', 'test-count_patients_with_flags.R:14:3', 'test-count_patients_with_flags.R:31:3', 'test-count_patients_with_flags.R:52:3', 'test-count_patients_with_flags.R:130:3', 'test-count_patients_with_flags.R:178:3', 'test-count_patients_with_flags.R:217:3', 'test-count_patients_with_flags.R:243:3', 'test-count_patients_with_flags.R:320:3', 'test-count_values.R:8:3', 'test-count_values.R:24:3', 'test-count_values.R:39:3', 'test-count_values.R:47:3', 'test-count_values.R:55:3', 'test-count_values.R:64:3', 'test-count_values.R:81:3', 'test-count_values.R:91:3', 'test-count_values.R:101:3', 'test-count_values.R:118:3', 'test-coxph.R:5:3', 'test-coxph.R:17:3', 'test-coxph.R:41:3', 'test-coxph.R:56:3', 'test-coxph.R:108:3', 'test-coxreg.R:44:3', 'test-coxreg.R:56:3', 'test-coxreg.R:67:3', 'test-coxreg.R:80:3', 'test-coxreg.R:92:3', 'test-coxreg.R:124:3', 'test-coxreg.R:136:3', 'test-coxreg.R:147:3', 'test-coxreg.R:158:3', 'test-coxreg.R:170:3', 'test-coxreg.R:182:3', 'test-coxreg.R:193:3', 'test-coxreg.R:204:3', 'test-coxreg.R:216:3', 'test-coxreg.R:225:3', 'test-coxreg.R:248:3', 'test-coxreg.R:298:3', 'test-coxreg.R:309:3', 'test-coxreg.R:320:3', 'test-coxreg.R:360:3', 'test-coxreg.R:374:3', 'test-coxreg.R:388:3', 'test-coxreg.R:533:3', 'test-coxreg.R:585:3', 'test-decorate_grob.R:55:3', 'test-decorate_grob.R:124:3', 'test-desctools_binom_diff.R:18:3', 'test-desctools_binom_diff.R:33:3', 'test-desctools_binom_diff.R:42:3', 'test-desctools_binom_diff.R:51:3', 'test-desctools_binom_diff.R:63:3', 'test-df_explicit_na.R:22:3', 'test-df_explicit_na.R:36:3', 'test-df_explicit_na.R:44:3', 'test-df_explicit_na.R:57:3', 'test-df_explicit_na.R:70:3', 'test-estimate_multinom_rsp.R:6:3', 'test-estimate_multinom_rsp.R:14:3', 'test-estimate_multinom_rsp.R:48:3', 'test-estimate_proportion.R:9:3', 'test-estimate_proportion.R:29:3', 'test-estimate_proportion.R:43:3', 'test-estimate_proportion.R:78:3', 'test-estimate_proportion.R:106:3', 'test-estimate_proportion.R:131:3', 'test-estimate_proportion.R:142:3', 'test-estimate_proportion.R:154:3', 'test-estimate_proportion.R:170:3', 'test-estimate_proportion.R:181:3', 'test-estimate_proportion.R:203:3', 'test-estimate_proportion.R:210:3', 'test-estimate_proportion.R:223:3', 'test-estimate_proportion.R:247:3', 'test-estimate_proportion.R:281:3', 'test-estimate_proportion.R:307:3', 'test-estimate_proportion.R:339:5', 'test-fit_rsp_step.R:29:3', 'test-fit_rsp_step.R:58:3', 'test-fit_rsp_step.R:85:3', 'test-fit_survival_step.R:34:3', 'test-fit_survival_step.R:65:3', 'test-fit_survival_step.R:88:3', 'test-formatting_functions.R:5:3', 'test-formatting_functions.R:12:3', 'test-formatting_functions.R:19:3', 'test-formatting_functions.R:26:3', 'test-formatting_functions.R:33:3', 'test-formatting_functions.R:40:3', 'test-formatting_functions.R:47:3', 'test-formatting_functions.R:59:3', 'test-formatting_functions.R:66:3', 'test-formatting_functions.R:73:3', 'test-formatting_functions.R:82:3', 'test-formatting_functions.R:91:3', 'test-formatting_functions.R:116:3', 'test-formatting_functions.R:125:3', 'test-formatting_functions.R:134:3', 'test-formatting_functions.R:150:3', 'test-formatting_functions.R:158:3', 'test-formatting_functions.R:172:3', 'test-formatting_functions.R:181:3', 'test-formatting_functions.R:190:3', 'test-formatting_functions.R:252:3', 'test-g_forest.R:23:3', 'test-g_forest.R:58:3', 'test-g_forest.R:98:3', 'test-g_km.R:15:3', 'test-g_km.R:28:3', 'test-g_km.R:40:3', 'test-g_km.R:62:3', 'test-g_km.R:77:3', 'test-g_km.R:114:3', 'test-g_km.R:128:3', 'test-g_km.R:147:3', 'test-g_km.R:162:3', 'test-g_lineplot.R:9:3', 'test-g_lineplot.R:30:3', 'test-g_lineplot.R:50:3', 'test-g_lineplot.R:69:3', 'test-g_lineplot.R:99:3', 'test-g_lineplot.R:112:3', 'test-g_step.R:18:3', 'test-g_step.R:28:3', 'test-g_step.R:36:3', 'test-g_step.R:65:3', 'test-g_waterfall.R:7:3', 'test-g_waterfall.R:29:3', 'test-h_adsl_adlb_merge_using_worst_flag.R:11:3', 'test-h_adsl_adlb_merge_using_worst_flag.R:25:3', 'test-h_adsl_adlb_merge_using_worst_flag.R:39:3', 'test-h_adsl_adlb_merge_using_worst_flag.R:55:5', 'test-h_adsl_adlb_merge_using_worst_flag.R:68:3', 'test-h_format_row.R:11:3', 'test-h_incidence_rate.R:5:3', 'test-h_incidence_rate.R:12:3', 'test-h_incidence_rate.R:19:3', 'test-h_incidence_rate.R:26:3', 'test-h_incidence_rate.R:37:3', 'test-h_km.R:11:3', 'test-h_km.R:18:3', 'test-h_km.R:26:3', 'test-h_km.R:34:3', 'test-h_km.R:43:3', 'test-h_km.R:58:3', 'test-h_km.R:68:3', 'test-h_km.R:77:3', 'test-h_km.R:84:3', 'test-h_km.R:99:3', 'test-h_km.R:118:3', 'test-h_km.R:131:3', 'test-h_km.R:143:3', 'test-h_logistic_regression.R:28:3', 'test-h_logistic_regression.R:49:3', 'test-h_logistic_regression.R:74:3', 'test-h_logistic_regression.R:107:3', 'test-h_logistic_regression.R:146:5', 'test-h_logistic_regression.R:204:3', 'test-h_logistic_regression.R:218:3', 'test-h_logistic_regression.R:230:3', 'test-h_logistic_regression.R:247:3', 'test-h_logistic_regression.R:283:3', 'test-h_logistic_regression.R:300:3', 'test-h_logistic_regression.R:317:3', 'test-h_logistic_regression.R:336:3', 'test-h_logistic_regression.R:373:3', 'test-h_logistic_regression.R:395:3', 'test-h_logistic_regression.R:442:3', 'test-h_map_for_count_abnormal.R:27:3', 'test-h_map_for_count_abnormal.R:49:3', 'test-h_map_for_count_abnormal.R:71:5', 'test-h_map_for_count_abnormal.R:98:5', 'test-h_map_for_count_abnormal.R:125:5', 'test-h_map_for_count_abnormal.R:154:5', 'test-h_map_for_count_abnormal.R:182:5', 'test-h_pkparam_sort.R:6:3', 'test-h_pkparam_sort.R:17:3', 'test-h_response_biomarkers_subgroups.R:27:3', 'test-h_response_biomarkers_subgroups.R:51:3', 'test-h_response_biomarkers_subgroups.R:69:3', 'test-h_response_biomarkers_subgroups.R:92:3', 'test-h_response_biomarkers_subgroups.R:120:3', 'test-h_response_subgroups.R:28:3', 'test-h_response_subgroups.R:38:3', 'test-h_response_subgroups.R:55:3', 'test-h_response_subgroups.R:67:3', 'test-h_response_subgroups.R:79:3', 'test-h_response_subgroups.R:98:3', 'test-h_response_subgroups.R:108:3', 'test-h_response_subgroups.R:122:3', 'test-h_response_subgroups.R:141:3', 'test-h_response_subgroups.R:155:3', 'test-h_response_subgroups.R:167:3', 'test-h_response_subgroups.R:179:3', 'test-h_response_subgroups.R:201:3', 'test-h_response_subgroups.R:224:3', 'test-h_stack_by_baskets.R:9:3', 'test-h_stack_by_baskets.R:48:5', 'test-h_stack_by_baskets.R:76:5', 'test-h_step.R:30:3', 'test-h_step.R:56:3', 'test-h_step.R:124:3', 'test-h_step.R:193:3', 'test-h_step.R:240:3', 'test-h_step.R:310:3', 'test-h_step.R:435:3', 'test-h_step.R:476:3', 'test-h_survival_biomarkers_subgroups.R:37:3', 'test-h_survival_biomarkers_subgroups.R:57:3', 'test-h_survival_biomarkers_subgroups.R:75:3', 'test-h_survival_biomarkers_subgroups.R:103:3', 'test-h_survival_duration_subgroups.R:35:3', 'test-h_survival_duration_subgroups.R:55:3', 'test-h_survival_duration_subgroups.R:75:3', 'test-h_survival_duration_subgroups.R:102:3', 'test-h_survival_duration_subgroups.R:124:3', 'test-h_survival_duration_subgroups.R:139:3', 'test-h_survival_duration_subgroups.R:151:3', 'test-h_survival_duration_subgroups.R:170:3', 'test-h_survival_duration_subgroups.R:183:3', 'test-h_survival_duration_subgroups.R:198:3', 'test-h_survival_duration_subgroups.R:212:3', 'test-h_survival_duration_subgroups.R:226:3', 'test-h_survival_duration_subgroups.R:238:3', 'test-h_survival_duration_subgroups.R:263:3', 'test-h_survival_duration_subgroups.R:275:3', 'test-h_survival_duration_subgroups.R:294:3', 'test-imputation_rule.R:13:3', 'test-imputation_rule.R:31:3', 'test-incidence_rate.R:19:3', 'test-incidence_rate.R:43:3', 'test-incidence_rate.R:55:3', 'test-incidence_rate.R:77:3', 'test-incidence_rate.R:90:3', 'test-incidence_rate.R:113:3', 'test-incidence_rate.R:128:3', 'test-incidence_rate.R:150:3', 'test-logistic_regression.R:153:3', 'test-logistic_regression.R:171:3', 'test-logistic_regression.R:198:3', 'test-logistic_regression.R:232:3', 'test-logistic_regression.R:256:3', 'test-logistic_regression.R:276:3', 'test-make_afun.R:35:3', 'test-make_afun.R:88:3', 'test-make_afun.R:122:3', 'test-make_afun.R:170:3', 'test-make_afun.R:214:3', 'test-make_afun.R:238:3', 'test-make_afun.R:266:3', 'test-odds_ratio.R:14:3', 'test-odds_ratio.R:41:3', 'test-odds_ratio.R:58:3', 'test-odds_ratio.R:83:3', 'test-odds_ratio.R:124:3', 'test-odds_ratio.R:145:3', 'test-odds_ratio.R:180:3', 'test-prop_diff.R:9:3', 'test-prop_diff.R:30:3', 'test-prop_diff.R:49:3', 'test-prop_diff.R:81:3', 'test-prop_diff.R:120:3', 'test-prop_diff.R:150:3', 'test-prop_diff.R:225:3', 'test-prop_diff.R:246:3', 'test-prop_diff.R:272:3', 'test-prop_diff.R:333:3', 'test-prop_diff.R:357:3', 'test-prune_occurrences.R:57:3', 'test-prune_occurrences.R:72:3', 'test-prune_occurrences.R:94:3', 'test-prune_occurrences.R:112:3', 'test-prune_occurrences.R:127:3', 'test-prune_occurrences.R:142:3', 'test-prune_occurrences.R:164:3', 'test-response_biomarkers_subgroups.R:35:3', 'test-response_biomarkers_subgroups.R:74:3', 'test-response_biomarkers_subgroups.R:103:3', 'test-response_biomarkers_subgroups.R:122:3', 'test-response_biomarkers_subgroups.R:146:3', 'test-response_biomarkers_subgroups.R:165:3', 'test-response_subgroups.R:30:3', 'test-response_subgroups.R:42:3', 'test-response_subgroups.R:62:3', 'test-response_subgroups.R:85:3', 'test-response_subgroups.R:104:3', 'test-response_subgroups.R:124:3', 'test-response_subgroups.R:146:3', 'test-response_subgroups.R:187:3', 'test-response_subgroups.R:207:3', 'test-response_subgroups.R:227:3', 'test-response_subgroups.R:240:3', 'test-response_subgroups.R:261:3', 'test-response_subgroups.R:283:3', 'test-response_subgroups.R:308:3', 'test-rtables_access.R:17:3', 'test-rtables_access.R:49:3', 'test-rtables_access.R:63:3', 'test-rtables_access.R:77:3', 'test-rtables_access.R:91:3', 'test-score_occurrences.R:90:3', 'test-score_occurrences.R:102:3', 'test-score_occurrences.R:113:3', 'test-score_occurrences.R:134:3', 'test-score_occurrences.R:156:3', 'test-split_cols_by_groups.R:11:3', 'test-split_cols_by_groups.R:20:3', 'test-split_cols_by_groups.R:27:3', 'test-split_cols_by_groups.R:34:3', 'test-split_cols_by_groups.R:41:3', 'test-split_cols_by_groups.R:52:3', 'test-split_cols_by_groups.R:68:3', 'test-split_cols_by_groups.R:91:3', 'test-split_cols_by_groups.R:102:3', 'test-split_cols_by_groups.R:120:3', 'test-split_cols_by_groups.R:147:3', 'test-split_cols_by_groups.R:157:3', 'test-split_cols_by_groups.R:166:3', 'test-split_cols_by_groups.R:175:3', 'test-split_cols_by_groups.R:184:3', 'test-stat.R:8:5', 'test-stat.R:36:5', 'test-stat.R:109:5', 'test-stat.R:132:5', 'test-stat.R:202:3', 'test-stat.R:221:3', 'test-stat.R:276:3', 'test-stat.R:287:3', 'test-stat.R:297:3', 'test-summarize_ancova.R:10:3', 'test-summarize_ancova.R:45:3', 'test-summarize_ancova.R:85:3', 'test-summarize_ancova.R:108:3', 'test-summarize_ancova.R:193:3', 'test-summarize_change.R:16:3', 'test-summarize_change.R:34:3', 'test-summarize_change.R:53:3', 'test-summarize_change.R:78:3', 'test-summarize_colvars.R:28:3', 'test-summarize_colvars.R:43:3', 'test-summarize_colvars.R:63:3', 'test-summarize_coxreg.R:36:3', 'test-summarize_coxreg.R:48:3', 'test-summarize_coxreg.R:60:3', 'test-summarize_coxreg.R:76:3', 'test-summarize_coxreg.R:90:3', 'test-summarize_coxreg.R:131:3', 'test-summarize_coxreg.R:145:3', 'test-summarize_coxreg.R:160:3', 'test-summarize_coxreg.R:173:3', 'test-summarize_coxreg.R:185:3', 'test-summarize_coxreg.R:199:3', 'test-summarize_coxreg.R:215:3', 'test-summarize_coxreg.R:243:3', 'test-summarize_glm_count.R:18:3', 'test-summarize_glm_count.R:35:3', 'test-summarize_glm_count.R:73:3', 'test-summarize_glm_count.R:90:3', 'test-summarize_glm_count.R:110:3', 'test-summarize_glm_count.R:126:3', 'test-summarize_glm_count.R:164:3', 'test-summarize_glm_count.R:180:3', 'test-summarize_glm_count.R:219:3', 'test-summarize_glm_count.R:236:3', 'test-summarize_glm_count.R:273:7', 'test-summarize_glm_count.R:322:3', 'test-summarize_glm_count.R:344:3', 'test-summarize_glm_count.R:368:3', 'test-summarize_glm_count.R:392:3', 'test-summarize_glm_count.R:437:3', 'test-summarize_glm_count.R:468:3', 'test-summarize_num_patients.R:6:3', 'test-summarize_num_patients.R:14:3', 'test-summarize_num_patients.R:22:3', 'test-summarize_num_patients.R:33:3', 'test-summarize_num_patients.R:51:3', 'test-summarize_num_patients.R:90:3', 'test-summarize_num_patients.R:99:3', 'test-summarize_num_patients.R:108:3', 'test-summarize_num_patients.R:119:3', 'test-summarize_num_patients.R:130:3', 'test-summarize_num_patients.R:141:3', 'test-summarize_num_patients.R:159:3', 'test-summarize_num_patients.R:209:5', 'test-summarize_num_patients.R:243:3', 'test-summarize_num_patients.R:273:3', 'test-summarize_num_patients.R:302:3', 'test-summarize_patients_exposure_in_cols.R:23:3', 'test-summarize_patients_exposure_in_cols.R:35:3', 'test-summarize_patients_exposure_in_cols.R:49:3', 'test-summarize_patients_exposure_in_cols.R:72:3', 'test-summarize_patients_exposure_in_cols.R:95:5', 'test-summarize_patients_exposure_in_cols.R:109:3', 'test-summarize_patients_exposure_in_cols.R:126:3', 'test-summarize_patients_exposure_in_cols.R:144:5', 'test-summarize_patients_exposure_in_cols.R:166:3', 'test-survival_biomarkers_subgroups.R:36:3', 'test-survival_biomarkers_subgroups.R:65:3', 'test-survival_biomarkers_subgroups.R:85:3', 'test-survival_biomarkers_subgroups.R:105:3', 'test-survival_biomarkers_subgroups.R:129:3', 'test-survival_biomarkers_subgroups.R:153:3', 'test-survival_biomarkers_subgroups.R:178:3', 'test-survival_coxph_pairwise.R:18:3', 'test-survival_coxph_pairwise.R:39:3', 'test-survival_coxph_pairwise.R:59:3', 'test-survival_coxph_pairwise.R:80:3', 'test-survival_coxph_pairwise.R:102:3', 'test-survival_coxph_pairwise.R:125:3', 'test-survival_coxph_pairwise.R:147:3', 'test-survival_coxph_pairwise.R:172:3', 'test-survival_duration_subgroups.R:33:3', 'test-survival_duration_subgroups.R:52:3', 'test-survival_duration_subgroups.R:68:3', 'test-survival_duration_subgroups.R:87:3', 'test-survival_duration_subgroups.R:102:3', 'test-survival_duration_subgroups.R:117:3', 'test-survival_duration_subgroups.R:134:3', 'test-survival_duration_subgroups.R:153:3', 'test-survival_duration_subgroups.R:175:3', 'test-survival_duration_subgroups.R:210:3', 'test-survival_duration_subgroups.R:229:3', 'test-survival_duration_subgroups.R:249:3', 'test-survival_duration_subgroups.R:267:3', 'test-survival_duration_subgroups.R:288:3', 'test-survival_time.R:16:3', 'test-survival_time.R:37:3', 'test-survival_time.R:56:3', 'test-survival_time.R:83:3', 'test-survival_time.R:106:3', 'test-survival_time.R:129:3', 'test-survival_time.R:154:3', 'test-survival_timepoint.R:17:3', 'test-survival_timepoint.R:39:3', 'test-survival_timepoint.R:61:3', 'test-survival_timepoint.R:86:3', 'test-survival_timepoint.R:112:3', 'test-survival_timepoint.R:137:3', 'test-survival_timepoint.R:162:3', 'test-survival_timepoint.R:188:3', 'test-survival_timepoint.R:215:3', 'test-survival_timepoint.R:238:3', 'test-test_proportion_diff.R:12:3', 'test-test_proportion_diff.R:24:3', 'test-test_proportion_diff.R:49:3', 'test-test_proportion_diff.R:63:3', 'test-test_proportion_diff.R:89:3', 'test-test_proportion_diff.R:113:3', 'test-test_proportion_diff.R:133:3', 'test-test_proportion_diff.R:151:3', 'test-test_proportion_diff.R:169:3', 'test-test_proportion_diff.R:189:3', 'test-test_proportion_diff.R:211:3', 'test-utils.R:5:3', 'test-utils.R:17:3', 'test-utils.R:30:3', 'test-utils.R:37:3', 'test-utils.R:57:3', 'test-utils.R:65:3', 'test-utils.R:73:3', 'test-utils.R:96:3', 'test-utils.R:105:3', 'test-utils.R:113:3', 'test-utils.R:121:3', 'test-utils.R:167:3', 'test-utils.R:182:3', 'test-utils.R:191:3', 'test-utils.R:202:5', 'test-utils.R:212:3', 'test-utils.R:223:3', 'test-utils.R:234:5', 'test-utils.R:246:5', 'test-utils.R:256:3', 'test-utils.R:267:3', 'test-utils.R:278:5', 'test-utils.R:290:5', 'test-utils.R:300:3', 'test-utils.R:311:3', 'test-utils.R:322:5', 'test-utils.R:334:5', 'test-utils.R:344:3', 'test-utils.R:355:3', 'test-utils.R:366:5', 'test-utils.R:378:5', 'test-utils.R:388:3', 'test-utils.R:399:3', 'test-utils.R:410:5', 'test-utils.R:422:5', 'test-utils.R:434:5', 'test-utils.R:446:3', 'test-utils.R:457:5', 'test-utils.R:469:5', 'test-utils.R:481:5', 'test-utils.R:504:5', 'test-utils.R:516:5', 'test-utils.R:528:5', 'test-utils.R:540:3', 'test-utils.R:551:5', 'test-utils.R:563:5', 'test-utils.R:573:3', 'test-utils.R:584:3', 'test-utils.R:595:5', 'test-utils.R:607:5', 'test-utils.R:619:5', 'test-utils.R:631:3', 'test-utils.R:642:5', 'test-utils.R:654:5', 'test-utils.R:666:5', 'test-utils.R:678:3', 'test-utils.R:689:5', 'test-utils.R:701:5', 'test-utils.R:713:5', 'test-utils_default_stats_formats_labels.R:4:3', 'test-utils_default_stats_formats_labels.R:108:3', 'test-utils_default_stats_formats_labels.R:159:3', 'test-utils_default_stats_formats_labels.R:194:3', 'test-utils_default_stats_formats_labels.R:207:3', 'test-utils_default_stats_formats_labels.R:217:3', 'test-utils_factor.R:25:3', 'test-utils_factor.R:36:3', 'test-utils_factor.R:51:3', 'test-utils_factor.R:58:3', 'test-utils_factor.R:74:3', 'test-utils_factor.R:86:3', 'test-utils_factor.R:97:3', 'test-utils_factor.R:115:3', 'test-utils_factor.R:138:3', 'test-utils_factor.R:149:3', 'test-utils_factor.R:159:3', 'test-utils_factor.R:167:3', 'test-utils_factor.R:175:3', 'test-utils_ggplot.R:19:3', 'test-utils_ggplot.R:53:3', 'test-utils_ggplot.R:59:3', 'test-utils_rtables.R:14:3', 'test-utils_rtables.R:44:3', 'test-utils_rtables.R:52:3', 'test-utils_rtables.R:66:3', 'test-utils_rtables.R:71:3', 'test-utils_rtables.R:87:3', 'test-utils_rtables.R:94:3', 'test-utils_rtables.R:104:3', 'test-utils_rtables.R:119:3', 'test-utils_rtables.R:132:3', 'test-utils_rtables.R:159:3', 'test-utils_rtables.R:169:3', 'test-utils_rtables.R:181:3', 'test-utils_rtables.R:202:3', 'test-utils_rtables.R:215:3', 'test-utils_rtables.R:228:3', 'test-utils_rtables.R:235:3', 'test-utils_rtables.R:249:3', 'test-utils_rtables.R:261:3', 'test-utils_split_fun.R:27:3', 'test-utils_split_fun.R:39:3', 'test-utils_split_fun.R:56:3', 'test-utils_split_fun.R:74:3', 'test-utils_split_fun.R:102:3', 'test-utils_split_fun.R:124:3' ── Failed tests ──────────────────────────────────────────────────────────────── Failure ('test-coxreg.R:563:3'): fit_coxreg_multivar works correctly also without treatment arm stats::formula(result$mod) (`actual`) not equal to survival::Surv(time, status) ~ 1 + covar1 + covar2 (`expected`). `actual`: `Surv(time, status) ~ 1 + covar1 + covar2` `expected`: `survival::Surv(time, status) ~ 1 + covar1 + covar2` [ FAIL 1 | WARN 0 | SKIP 682 | PASS 1153 ] Deleting unused snapshots: • estimate_incidence_rate.md • g_forest/g_forest_custom_2.new.svg • g_forest/g_forest_custom_2.svg • g_forest/g_forest_custom_3.new.svg • g_forest/g_forest_custom_3.svg • g_forest/g_forest_or.new.svg • g_forest/g_forest_or.svg • g_forest/g_forest_plot_only.new.svg • g_forest/g_forest_plot_only.svg • g_km/g_km_crop_ylim_failure.new.svg • g_km/g_km_crop_ylim_failure.svg • g_km/g_km_custom_ylim.new.svg • g_km/g_km_custom_ylim.svg • g_km/g_km_table_only.new.svg • g_km/g_km_table_only.svg • g_lineplot/g_lineplot_xlim_ylim.svg • g_lineplot/g_lineplot_xticks.svg • utils_ggplot/df2gg_cw.svg • utils_ggplot/df2gg_fs.svg • utils_ggplot/rtable2gg_cw.svg • utils_ggplot/rtable2gg_fs.svg • utils_ggplot/rtable2gg_lblpad.svg Error: Test failures Execution halted Package: tram Check: tests New result: ERROR Running ‘Coxph-Ex.R’ [13s/13s] Comparing ‘Coxph-Ex.Rout’ to ‘Coxph-Ex.Rout.save’ ... OK Running ‘KaplanMeier-Ex.R’ [2s/2s] Running ‘PI_OVL-Ex.R’ [3s/3s] Running ‘Polr-Ex.R’ [2s/2s] Comparing ‘Polr-Ex.Rout’ to ‘Polr-Ex.Rout.save’ ... OK Running ‘Survreg-Ex.R’ [2s/2s] Running ‘bugfixes.R’ [59s/59s] Running ‘intercepts-Ex.R’ [4s/4s] Comparing ‘intercepts-Ex.Rout’ to ‘intercepts-Ex.Rout.save’ ... OK Running ‘mmlt-Ex.R’ [114s/114s] Comparing ‘mmlt-Ex.Rout’ to ‘mmlt-Ex.Rout.save’ ... OK Running ‘mmlt-interface.R’ [41s/41s] Running ‘mtram-Ex.R’ [12s/13s] Comparing ‘mtram-Ex.Rout’ to ‘mtram-Ex.Rout.save’ ... OK Running ‘stram-Ex.R’ [9s/9s] Comparing ‘stram-Ex.Rout’ to ‘stram-Ex.Rout.save’ ... OK Running the tests in ‘tests/Survreg-Ex.R’ failed. Complete output: > > library("tram") Loading required package: mlt Loading required package: basefun Loading required package: variables Loading required package: mvtnorm > library("survival") > > ### Windows diffs... > options(digits = 3) > > tol <- .Machine$double.eps^(1/5) > > cmp <- function(x, y) + stopifnot(isTRUE(all.equal(x, y, tolerance = tol, check.attributes = FALSE))) > > data("GBSG2", package = "TH.data") > > fm <- Surv(time, cens) ~ pnodes + age > tfm <- Surv(time, cens) ~ pnodes + age > fms <- Surv(time, cens) ~ pnodes + age + strata(horTh) > tfms <- Surv(time, cens) | 0 + horTh ~ pnodes + age > > (smod <- survreg(fm, data = GBSG2, dist = "weibull")) Error in environment(temp$formula) <- coxenv : cannot set attribute on a symbol Calls: survreg Execution halted