View source: R/e_modelmodifications_prune.R
| prune | R Documentation | 
This function will (recursively) remove parameters that are not significant and refit the model.
prune(x, alpha = 0.01, adjust = c("none", "holm",
                    "hochberg", "hommel", "bonferroni", "BH", "BY",
                    "fdr"), matrices, runmodel = TRUE, recursive = FALSE,
                    verbose, log = TRUE, identify = TRUE, startreduce = 1,
                    limit = Inf, mode = c("tested","all"), ...)
x | 
 A   | 
alpha | 
 Significance level to use.  | 
adjust | 
 p-value adjustment method to use. See   | 
matrices | 
 Vector of strings indicating which matrices should be pruned. Will default to network structures.  | 
runmodel | 
 Logical, should the model be evaluated after pruning?  | 
recursive | 
 Logical, should the pruning process be repeated?  | 
verbose | 
 Logical, should messages be printed?  | 
log | 
 Logical, should the log be updated?  | 
identify | 
 Logical, should models be identified automatically?  | 
startreduce | 
 A numeric value indicating a factor with which the starting values should be reduced. Can be useful when encountering numeric problems.  | 
limit | 
 The maximum number of parameters to be pruned.  | 
mode | 
 Mode for adjusting for multiple comparisons. Should all parameters be considered as the total number of tests or only the tested parameters (parameters of interest)?  | 
... | 
 Arguments sent to   | 
An object of the class psychonetrics (psychonetrics-class)
Sacha Epskamp
stepup
# Load bfi data from psych package:
library("psychTools")
data(bfi)
# Also load dplyr for the pipe operator:
library("dplyr")
# Let's take the agreeableness items, and gender:
ConsData <- bfi %>% 
  select(A1:A5, gender) %>% 
  na.omit # Let's remove missingness (otherwise use Estimator = "FIML)
# Define variables:
vars <- names(ConsData)[1:5]
# Let's fit a full GGM:
mod <- ggm(ConsData, vars = vars, omega = "full")
# Run model:
mod <- mod %>% runmodel
# Prune model:
mod <- mod %>% prune(adjust = "fdr", recursive = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.