Learn R Programming

stablespec (version 0.2.3)

plotStability: Plot of edge and causal path stability.

Description

Plot each of the stability of causal path and edge including the threshold of stability and model complexity.

Usage

plotStability(listOfFronts = NULL, threshold = NULL, stableCausal = NULL, stableCausal_l1 = NULL, stableEdge = NULL, longitudinal = NULL)

Arguments

listOfFronts
list of models including their fitness and subset index.
threshold
threshold of stability selection. The default is 0.6.
stableCausal
list of causal path stability for the whole range of model complexities.
stableCausal_l1
list of causal path stability of length 1 for the whole range of model complexities.
stableEdge
list of edge stability for the whole range of model complexities.
longitudinal
TRUE for longitudinal data, and FALSE cross-sectional data.

Value

Plot of causal path and edge stability for every pair of variables, including plots of all edge stabilites and all cauasl path stabilities.

Examples

Run this code

the_data <- crossdata6V
numSubset <- 1
num_iteration <- 5
num_pop <- 10
mut_rate <- 0.075
cross_rate <- 0.85
longi <- FALSE
num_time <- 1
the_co <- "covariance"
#assummed that variable 5 does not cause variables 1, 2, and 3
cons_matrix <- matrix(c(5, 1, 5, 2, 5, 3), 3, 2, byrow=TRUE)
th <- 0.1
to_plot <- FALSE

result <- stableSpec(theData=the_data, nSubset=numSubset,
iteration=num_iteration,
nPop=num_pop, mutRate=mut_rate, crossRate=cross_rate,
longitudinal=longi, numTime=num_time,
co=the_co, consMatrix=cons_matrix, threshold=th, toPlot=to_plot)

plotStability(listOfFronts=result$listOfFronts, threshold=th,
stableCausal=result$causalStab,
stableCausal_l1=result$causalStab_l1,
stableEdge=result$edgeStab,
longitudinal=longi)

Run the code above in your browser using DataLab