getExtraOutput: Get extra outputs from the result of simulation

Description Usage Arguments Value Author(s) See Also Examples

View source: R/summarySimResult.R

Description

Get extra outputs from a simulation result object (SimResult). Users can ask this package to extra output from the lavaan object in each iteration by setting the outfun argument (in the sim function). See the example below.

Usage

1
getExtraOutput(object, improper = TRUE, nonconverged = FALSE)

Arguments

object

SimResult that have the extra output extracted by the function defined in the outfun argument (in the sim function)

improper

Specify whether to include the information from the replications with improper solutions

nonconverged

Specify whether to include the information from the nonconvergent replications

Value

A list of extra outputs

Author(s)

Sunthud Pornprasertmanit (psunthud@gmail.com)

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
loading <- matrix(0, 6, 1)
loading[1:6, 1] <- NA
LY <- bind(loading, 0.7)
RPS <- binds(diag(1))
RTE <- binds(diag(6))
CFA.Model <- model(LY = LY, RPS = RPS, RTE = RTE, modelType="CFA")

# Write a function to extract the modification index from lavaan object
outfun <- function(out) {
	result <- inspect(out, "mi")
}

# We will use only 5 replications to save time.
# In reality, more replications are needed.
Output <- sim(5, n=200, model=CFA.Model, outfun=outfun)

# Get the modification index of each replication
getExtraOutput(Output)

## End(Not run)

Example output

Loading required package: lavaan
This is lavaan 0.6-3
lavaan is BETA software! Please report any bugs.
 
#################################################################
This is simsem 0.5-14
simsem is BETA software! Please report any bugs.
simsem was first developed at the University of Kansas Center for
Research Methods and Data Analysis, under NSF Grant 1053160.
#################################################################

Attaching package: 'simsem'

The following object is masked from 'package:lavaan':

    inspect

Progress: 1 / 5 
Progress: 2 / 5 
Progress: 3 / 5 
Progress: 4 / 5 
Progress: 5 / 5 
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL

simsem documentation built on March 29, 2021, 1:07 a.m.