evaluateTree: Evaluate Tree -2LL

View source: R/evaluateTree.R

evaluateTreeR Documentation

Evaluate Tree -2LL

Description

A helper function to evaluate the negative two log-likelihood (-2LL) of leaf (terminal) nodes for a dataset. When given a semtree and a unique dataset, the model estimates -2LL for the tree parameters and data subsets that fit the tree branching criteria.

Usage

evaluateTree(tree, test_set, data_type = "raw", leaf_ids = NULL)

Arguments

tree

A fitted semtree object

test_set

Dataset to fit to a fitted semtree object

data_type

type of data ("raw", "cov", "cor")

leaf_ids

Identifies which nodes are leaf nodes. Default is NULL, which checks model for leaf nodes and fills this information in automatically.

Value

A list with two elements:

deviance

Combined -2LL for leaf node models of the tree.

num_models

Number of leaf nodes used for the deviance calculations.

Author(s)

Andreas M. Brandmaier, John J. Prindle

References

Brandmaier, A.M., Oertzen, T. v., McArdle, J.J., & Lindenberger, U. (2013). Structural equation model trees. Psychological Methods, 18(1), 71-86.

See Also

evaluateDataLikelihood, semtree, semforest


semtree documentation built on Nov. 26, 2023, 5:07 p.m.