rmixed-modelsparty

Glmertree options similar to partykit::mob


In the function call to glmertree, is there a way to get specify a minimum sample size for the terminal nodes? I have a relatively large sample (~7000) and would like to grow the tree to at least a depth where terminal nodes have about ~100 in each node. In partykit::mob and glmtree, there's the mob.control argument, but that doesn't seem to be available in glmertree. What are other options to achieve similar functionality?


Solution

  • I haven't tested it, but it seems like setting minsize = 100 should work. ?glmertree says that the ... argument corresponds to

    Additional arguments to be passed to ‘lmtree()’ or ‘glmtree()’. See ‘mob_control’ documentation for details.

    whereas ?mob_control has

    minsize, minsplit, minbucket: integer. The minimum number of observations in a node. If ‘NULL’, the default is to use 10 times the number of parameters to be estimated (divided by the number of responses per observation if that is greater than 1). ‘minsize’ is the recommended name and ‘minsplit’/‘minbucket’ are only included for backward compatibility with previous versions of ‘mob’ and compatibility with ‘ctree’, respectively.

    (more specifically, glmtree() has ... arguments which in turn get passed to mob_control())


    Achim Zeileis points out that, using the data from the vignette,

    glmertree(depression_bin ~ treatment | cluster | age + anxiety + duration, data = DepressionDemo, minsize = 20)
    

    gives different answers from the same model with minsize = 50 (proving that the minsize argument does something, and presumably it does what is documented ...)