An R package to create nice looking output for CFA and SEM analyses using lavaan and semPlot packages

See an Example Output

Install

devtools::install_github("dr-JT/semoutput")

Required Packages

  • lavaan package to run CFA and SEM analyses

  • semPlot package to display model diagrams

  • sjPlot package to print correlation tables

Usage

The package contains an R Markdwon template that makes it very easy to run CFA and SEM analyses in R and create nice looking output.

Once you install the package, you will be able to access the RMarkdown template by going to

File -> New File -> R Markdown… -> From Template -> SEM RMarkdown

You simply need to specify the data file location in the YAML header under

params:
  data: "filepath"

Then specify the CFA or SEM model using lavaan syntax.

lavaan syntax is very intuitive to use and is documented with useful tutorials

http://lavaan.ugent.be/tutorial/index.html

Screen Shots

Model Fit

alt text

CFA Output

alt text

SEM Output

alt text

Model Diagram

alt text

Correlation Matrix

alt text