# Load sample data
data(sample_data)
# Quick demonstration with reduced complexity (< 5 seconds)
# Using 2 conditions and 2 threshold levels
sweep_list_X <- list(
X1 = 6:7, # Reduced from 6:8 to 6:7
X2 = 6:7 # Reduced from 6:8 to 6:7
)
sweep_range_Y <- 6:7 # Reduced from 6:8 to 6:7
# Run dual threshold sweep with reduced parameters
# This explores 2 × 2^2 = 8 threshold combinations
result_quick <- dtSweep(
dat = sample_data,
outcome = "Y",
conditions = c("X1", "X2"), # Reduced from 3 to 2 conditions
sweep_list_X = sweep_list_X,
sweep_range_Y = sweep_range_Y
)
head(result_quick$summary)
# \donttest{
# Full analysis with all conditions and thresholds
# This explores 3 × 3^3 = 81 threshold combinations (takes ~10-15 seconds)
sweep_list_X_full <- list(
X1 = 6:8,
X2 = 6:8,
X3 = 6:8
)
sweep_range_Y_full <- 6:8
result_full <- dtSweep(
dat = sample_data,
outcome = "Y",
conditions = c("X1", "X2", "X3"),
sweep_list_X = sweep_list_X_full,
sweep_range_Y = sweep_range_Y_full
)
# Analyze threshold-dependent causal structures
head(result_full$summary)
# }
Run the code above in your browser using DataLab