best.tree.permute: permutation test on a pltr model

View source: R/best.tree.permute.R

best.tree.permuteR Documentation

permutation test on a pltr model

Description

a unified permutation test procedure to select and test at the same time the selected tree

Usage

best.tree.permute(xtree, xdata, Y.name, X.names, G.names, B = 10,
 args.rpart = list(cp = 0, minbucket = 20, maxdepth = 10), epsi = 0.001,
 iterMax = 5, iterMin = 3, family = "binomial", LEVEL = 0.05, 
 LB = FALSE, args.parallel = list(numWorkers = 1, type = "PSOCK"), verbose = TRUE)

Arguments

xtree

the maximal tree obtained by the function pltr.glm

xdata

the data frame used to build xtree

Y.name

the name of the dependent variable

X.names

the names of independent variables to consider in the linear part of the glm. For this function, only a binary variable is supported.

G.names

the names of independent variables to consider in the tree part of the hybrid glm.

B

the size of the bootstrap sample

args.rpart

a list of options that control details of the rpart algorithm. minbucket: the minimum number of observations in any terminal <leaf> node; cp: complexity parameter (Any split that does not decrease the overall lack of fit by a factor of cp is not attempted); maxdepth: the maximum depth of any node of the final tree, with the root node counted as depth 0. ... See rpart.control for further details

epsi

a treshold value to check the convergence of the algorithm

iterMax

the maximal number of iteration to consider

iterMin

the minimum number of iteration to consider

family

the binomial family.

LEVEL

the level of the test

LB

a binary indicator with values TRUE or FALSE indicating weither the loading is balanced or not in the parallel computing. It is useless on a windows platform.

args.parallel

parameters of the parallelization. See mclapply for more details.

verbose

Logical; TRUE for printing progress during the computation (helpful for debugging)

Value

a list with six elements:

p.val_selected

the adjusted p-value of the selected tree

selected_model

a list with the fit of the selected pltr model fit_glm, the selected tree tree and the p-value of the selected tree without adjusting for multiple comparisons p.value

fit_glm

the fitted pltr model under the null hypothesis if the test is not significant

Timediff

The execution time of the permutation test procedure

comp_p_values

The P-values of the competing trees

Badj

The number of samples used inside the procedure

Author(s)

Cyprien Mbogning

See Also

p.val.tree, best.tree.bootstrap

Examples

## Not run: 
##load the data set

data(data_pltr)

## set the parameters

args.rpart <- list(minbucket = 40, maxdepth = 10, cp = 0)
family <- "binomial"
Y.name <- "Y"
X.names <- "G1"
G.names <- paste("G", 2:15, sep="")

## build a maximal tree

fit_pltr <- pltr.glm(data_pltr, Y.name, X.names, G.names, args.rpart = args.rpart, 
                     family = family,iterMax = 5, iterMin = 3)
                     
## select an test the selected tree by a permutation test procedure

args.parallel = list(numWorkers = 1, type = "PSOCK")

best_permute <- best.tree.permute(fit_pltr$tree, data_pltr, Y.name, X.names,
  G.names, B = 10, args.rpart = args.rpart, epsi = 0.001, iterMax = 5,              
             iterMin = 3, family = family, LEVEL = 0.05,LB = FALSE, 

## End(Not run)                                   args.parallel = args.parallel)

GPLTR documentation built on Aug. 27, 2023, 1:06 a.m.