Description Usage Arguments Details Value Author(s) References See Also Examples

This is the family of models that models only a variance-covariance matrix with mean structure. The `type`

argument can be used to define what model is used: `type = "cov"`

(default) models a variance-covariance matrix directly, `type = "chol"`

(alias: `cholesky()`

) models a Cholesky decomposition, `type = "prec"`

(alias: `precision()`

) models a precision matrix, `type = "ggm"`

(alias: `ggm()`

) models a Gaussian graphical model (Epskamp, Rhemtulla and Borsboom, 2017), and `type = "cor"`

(alias: `corr()`

) models a correlation matrix.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
varcov(data, type = c("cov", "chol", "prec", "ggm", "cor"),
sigma = "full", kappa = "full", omega = "full",
lowertri = "full", delta = "full", rho = "full", SD =
"full", mu, tau, vars, ordered = character(0), groups,
covs, means, nobs, missing = "listwise", equal =
"none", baseline_saturated = TRUE, estimator =
"default", optimizer, storedata = FALSE, WLS.W,
sampleStats, meanstructure, corinput, verbose = FALSE,
covtype = c("choose", "ML", "UB"), standardize =
c("none", "z", "quantile"), fullFIML = FALSE)
cholesky(...)
precision(...)
prec(...)
ggm(...)
corr(...)
``` |

`data` |
A data frame encoding the data used in the analysis. Can be missing if |

`type` |
The type of model used. See description. |

`sigma` |
Only used when |

`kappa` |
Only used when |

`omega` |
Only used when |

`lowertri` |
Only used when |

`delta` |
Only used when |

`rho` |
Only used when |

`SD` |
Only used when |

`mu` |
Optional vector encoding the mean structure. Set elements to 0 to indicate fixed to zero constrains, 1 to indicate free means, and higher integers to indicate equality constrains. For multiple groups, this argument can be a list or array with each element/column encoding such a vector. |

`tau` |
Optional list encoding the thresholds per variable. |

`vars` |
An optional character vector encoding the variables used in the analyis. Must equal names of the dataset in |

`groups` |
An optional string indicating the name of the group variable in |

`covs` |
A sample varianceâ€“covariance matrix, or a list/array of such matrices for multiple groups. Make sure |

`means` |
A vector of sample means, or a list/matrix containing such vectors for multiple groups. |

`nobs` |
The number of observations used in |

`covtype` |
If 'covs' is used, this is the type of covariance (maximum likelihood or unbiased) the input covariance matrix represents. Set to |

`missing` |
How should missingness be handled in computing the sample covariances and number of observations when |

`equal` |
A character vector indicating which matrices should be constrained equal across groups. |

`baseline_saturated` |
A logical indicating if the baseline and saturated model should be included. Mostly used internally and NOT Recommended to be used manually. |

`estimator` |
The estimator to be used. Currently implemented are |

`optimizer` |
The optimizer to be used. Can be one of |

`storedata` |
Logical, should the raw data be stored? Needed for bootstrapping (see |

`standardize` |
Which standardization method should be used? |

`WLS.W` |
Optional WLS weights matrix. |

`sampleStats` |
An optional sample statistics object. Mostly used internally. |

`verbose` |
Logical, should progress be printed to the console? |

`ordered` |
A vector with strings indicating the variables that are ordered catagorical, or set to |

`meanstructure` |
Logical, should the meanstructure be modeled explicitly? |

`corinput` |
Logical, is the input a correlation matrix? |

`fullFIML` |
Logical, should row-wise FIML be used? Not recommended! |

`...` |
Arguments sent to |

The model used in this family is:

*var(y) = sigma*

*E(y) = mu*

in which the covariance matrix can further be modeled in three ways. With `type = "chol"`

as Cholesky decomposition:

*sigma = lowertri * lowertri*,

with `type = "prec"`

as Precision matrix:

*sigma = kappa^(-1)*,

and finally with `type = "ggm"`

as Gaussian graphical model:

*sigma = delta * (I - omega)^(-1) * delta*.

An object of the class psychonetrics

Sacha Epskamp

Epskamp, S., Rhemtulla, M., & Borsboom, D. (2017). Generalized network psychometrics: Combining network and latent variable models. Psychometrika, 82(4), 904-927.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ```
# 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]
# Saturated estimation:
mod_saturated <- ggm(ConsData, vars = vars)
# We can look at the parameters:
mod_saturated %>% parameters
# Labels:
labels <- c(
"indifferent to the feelings of others",
"inquire about others' well-being",
"comfort others",
"love children",
"make people feel at ease")
# Plot CIs:
CIplot(mod_saturated, "omega", labels = labels, labelstart = 0.2)
# We can also fit an empty network:
mod0 <- ggm(ConsData, vars = vars, omega = "empty")
# Run the model:
mod0 <- mod0 %>% runmodel
# We can look at the modification indices:
mod0 %>% MIs
# To automatically add along modification indices, we can use stepup:
mod1 <- mod0 %>% stepup
# Let's also prune all non-significant edges to finish:
mod1 <- mod1 %>% prune
# Look at the fit:
mod1 %>% fit
# Compare to original (baseline) model:
compare(baseline = mod0, adjusted = mod1)
# We can also look at the parameters:
mod1 %>% parameters
# Or obtain the network as follows:
getmatrix(mod1, "omega")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.