getNewModel {lavaSearch2}R Documentation

Extract the Model that Has Been Retains by the modelsearch2.

Description

Extract the model that has been retained by modelsearch2.

Usage

getNewModel(object, step)

## S3 method for class 'modelsearch2'
getNewModel(object, step = nStep(object))

Arguments

object

a modelsearch2 object.

step

[integer >=0] the step at which the model should be extracted. 0 returns the initial model, i.e. before adding any links.

Value

A lvmfit object.

Examples

## Not run: 
mSim <- lvm(Y~G+X1+X2)
addvar(mSim) <- ~Z1+Z2+Z3+Z4+Z5+Z6

set.seed(10)
df.data <- lava::sim(mSim, 1e2)

mBase <- lvm(Y~G)
addvar(mBase) <- ~X1+X2+Z1+Z2+Z3+Z4+Z5+Z6
e.lvm <- estimate(mBase, data = df.data)
res <- modelsearch2(e.lvm, method.p.adjust = "holm")
getNewModel(res)

## End(Not run)

[Package lavaSearch2 version 2.0.3 Index]