semnova {semnova}R Documentation

Latent repeated-measures ANOVA using the LGC approach

Description

Function specifies an LGC model. The idata object is used to create the contrast matrix that is passed to the lgc() function. Typical hypotheses are specified as well.

Usage

semnova(
  formula,
  idesign,
  idata,
  data,
  mmodel = NULL,
  covariates = NULL,
  groups = NULL,
  append = NULL,
  icontrasts = c("contr.poly", "contr.sum"),
  verbose = FALSE,
  compound_symmetry = FALSE,
  sphericity = FALSE,
  multiv_tests = c("wilks", "wald"),
  univ_tests = c("F"),
  randomization = list(ncores = 1, nsamples = 1000),
  ...
)

Arguments

formula

Formula.

idesign

Formula. Within-subjects design formula.

idata

Dataframe. The dataframe contains the factorial design.

data

Dataframe. Data object to be passed to lavaan.

mmodel

Object of class mmodel. If not provided, manifest variables from the formula object will be used. Otherwise, use create_mmodel() to specify measurement model.

covariates

Not implemented yet.

groups

Not implemented yet.

append

Character vector. Syntax that is to be appended to lavaan syntax.

icontrasts

Character vector. Use this argument to select the type of contrasts to be used. Default is c("contr.sum", "contr.poly") (not ordered, ordered).

verbose

Boolean. Print details during procedure.

compound_symmetry

Boolean. When set to TRUE, compound symmetry is assumed among dependent variables.

sphericity

Boolean or formula. When set to TRUE, sphericity is assumed for all effects.

multiv_tests

Character vector. Multivariate test statistics that are to be computed. Possible statistics are: c("wilks", "wald"). Default is multiv_tests = c("wilks", "wald").

univ_tests

Character vector. Univariate test statistics that are to be computed. Possible statistics are: c("F"). Default is univ_tests = NULL.

randomization

Not yet supported.

...

Additional arguments to be passed to lavaan.

Value

Function returns an lgc object. Use summary(object) to print hypotheses. Otherwise use object@sem_obj to get access to the underlying lavaan object.

Examples


set.seed(323412431)

data("semnova_test_data", package = "semnova")

idata  <- expand.grid(A = c("A1", "A2", "A3"), B = c("B1", "B2"))

mmodel <- create_mmodel(
    A1B1 = "var1",
    A2B1 = "var2",
    A3B1 = "var3",
    A1B2 = "var4",
    A2B2 = "var5",
    A3B2 = "var6",
    lv_scaling = "referent"
)

fit_semnova <-
    semnova(
        formula = cbind(A1B1, A2B1, A3B1, A1B2, A2B2, A3B2) ~ 1,
        data = semnova_test_data,
        idata = idata,
        idesign = ~ A * B,
        mmodel = mmodel
    )

summary(fit_semnova)


[Package semnova version 0.1-6 Index]