| goricaSEM | R Documentation | 
goric.lavaan() from the restriktor packageThe goricaSEM() function is an interface to restriktor::goric.lavaan(),
allowing users to perform generalized order-restricted information criterion
approximation (GORICA) analysis specifically for structural equation
models fitted using the lavaan package.
goricaSEM(object, ..., hypotheses = NULL, comparison = NULL,
  type = "gorica", standardized = FALSE, debug = FALSE)
| object | A lavaan::lavaan object. | 
| ... | Additional arguments passed to  | 
| hypotheses | A named  | 
| comparison | A  | 
| type | A  | 
| standardized | 
 | 
| debug | 
 | 
This function is designed as a wrapper for the restriktor::goric.lavaan()
function. It calculates GORICA values and weights, which can be used to
compare models or hypotheses under inequality constraints.
The hypotheses= argument allows users to specify constraints in text-based
syntax or matrix notation. For text-based syntax, constraints are specified
as a string (e.g., "a1 > a2"). For matrix notation, a named list with
$constraints, $rhs, and $neq elements can be provided.
The comparison= argument determines whether the specified hypothesis is
compared against its "complement", the "unconstrained" model, or
neither ("none").
A list containing the results of the goric.lavaan function,
including:
The log-likelihood.
Penalty term.
GORIC(A) values and weights.
Relative GORIC(A) weights.
Leonard Vanbrabant and Rebecca Kuiper
Kuiper, R. M., Hoijtink, H., & Silvapulle, M. J. (2011). An Akaike-type information criterion for model selection under inequality constraints. Biometrika, 98(2), 495–501. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asr002")}
Vanbrabant, L., Van Loey, N., & Kuiper, R. M. (2020). Evaluating a theory-based hypothesis against its complement using an AIC-type information criterion with an application to facial burn injury. Psychological Methods, 25(2), 129–142. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000238")}
restriktor::goric.lavaan()
## Example: Perform GORICA analysis on a lavaan model
library(lavaan)
library(restriktor)
## Define the SEM model
model <- '
  ind60 =~ x1 + x2 + x3
  dem60 =~ y1 + a1*y2 + b1*y3 + c1*y4
  dem65 =~ y5 + a2*y6 + b2*y7 + c2*y8
  dem60 ~ ind60
  dem65 ~ ind60 + dem60
  y1 ~~ y5
  y2 ~~ y4 + y6
  y3 ~~ y7
  y4 ~~ y8
  y6 ~~ y8
'
## Fit the model
data(PoliticalDemocracy)
fit <- sem(model, data = PoliticalDemocracy)
## Define hypotheses
myHypothesis <- 'a1 > a2, b1 > b2, c1 > c2'
## Perform GORICA analysis
result <- goricaSEM(fit, hypotheses = list(H1 = myHypothesis),
                    standardized = FALSE, comparison = "complement",
                    type = "gorica")
## Print result
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.