PostPrInDT {PrInDT}R Documentation

Posterior analysis of conditional inference trees: distribution of a specified variable in the terminal nodes.

Description

The conditional inference tree 'ct' is analyzed according to the distribution of a variable 'var' in its terminal nodes.
In the case of a discrete variable 'var', the appearance of the different levels is considered for each terminal node.
In the case of a continuous variable 'var', means and standard deviations of 'var' or the target variable are considered for each terminal node.
In particular, this function can be used for the posterior analysis of a tree regarding the distribution of a variable not present in the tree.

Usage

PostPrInDT(datain, ct, target, var, vardata, vt)

Arguments

datain

input data frame with the observatios of all variables used in the model

ct

conditional inference tree to be analyzed

target

name of target variable of 'ct' (character)

var

name of variable of interest (character)

vardata

observations of 'var'

vt

type of variables: 'dd' for discrete target (classification) and discrete variable 'var', 'dc' for discrete target (classification) and continuous 'var', 'cd' for continuous target (regression) and discrete 'var', and 'cc' for continuous target (regression) and continuous 'var'.

Value

None: Relevant output is produced by the function.

Examples

data <- PrInDT::data_zero
data <- na.omit(data)
outAll <- PrInDTAll(data,"real") 
PostPrInDT(data,outAll$treeAll,"real","ETH",data$ETH,vt="dd")
PostPrInDT(data,outAll$treeAll,"real","AGE",data$AGE,vt="dc")
datareg <- PrInDT::data_vowel
outregAll <- PrInDTregAll(datareg,"target") 
PostPrInDT(datareg,outregAll$treeAll,"target","Nickname",datareg$Nickname,vt="cd")
PostPrInDT(datareg,outregAll$treeAll,"target","AGE",datareg$AGE,vt="cc")


[Package PrInDT version 1.0.1 Index]