CRAN Package Check Results for Package partykit

Last updated on 2018-04-26 06:47:42 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.2-1 10.98 163.75 174.73 ERROR
r-devel-linux-x86_64-debian-gcc 1.2-1 9.54 144.88 154.42 ERROR
r-devel-linux-x86_64-fedora-clang 1.2-1 387.79 OK
r-devel-linux-x86_64-fedora-gcc 1.2-1 372.34 OK
r-devel-windows-ix86+x86_64 1.2-1 25.00 417.00 442.00 OK
r-patched-linux-x86_64 1.2-1 13.10 189.02 202.12 ERROR
r-patched-solaris-x86 1.2-1 453.90 NOTE
r-release-linux-x86_64 1.2-1 11.98 185.99 197.97 ERROR
r-release-windows-ix86+x86_64 1.2-1 25.00 417.00 442.00 OK
r-release-osx-x86_64 1.2-1 OK
r-oldrel-windows-ix86+x86_64 1.2-1 12.00 433.00 445.00 OK
r-oldrel-osx-x86_64 1.2-1 OK

Check Details

Version: 1.2-1
Check: tests
Result: ERROR
     Running ‘bugfixes.R’ [6s/6s]
     Comparing ‘bugfixes.Rout’ to ‘bugfixes.Rout.save’ ... OK
     Running ‘regtest-MIA.R’ [2s/2s]
     Comparing ‘regtest-MIA.Rout’ to ‘regtest-MIA.Rout.save’ ... OK
     Running ‘regtest-cforest.R’ [10s/10s]
     Comparing ‘regtest-cforest.Rout’ to ‘regtest-cforest.Rout.save’ ... OK
     Running ‘regtest-ctree.R’ [2s/2s]
     Comparing ‘regtest-ctree.Rout’ to ‘regtest-ctree.Rout.save’ ... OK
     Running ‘regtest-glmtree.R’ [10s/10s]
    Running the tests in ‘tests/regtest-glmtree.R’ failed.
    Complete output:
     >
     > library("partykit")
     Loading required package: grid
     Loading required package: libcoin
     Loading required package: mvtnorm
     Loading required package: rpart
     > library("sandwich")
     >
     > set.seed(29)
     > n <- 1000
     > x <- runif(n)
     > z <- runif(n)
     > y <- rnorm(n, mean = x * c(-1, 1)[(z > 0.7) + 1], sd = 3)
     > z_noise <- factor(sample(1:3, size = n, replace = TRUE))
     > d <- data.frame(y = y, x = x, z = z, z_noise = z_noise)
     >
     >
     > fmla <- as.formula("y ~ x | z + z_noise")
     > fmly <- gaussian()
     > fit <- partykit:::glmfit
     >
     > # versions of the data
     > d1 <- d
     > d1$z <- signif(d1$z, digits = 1)
     >
     > k <- 20
     > zs_noise <- matrix(rnorm(n*k), nrow = n)
     > colnames(zs_noise) <- paste0("z_noise_", 1:k)
     > d2 <- cbind(d, zs_noise)
     > fmla2 <- as.formula(paste("y ~ x | z + z_noise +",
     + paste0("z_noise_", 1:k, collapse = " + ")))
     >
     >
     > d3 <- d2
     > d3$z <- factor(sample(1:3, size = n, replace = TRUE, prob = c(0.1, 0.5, 0.4)))
     > d3$y <- rnorm(n, mean = x * c(-1, 1)[(d3$z == 2) + 1], sd = 3)
     >
     > ## check weights
     > w <- rep(1, n)
     > w[1:10] <- 2
     > (mw1 <- glmtree(formula = fmla, data = d, weights = w))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 706
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 304
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     > (mw2 <- glmtree(formula = fmla, data = d, weights = w, caseweights = FALSE))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     >
     >
     >
     > ## check dfsplit
     > (mmfluc2 <- mob(formula = fmla, data = d, fit = partykit:::glmfit))
     Model-based recursive partitioning (partykit:::glmfit)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function: 2551.673
     > (mmfluc3 <- glmtree(formula = fmla, data = d))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     > (mmfluc3_dfsplit <- glmtree(formula = fmla, data = d, dfsplit = 10))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     >
     >
     > ## check tests
     > library("strucchange")
     Loading required package: zoo
    
     Attaching package: 'zoo'
    
     The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
     > sctest(mmfluc3, node = 1) # does not yet work
     Error in UseMethod("estfun") :
     no applicable method for 'estfun' applied to an object of class "c('glmtree', 'modelparty', 'party')"
     Calls: sctest -> sctest.default -> gefp -> scores
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.2-1
Check: running R code from vignettes
Result: ERROR
    Errors in running code in vignettes:
    when running code in ‘ctree.Rnw’
     ...
    
    > options(width = 70, SweaveHooks = list(leftpar = function() par(mai = par("mai") *
    + c(1, 1.1, 1, 1))))
    
    > require("partykit")
    Loading required package: partykit
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > require("coin")
    Loading required package: coin
    Loading required package: survival
    
    Attaching package: ‘survival’
    
    The following object is masked from ‘package:rpart’:
    
     solder
    
    
    > require("strucchange")
    Loading required package: strucchange
    Loading required package: zoo
    
    Attaching package: ‘zoo’
    
    The following objects are masked from ‘package:base’:
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > require("coin")
    
    > require("Formula")
    Loading required package: Formula
    
    > require("survival")
    
    > require("sandwich")
    
    > set.seed(290875)
    
    > ctree_control(teststat = "max")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x926d58>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc4d5a18>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc4d9ec0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc4d9de0>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc4d9c90>
    
    $teststat
    [1] "maximum"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(teststat = "quad")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x926d58>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc5026e0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc502600>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc502520>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc5023d0>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(testtype = "Bonferroni")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x926d58>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc511560>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc511480>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc5113a0>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc511250>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(minsplit = 20)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x926d58>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc523650>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc523570>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc523490>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc523340>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(maxsurrogate = 3)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 3
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x926d58>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc539ff0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc539f10>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4d65e8>
    <environment: 0xc539e30>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0xc4daa90>
    <environment: 0xc539ce0>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ls <- data.frame(y = gl(3, 50, labels = c("A", "B",
    + "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)),
    + x2 = runif(150))
    
    > library("partykit")
    
    > ctree(y ~ x1 + x2, data = ls)
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > ct <- ctree(y ~ x1 + x2, data = ls)
    
    > ct
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > plot(ct)
    
    > ct[1]
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > class(ct[1])
    [1] "constparty" "party"
    
    > predict(ct, newdata = ls)
     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
     A A A A C A C A C C A A C A A A A
     18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
     C A C A A A C A A A C C A A C A A
     35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
     C A A C C C A A C C C C A A A A A
     52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
     A C C C C A C C A C C C C C C A A
     69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
     A A A C C A C A C C C C C C C C C
     86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
     C C C A C A C A C C C C C C C C A
    103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
     C C C A C C A C C C C C C C A C C
    120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
     C C C C C C C C C C C C C C C C C
    137 138 139 140 141 142 143 144 145 146 147 148 149 150
     C A C C C C A C C A C A C A
    Levels: A B C
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "prob")
     A B C
    1 0.5740741 0.2592593 0.1666667
    51 0.5740741 0.2592593 0.1666667
    101 0.1979167 0.3750000 0.4270833
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "node")
     1 51 101
     3 3 2
    
    > library("strucchange")
    
    > sctest(ct)
    
     When sourcing ‘ctree.R’:
    Error: no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
    Execution halted
    when running code in ‘mob.Rnw’
     ...
    
    > library("partykit")
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > options(prompt = "R> ", continue = "+ ", digits = 4,
    + useFancyQuotes = FALSE)
    
    > data("PimaIndiansDiabetes", package = "mlbench")
    
    > pid_formula <- diabetes ~ glucose | pregnant + pressure +
    + triceps + insulin + mass + pedigree + age
    
    > logit <- function(y, x, start = NULL, weights = NULL,
    + offset = NULL, ...) {
    + glm(y ~ 0 + x, family = binomial, start = start, ...)
    + }
    
    > pid_tree <- mob(pid_formula, data = PimaIndiansDiabetes,
    + fit = logit)
    
    > pid_tree
    Model-based recursive partitioning (logit)
    
    Model formula:
    diabetes ~ glucose | pregnant + pressure + triceps + insulin +
     mass + pedigree + age
    
    Fitted party:
    [1] root
    | [2] mass <= 26.3: n = 167
    | x(Intercept) xglucose
    | -9.95151 0.05871
    | [3] mass > 26.3
    | | [4] age <= 30: n = 304
    | | x(Intercept) xglucose
    | | -6.70559 0.04684
    | | [5] age > 30: n = 297
    | | x(Intercept) xglucose
    | | -2.77095 0.02354
    
    Number of inner nodes: 2
    Number of terminal nodes: 3
    Number of parameters per node: 2
    Objective function: 355.5
    
    > pid_tree2 <- glmtree(diabetes ~ glucose | pregnant +
    + pressure + triceps + insulin + mass + pedigree + age, data = PimaIndiansDiabetes,
    + .... [TRUNCATED]
    
    > plot(pid_tree)
    
    > plot(pid_tree2, tp_args = list(ylines = 1, margins = c(1.5,
    + 1.5, 1.5, 2.5)))
    Loading required namespace: vcd
    
    > library("strucchange")
    Loading required package: zoo
    
    Attaching package: 'zoo'
    
    The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > sctest(pid_tree, node = 1)
    
     When sourcing 'mob.R':
    Error: no applicable method for ‘estfun’ applied to an object of class "c('modelparty', 'party')"
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.2-1
Check: re-building of vignette outputs
Result: WARN
    Error in re-building vignettes:
     ...
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    Loading required package: RWeka
    Loading required namespace: XML
    Loading required package: XML
    
    Attaching package: ‘XML’
    
    The following object is masked from ‘package:tools’:
    
     toHTML
    
    Loading required package: coin
    Loading required package: survival
    
    Attaching package: ‘survival’
    
    The following object is masked from ‘package:rpart’:
    
     solder
    
    Loading required package: strucchange
    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: Formula
    
    Error: processing vignette ‘ctree.Rnw’ failed with diagnostics:
     chunk 17 (label = party-sctest)
    Error in UseMethod("estfun") :
     no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
    Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64

Version: 1.2-1
Check: tests
Result: ERROR
     Running ‘bugfixes.R’ [5s/7s]
     Comparing ‘bugfixes.Rout’ to ‘bugfixes.Rout.save’ ... OK
     Running ‘regtest-MIA.R’ [2s/3s]
     Comparing ‘regtest-MIA.Rout’ to ‘regtest-MIA.Rout.save’ ... OK
     Running ‘regtest-cforest.R’ [9s/11s]
     Comparing ‘regtest-cforest.Rout’ to ‘regtest-cforest.Rout.save’ ... OK
     Running ‘regtest-ctree.R’ [2s/3s]
     Comparing ‘regtest-ctree.Rout’ to ‘regtest-ctree.Rout.save’ ... OK
     Running ‘regtest-glmtree.R’ [9s/15s]
    Running the tests in ‘tests/regtest-glmtree.R’ failed.
    Complete output:
     >
     > library("partykit")
     Loading required package: grid
     Loading required package: libcoin
     Loading required package: mvtnorm
     Loading required package: rpart
     > library("sandwich")
     >
     > set.seed(29)
     > n <- 1000
     > x <- runif(n)
     > z <- runif(n)
     > y <- rnorm(n, mean = x * c(-1, 1)[(z > 0.7) + 1], sd = 3)
     > z_noise <- factor(sample(1:3, size = n, replace = TRUE))
     > d <- data.frame(y = y, x = x, z = z, z_noise = z_noise)
     >
     >
     > fmla <- as.formula("y ~ x | z + z_noise")
     > fmly <- gaussian()
     > fit <- partykit:::glmfit
     >
     > # versions of the data
     > d1 <- d
     > d1$z <- signif(d1$z, digits = 1)
     >
     > k <- 20
     > zs_noise <- matrix(rnorm(n*k), nrow = n)
     > colnames(zs_noise) <- paste0("z_noise_", 1:k)
     > d2 <- cbind(d, zs_noise)
     > fmla2 <- as.formula(paste("y ~ x | z + z_noise +",
     + paste0("z_noise_", 1:k, collapse = " + ")))
     >
     >
     > d3 <- d2
     > d3$z <- factor(sample(1:3, size = n, replace = TRUE, prob = c(0.1, 0.5, 0.4)))
     > d3$y <- rnorm(n, mean = x * c(-1, 1)[(d3$z == 2) + 1], sd = 3)
     >
     > ## check weights
     > w <- rep(1, n)
     > w[1:10] <- 2
     > (mw1 <- glmtree(formula = fmla, data = d, weights = w))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 706
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 304
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     > (mw2 <- glmtree(formula = fmla, data = d, weights = w, caseweights = FALSE))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     >
     >
     >
     > ## check dfsplit
     > (mmfluc2 <- mob(formula = fmla, data = d, fit = partykit:::glmfit))
     Model-based recursive partitioning (partykit:::glmfit)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function: 2551.673
     > (mmfluc3 <- glmtree(formula = fmla, data = d))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     > (mmfluc3_dfsplit <- glmtree(formula = fmla, data = d, dfsplit = 10))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     >
     >
     > ## check tests
     > library("strucchange")
     Loading required package: zoo
    
     Attaching package: 'zoo'
    
     The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
     > sctest(mmfluc3, node = 1) # does not yet work
     Error in UseMethod("estfun") :
     no applicable method for 'estfun' applied to an object of class "c('glmtree', 'modelparty', 'party')"
     Calls: sctest -> sctest.default -> gefp -> scores
     Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.2-1
Check: running R code from vignettes
Result: ERROR
    Errors in running code in vignettes:
    when running code in ‘ctree.Rnw’
     ...
    
    > options(width = 70, SweaveHooks = list(leftpar = function() par(mai = par("mai") *
    + c(1, 1.1, 1, 1))))
    
    > require("partykit")
    Loading required package: partykit
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > require("coin")
    Loading required package: coin
    Loading required package: survival
    
    Attaching package: ‘survival’
    
    The following object is masked from ‘package:rpart’:
    
     solder
    
    
    > require("strucchange")
    Loading required package: strucchange
    Loading required package: zoo
    
    Attaching package: ‘zoo’
    
    The following objects are masked from ‘package:base’:
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > require("coin")
    
    > require("Formula")
    Loading required package: Formula
    
    > require("survival")
    
    > require("sandwich")
    
    > set.seed(290875)
    
    > ctree_control(teststat = "max")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55c2e5bd0d88>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f1781ce8>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17880b0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f1787fd0>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f1787e80>
    
    $teststat
    [1] "maximum"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(teststat = "quad")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55c2e5bd0d88>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17ae9b0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17ae8d0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17ae7f0>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17ae6a0>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(testtype = "Bonferroni")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55c2e5bd0d88>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17bf750>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17bf670>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17bf590>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17bf440>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(minsplit = 20)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55c2e5bd0d88>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17d1840>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17d1760>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17d1680>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17d1530>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(maxsurrogate = 3)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 3
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55c2e5bd0d88>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17e62c0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17e61e0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f17828b8>
    <environment: 0x55c2f17e6100>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55c2f1788c80>
    <environment: 0x55c2f17e5fb0>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ls <- data.frame(y = gl(3, 50, labels = c("A", "B",
    + "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)),
    + x2 = runif(150))
    
    > library("partykit")
    
    > ctree(y ~ x1 + x2, data = ls)
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > ct <- ctree(y ~ x1 + x2, data = ls)
    
    > ct
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > plot(ct)
    
    > ct[1]
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > class(ct[1])
    [1] "constparty" "party"
    
    > predict(ct, newdata = ls)
     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
     A A A A C A C A C C A A C A A A A
     18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
     C A C A A A C A A A C C A A C A A
     35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
     C A A C C C A A C C C C A A A A A
     52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
     A C C C C A C C A C C C C C C A A
     69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
     A A A C C A C A C C C C C C C C C
     86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
     C C C A C A C A C C C C C C C C A
    103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
     C C C A C C A C C C C C C C A C C
    120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
     C C C C C C C C C C C C C C C C C
    137 138 139 140 141 142 143 144 145 146 147 148 149 150
     C A C C C C A C C A C A C A
    Levels: A B C
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "prob")
     A B C
    1 0.5740741 0.2592593 0.1666667
    51 0.5740741 0.2592593 0.1666667
    101 0.1979167 0.3750000 0.4270833
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "node")
     1 51 101
     3 3 2
    
    > library("strucchange")
    
    > sctest(ct)
    
     When sourcing ‘ctree.R’:
    Error: no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
    Execution halted
    when running code in ‘mob.Rnw’
     ...
    
    > library("partykit")
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > options(prompt = "R> ", continue = "+ ", digits = 4,
    + useFancyQuotes = FALSE)
    
    > data("PimaIndiansDiabetes", package = "mlbench")
    
    > pid_formula <- diabetes ~ glucose | pregnant + pressure +
    + triceps + insulin + mass + pedigree + age
    
    > logit <- function(y, x, start = NULL, weights = NULL,
    + offset = NULL, ...) {
    + glm(y ~ 0 + x, family = binomial, start = start, ...)
    + }
    
    > pid_tree <- mob(pid_formula, data = PimaIndiansDiabetes,
    + fit = logit)
    
    > pid_tree
    Model-based recursive partitioning (logit)
    
    Model formula:
    diabetes ~ glucose | pregnant + pressure + triceps + insulin +
     mass + pedigree + age
    
    Fitted party:
    [1] root
    | [2] mass <= 26.3: n = 167
    | x(Intercept) xglucose
    | -9.95151 0.05871
    | [3] mass > 26.3
    | | [4] age <= 30: n = 304
    | | x(Intercept) xglucose
    | | -6.70559 0.04684
    | | [5] age > 30: n = 297
    | | x(Intercept) xglucose
    | | -2.77095 0.02354
    
    Number of inner nodes: 2
    Number of terminal nodes: 3
    Number of parameters per node: 2
    Objective function: 355.5
    
    > pid_tree2 <- glmtree(diabetes ~ glucose | pregnant +
    + pressure + triceps + insulin + mass + pedigree + age, data = PimaIndiansDiabetes,
    + .... [TRUNCATED]
    
    > plot(pid_tree)
    
    > plot(pid_tree2, tp_args = list(ylines = 1, margins = c(1.5,
    + 1.5, 1.5, 2.5)))
    Loading required namespace: vcd
    
    > library("strucchange")
    Loading required package: zoo
    
    Attaching package: 'zoo'
    
    The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > sctest(pid_tree, node = 1)
    
     When sourcing 'mob.R':
    Error: no applicable method for ‘estfun’ applied to an object of class "c('modelparty', 'party')"
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.2-1
Check: tests
Result: ERROR
     Running ‘bugfixes.R’ [6s/8s]
     Comparing ‘bugfixes.Rout’ to ‘bugfixes.Rout.save’ ... OK
     Running ‘regtest-MIA.R’ [2s/3s]
     Comparing ‘regtest-MIA.Rout’ to ‘regtest-MIA.Rout.save’ ... OK
     Running ‘regtest-cforest.R’ [11s/14s]
     Comparing ‘regtest-cforest.Rout’ to ‘regtest-cforest.Rout.save’ ... OK
     Running ‘regtest-ctree.R’ [2s/3s]
     Comparing ‘regtest-ctree.Rout’ to ‘regtest-ctree.Rout.save’ ... OK
     Running ‘regtest-glmtree.R’ [12s/15s]
    Running the tests in ‘tests/regtest-glmtree.R’ failed.
    Complete output:
     >
     > library("partykit")
     Loading required package: grid
     Loading required package: libcoin
     Loading required package: mvtnorm
     Loading required package: rpart
     > library("sandwich")
     >
     > set.seed(29)
     > n <- 1000
     > x <- runif(n)
     > z <- runif(n)
     > y <- rnorm(n, mean = x * c(-1, 1)[(z > 0.7) + 1], sd = 3)
     > z_noise <- factor(sample(1:3, size = n, replace = TRUE))
     > d <- data.frame(y = y, x = x, z = z, z_noise = z_noise)
     >
     >
     > fmla <- as.formula("y ~ x | z + z_noise")
     > fmly <- gaussian()
     > fit <- partykit:::glmfit
     >
     > # versions of the data
     > d1 <- d
     > d1$z <- signif(d1$z, digits = 1)
     >
     > k <- 20
     > zs_noise <- matrix(rnorm(n*k), nrow = n)
     > colnames(zs_noise) <- paste0("z_noise_", 1:k)
     > d2 <- cbind(d, zs_noise)
     > fmla2 <- as.formula(paste("y ~ x | z + z_noise +",
     + paste0("z_noise_", 1:k, collapse = " + ")))
     >
     >
     > d3 <- d2
     > d3$z <- factor(sample(1:3, size = n, replace = TRUE, prob = c(0.1, 0.5, 0.4)))
     > d3$y <- rnorm(n, mean = x * c(-1, 1)[(d3$z == 2) + 1], sd = 3)
     >
     > ## check weights
     > w <- rep(1, n)
     > w[1:10] <- 2
     > (mw1 <- glmtree(formula = fmla, data = d, weights = w))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 706
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 304
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     > (mw2 <- glmtree(formula = fmla, data = d, weights = w, caseweights = FALSE))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     >
     >
     >
     > ## check dfsplit
     > (mmfluc2 <- mob(formula = fmla, data = d, fit = partykit:::glmfit))
     Model-based recursive partitioning (partykit:::glmfit)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function: 2551.673
     > (mmfluc3 <- glmtree(formula = fmla, data = d))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     > (mmfluc3_dfsplit <- glmtree(formula = fmla, data = d, dfsplit = 10))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     >
     >
     > ## check tests
     > library("strucchange")
     Loading required package: zoo
    
     Attaching package: 'zoo'
    
     The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
     > sctest(mmfluc3, node = 1) # does not yet work
     Error in UseMethod("estfun") :
     no applicable method for 'estfun' applied to an object of class "c('glmtree', 'modelparty', 'party')"
     Calls: sctest -> sctest.default -> gefp -> scores
     Execution halted
Flavor: r-patched-linux-x86_64

Version: 1.2-1
Check: running R code from vignettes
Result: ERROR
    Errors in running code in vignettes:
    when running code in ‘ctree.Rnw’
     ...
    
    > options(width = 70, SweaveHooks = list(leftpar = function() par(mai = par("mai") *
    + c(1, 1.1, 1, 1))))
    
    > require("partykit")
    Loading required package: partykit
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > require("coin")
    Loading required package: coin
    Loading required package: survival
    
    Attaching package: ‘survival’
    
    The following object is masked from ‘package:rpart’:
    
     solder
    
    
    > require("strucchange")
    Loading required package: strucchange
    Loading required package: zoo
    
    Attaching package: ‘zoo’
    
    The following objects are masked from ‘package:base’:
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > require("coin")
    
    > require("Formula")
    Loading required package: Formula
    
    > require("survival")
    
    > require("sandwich")
    
    > set.seed(290875)
    
    > ctree_control(teststat = "max")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x564d26aceb30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d326fd890>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d326fbda8>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d326fbcc8>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d326fbb78>
    
    $teststat
    [1] "maximum"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(teststat = "quad")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x564d26aceb30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d32726350>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d32726270>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d32726190>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d32726040>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(testtype = "Bonferroni")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x564d26aceb30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d32736fd8>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d32736ef8>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d32736e18>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d32736cc8>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(minsplit = 20)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x564d26aceb30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d3274aec0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d3274ade0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d3274ad00>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d3274abb0>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(maxsurrogate = 3)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 3
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x564d26aceb30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d3275b9f8>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d3275b918>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326f65b0>
    <environment: 0x564d3275b838>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x564d326fc978>
    <environment: 0x564d3275b6e8>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ls <- data.frame(y = gl(3, 50, labels = c("A", "B",
    + "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)),
    + x2 = runif(150))
    
    > library("partykit")
    
    > ctree(y ~ x1 + x2, data = ls)
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > ct <- ctree(y ~ x1 + x2, data = ls)
    
    > ct
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > plot(ct)
    
    > ct[1]
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > class(ct[1])
    [1] "constparty" "party"
    
    > predict(ct, newdata = ls)
     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
     A A A A C A C A C C A A C A A A A
     18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
     C A C A A A C A A A C C A A C A A
     35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
     C A A C C C A A C C C C A A A A A
     52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
     A C C C C A C C A C C C C C C A A
     69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
     A A A C C A C A C C C C C C C C C
     86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
     C C C A C A C A C C C C C C C C A
    103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
     C C C A C C A C C C C C C C A C C
    120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
     C C C C C C C C C C C C C C C C C
    137 138 139 140 141 142 143 144 145 146 147 148 149 150
     C A C C C C A C C A C A C A
    Levels: A B C
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "prob")
     A B C
    1 0.5740741 0.2592593 0.1666667
    51 0.5740741 0.2592593 0.1666667
    101 0.1979167 0.3750000 0.4270833
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "node")
     1 51 101
     3 3 2
    
    > library("strucchange")
    
    > sctest(ct)
    
     When sourcing ‘ctree.R’:
    Error: no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
    Execution halted
    when running code in ‘mob.Rnw’
     ...
    
    > library("partykit")
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > options(prompt = "R> ", continue = "+ ", digits = 4,
    + useFancyQuotes = FALSE)
    
    > data("PimaIndiansDiabetes", package = "mlbench")
    
    > pid_formula <- diabetes ~ glucose | pregnant + pressure +
    + triceps + insulin + mass + pedigree + age
    
    > logit <- function(y, x, start = NULL, weights = NULL,
    + offset = NULL, ...) {
    + glm(y ~ 0 + x, family = binomial, start = start, ...)
    + }
    
    > pid_tree <- mob(pid_formula, data = PimaIndiansDiabetes,
    + fit = logit)
    
    > pid_tree
    Model-based recursive partitioning (logit)
    
    Model formula:
    diabetes ~ glucose | pregnant + pressure + triceps + insulin +
     mass + pedigree + age
    
    Fitted party:
    [1] root
    | [2] mass <= 26.3: n = 167
    | x(Intercept) xglucose
    | -9.95151 0.05871
    | [3] mass > 26.3
    | | [4] age <= 30: n = 304
    | | x(Intercept) xglucose
    | | -6.70559 0.04684
    | | [5] age > 30: n = 297
    | | x(Intercept) xglucose
    | | -2.77095 0.02354
    
    Number of inner nodes: 2
    Number of terminal nodes: 3
    Number of parameters per node: 2
    Objective function: 355.5
    
    > pid_tree2 <- glmtree(diabetes ~ glucose | pregnant +
    + pressure + triceps + insulin + mass + pedigree + age, data = PimaIndiansDiabetes,
    + .... [TRUNCATED]
    
    > plot(pid_tree)
    
    > plot(pid_tree2, tp_args = list(ylines = 1, margins = c(1.5,
    + 1.5, 1.5, 2.5)))
    Loading required namespace: vcd
    
    > library("strucchange")
    Loading required package: zoo
    
    Attaching package: 'zoo'
    
    The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > sctest(pid_tree, node = 1)
    
     When sourcing 'mob.R':
    Error: no applicable method for ‘estfun’ applied to an object of class "c('modelparty', 'party')"
    Execution halted
Flavor: r-patched-linux-x86_64

Version: 1.2-1
Check: package dependencies
Result: NOTE
    Package suggested but not available for checking: ‘RWeka’
Flavor: r-patched-solaris-x86

Version: 1.2-1
Check: Rd cross-references
Result: NOTE
    Package unavailable to check Rd xrefs: ‘RWeka’
Flavor: r-patched-solaris-x86

Version: 1.2-1
Check: tests
Result: ERROR
     Running ‘bugfixes.R’ [7s/8s]
     Comparing ‘bugfixes.Rout’ to ‘bugfixes.Rout.save’ ... OK
     Running ‘regtest-MIA.R’ [2s/3s]
     Comparing ‘regtest-MIA.Rout’ to ‘regtest-MIA.Rout.save’ ... OK
     Running ‘regtest-cforest.R’ [11s/14s]
     Comparing ‘regtest-cforest.Rout’ to ‘regtest-cforest.Rout.save’ ... OK
     Running ‘regtest-ctree.R’ [2s/3s]
     Comparing ‘regtest-ctree.Rout’ to ‘regtest-ctree.Rout.save’ ... OK
     Running ‘regtest-glmtree.R’ [11s/14s]
    Running the tests in ‘tests/regtest-glmtree.R’ failed.
    Complete output:
     >
     > library("partykit")
     Loading required package: grid
     Loading required package: libcoin
     Loading required package: mvtnorm
     Loading required package: rpart
     > library("sandwich")
     >
     > set.seed(29)
     > n <- 1000
     > x <- runif(n)
     > z <- runif(n)
     > y <- rnorm(n, mean = x * c(-1, 1)[(z > 0.7) + 1], sd = 3)
     > z_noise <- factor(sample(1:3, size = n, replace = TRUE))
     > d <- data.frame(y = y, x = x, z = z, z_noise = z_noise)
     >
     >
     > fmla <- as.formula("y ~ x | z + z_noise")
     > fmly <- gaussian()
     > fit <- partykit:::glmfit
     >
     > # versions of the data
     > d1 <- d
     > d1$z <- signif(d1$z, digits = 1)
     >
     > k <- 20
     > zs_noise <- matrix(rnorm(n*k), nrow = n)
     > colnames(zs_noise) <- paste0("z_noise_", 1:k)
     > d2 <- cbind(d, zs_noise)
     > fmla2 <- as.formula(paste("y ~ x | z + z_noise +",
     + paste0("z_noise_", 1:k, collapse = " + ")))
     >
     >
     > d3 <- d2
     > d3$z <- factor(sample(1:3, size = n, replace = TRUE, prob = c(0.1, 0.5, 0.4)))
     > d3$y <- rnorm(n, mean = x * c(-1, 1)[(d3$z == 2) + 1], sd = 3)
     >
     > ## check weights
     > w <- rep(1, n)
     > w[1:10] <- 2
     > (mw1 <- glmtree(formula = fmla, data = d, weights = w))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 706
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 304
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     > (mw2 <- glmtree(formula = fmla, data = d, weights = w, caseweights = FALSE))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1447422 -0.8138701
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.07006626 0.73278593
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.48
     >
     >
     >
     > ## check dfsplit
     > (mmfluc2 <- mob(formula = fmla, data = d, fit = partykit:::glmfit))
     Model-based recursive partitioning (partykit:::glmfit)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function: 2551.673
     > (mmfluc3 <- glmtree(formula = fmla, data = d))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     > (mmfluc3_dfsplit <- glmtree(formula = fmla, data = d, dfsplit = 10))
     Generalized linear model tree (family: gaussian)
    
     Model formula:
     y ~ x | z + z_noise
    
     Fitted party:
     [1] root
     | [2] z <= 0.70311: n = 704
     | (Intercept) x
     | -0.1619978 -0.7896293
     | [3] z > 0.70311: n = 296
     | (Intercept) x
     | 0.08683535 0.65598287
    
     Number of inner nodes: 1
     Number of terminal nodes: 2
     Number of parameters per node: 2
     Objective function (negative log-likelihood): 2551.673
     >
     >
     > ## check tests
     > library("strucchange")
     Loading required package: zoo
    
     Attaching package: 'zoo'
    
     The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
     > sctest(mmfluc3, node = 1) # does not yet work
     Error in UseMethod("estfun") :
     no applicable method for 'estfun' applied to an object of class "c('glmtree', 'modelparty', 'party')"
     Calls: sctest -> sctest.default -> gefp -> scores
     Execution halted
Flavor: r-release-linux-x86_64

Version: 1.2-1
Check: running R code from vignettes
Result: ERROR
    Errors in running code in vignettes:
    when running code in ‘ctree.Rnw’
     ...
    
    > options(width = 70, SweaveHooks = list(leftpar = function() par(mai = par("mai") *
    + c(1, 1.1, 1, 1))))
    
    > require("partykit")
    Loading required package: partykit
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > require("coin")
    Loading required package: coin
    Loading required package: survival
    
    Attaching package: ‘survival’
    
    The following object is masked from ‘package:rpart’:
    
     solder
    
    
    > require("strucchange")
    Loading required package: strucchange
    Loading required package: zoo
    
    Attaching package: ‘zoo’
    
    The following objects are masked from ‘package:base’:
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > require("coin")
    
    > require("Formula")
    Loading required package: Formula
    
    > require("survival")
    
    > require("sandwich")
    
    > set.seed(290875)
    
    > ctree_control(teststat = "max")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55948bb14b30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x559497741850>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949773fd68>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x55949773fc88>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949773fb38>
    
    $teststat
    [1] "maximum"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(teststat = "quad")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55948bb14b30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x55949776c230>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949776c150>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x55949776c070>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949776bf20>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(testtype = "Bonferroni")
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55948bb14b30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x55949777ceb8>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949777cdd8>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x55949777ccf8>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x55949777cba8>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(minsplit = 20)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 0
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55948bb14b30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x559497790da0>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x559497790cc0>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x559497790be0>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x559497790a90>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ctree_control(maxsurrogate = 3)
    $criterion
    [1] "p.value"
    
    $logmincriterion
    [1] -0.05129329
    
    $minsplit
    [1] 20
    
    $minbucket
    [1] 7
    
    $minprob
    [1] 0.01
    
    $stump
    [1] FALSE
    
    $nmax
     yx z
    Inf Inf
    
    $lookahead
    [1] FALSE
    
    $mtry
    [1] Inf
    
    $maxdepth
    [1] Inf
    
    $multiway
    [1] FALSE
    
    $splittry
    [1] 2
    
    $maxsurrogate
    [1] 3
    
    $numsurrogate
    [1] FALSE
    
    $majority
    [1] FALSE
    
    $caseweights
    [1] TRUE
    
    $applyfun
    function (X, FUN, ...)
    {
     FUN <- match.fun(FUN)
     if (!is.vector(X) || is.object(X))
     X <- as.list(X)
     .Internal(lapply(X, FUN))
    }
    <bytecode: 0x55948bb14b30>
    <environment: namespace:base>
    
    $saveinfo
    [1] TRUE
    
    $bonferroni
    [1] TRUE
    
    $update
    NULL
    
    $selectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x5594977a18d8>
    
    $splitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x5594977a17f8>
    
    $svselectfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .select(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x55949773a570>
    <environment: 0x5594977a1718>
    
    $svsplitfun
    function (model, trafo, data, subset, weights, whichvar, ctrl)
    {
     args <- list(...)
     ctrl[names(args)] <- args
     .split(model, trafo, data, subset, weights, whichvar, ctrl,
     FUN = .ctree_test)
    }
    <bytecode: 0x559497740938>
    <environment: 0x5594977a15c8>
    
    $teststat
    [1] "quadratic"
    
    $splitstat
    [1] "quadratic"
    
    $splittest
    [1] FALSE
    
    $pargs
    $maxpts
    [1] 25000
    
    $abseps
    [1] 0.001
    
    $releps
    [1] 0
    
    attr(,"class")
    [1] "GenzBretz"
    
    $testtype
    [1] "Bonferroni"
    
    $nresample
    [1] 9999
    
    $tol
    [1] 1.490116e-08
    
    $intersplit
    [1] FALSE
    
    $MIA
    [1] FALSE
    
    
    > ls <- data.frame(y = gl(3, 50, labels = c("A", "B",
    + "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)),
    + x2 = runif(150))
    
    > library("partykit")
    
    > ctree(y ~ x1 + x2, data = ls)
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > ct <- ctree(y ~ x1 + x2, data = ls)
    
    > ct
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > plot(ct)
    
    > ct[1]
    
    Model formula:
    y ~ x1 + x2
    
    Fitted party:
    [1] root
    | [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
    | [3] x1 > 0.82552: A (n = 54, err = 42.6%)
    
    Number of inner nodes: 1
    Number of terminal nodes: 2
    
    > class(ct[1])
    [1] "constparty" "party"
    
    > predict(ct, newdata = ls)
     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
     A A A A C A C A C C A A C A A A A
     18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
     C A C A A A C A A A C C A A C A A
     35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
     C A A C C C A A C C C C A A A A A
     52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
     A C C C C A C C A C C C C C C A A
     69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
     A A A C C A C A C C C C C C C C C
     86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
     C C C A C A C A C C C C C C C C A
    103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
     C C C A C C A C C C C C C C A C C
    120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
     C C C C C C C C C C C C C C C C C
    137 138 139 140 141 142 143 144 145 146 147 148 149 150
     C A C C C C A C C A C A C A
    Levels: A B C
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "prob")
     A B C
    1 0.5740741 0.2592593 0.1666667
    51 0.5740741 0.2592593 0.1666667
    101 0.1979167 0.3750000 0.4270833
    
    > predict(ct, newdata = ls[c(1, 51, 101), ], type = "node")
     1 51 101
     3 3 2
    
    > library("strucchange")
    
    > sctest(ct)
    
     When sourcing ‘ctree.R’:
    Error: no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
    Execution halted
    when running code in ‘mob.Rnw’
     ...
    
    > library("partykit")
    Loading required package: grid
    Loading required package: libcoin
    Loading required package: mvtnorm
    Loading required package: rpart
    
    > options(prompt = "R> ", continue = "+ ", digits = 4,
    + useFancyQuotes = FALSE)
    
    > data("PimaIndiansDiabetes", package = "mlbench")
    
    > pid_formula <- diabetes ~ glucose | pregnant + pressure +
    + triceps + insulin + mass + pedigree + age
    
    > logit <- function(y, x, start = NULL, weights = NULL,
    + offset = NULL, ...) {
    + glm(y ~ 0 + x, family = binomial, start = start, ...)
    + }
    
    > pid_tree <- mob(pid_formula, data = PimaIndiansDiabetes,
    + fit = logit)
    
    > pid_tree
    Model-based recursive partitioning (logit)
    
    Model formula:
    diabetes ~ glucose | pregnant + pressure + triceps + insulin +
     mass + pedigree + age
    
    Fitted party:
    [1] root
    | [2] mass <= 26.3: n = 167
    | x(Intercept) xglucose
    | -9.95151 0.05871
    | [3] mass > 26.3
    | | [4] age <= 30: n = 304
    | | x(Intercept) xglucose
    | | -6.70559 0.04684
    | | [5] age > 30: n = 297
    | | x(Intercept) xglucose
    | | -2.77095 0.02354
    
    Number of inner nodes: 2
    Number of terminal nodes: 3
    Number of parameters per node: 2
    Objective function: 355.5
    
    > pid_tree2 <- glmtree(diabetes ~ glucose | pregnant +
    + pressure + triceps + insulin + mass + pedigree + age, data = PimaIndiansDiabetes,
    + .... [TRUNCATED]
    
    > plot(pid_tree)
    
    > plot(pid_tree2, tp_args = list(ylines = 1, margins = c(1.5,
    + 1.5, 1.5, 2.5)))
    Loading required namespace: vcd
    
    > library("strucchange")
    Loading required package: zoo
    
    Attaching package: 'zoo'
    
    The following objects are masked from 'package:base':
    
     as.Date, as.Date.numeric
    
    Loading required package: sandwich
    
    > sctest(pid_tree, node = 1)
    
     When sourcing 'mob.R':
    Error: no applicable method for ‘estfun’ applied to an object of class "c('modelparty', 'party')"
    Execution halted
Flavor: r-release-linux-x86_64