pathCoin produces a netCoin object from a lavaan object, i.e., parameters of structural equation model.

pathCoin(model, estimates=c("b","se","z","pvalue","beta"), 
         fitMeasures=c("chisq", "cfi", "rmsea"), ...)

Arguments

model

a lavaan object.

estimates

A vector with at least one element amongst "b", "se", "z", "pvalue", "beta".

fitMeasures

Default values: "chisq", "df", "pvalue", "cfi", "rmsea"

...

Any netCoin argument.

Value

The function creates a netCoin object and eventually a folder in the computer with an HTML document named index.html which contains the produced graph. This file can be directly opened with your browser and sent to a web server to work properly.

Author

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

# Classic Wheaton et al. model library(lavaan)
#> This is lavaan 0.6-7
#> lavaan is BETA software! Please report any bugs.
lower <- ' 11.834 6.947 9.364 6.819 5.091 12.532 4.783 5.028 7.495 9.986 -3.839 -3.889 -3.841 -3.625 9.610 -21.899 -18.831 -21.748 -18.775 35.522 450.288 ' wheaton.cov <- getCov(lower, names = c("anomia67", "powerless67","anomia71", "powerless71", "education", "sei")) wheaton.model <- ' # latent variables ses =~ education + sei alien67 =~ anomia67 + powerless67 alien71 =~ anomia71 + powerless71 # regressions alien71 ~ alien67 + ses alien67 ~ ses # correlated residuals anomia67 ~~ anomia71 powerless67 ~~ powerless71 ' fit <- sem(wheaton.model, sample.cov = wheaton.cov, sample.nobs = 932) pathCoin(fit)
#> #> Nodes(3): #> name #> alien67 #> ses #> alien71 #> #> Links(3): #> Source Target b se z pvalue beta #> alien67 alien71 0.6070472 0.05102066 11.898066 0.000000e+00 0.5671588 #> ses alien71 -0.2267661 0.05232648 -4.333678 1.466384e-05 -0.2074733 #> ses alien67 -0.5750068 0.05640204 -10.194788 0.000000e+00 -0.5630861 #> #> <p>Chi2=4.735 (4 df), pvalue=0.32. CFI= 1. RMSEA= 0.014.</p>