Learn R Programming

piecewiseSEM (version 1.2.1)

sem.plot: Plotting of piecewise SEMs

Description

Generates mandala plot for piecewise structural equation models.

Usage

sem.plot(modelList, data, coef.table, corr.errors = NULL,
show.nonsig = TRUE, scaling = 10, alpha = 0.05, ...)

Arguments

modelList

a list of regressions representing the structural equation model.

data

a data.frame used to construct the structured equations.

coef.table

a table of model coefficients obtained from sem.coefs.

corr.errors

a vector of variables with correlated errors (separated by ~~).

show.nonsig

whether to show non-significant paths (P >= alpha). Default is TRUE.

scaling

scaling coefficient for path thickness. Default is 10. If NA then all paths are equal width.

alpha

significance threshold. Default is 0.05.

...

additional arguments to sem.coefs.

Value

Returns a plot where variables are equidistantly spaced in a circle. Arrows indicate the directionality of the relationship. The arrow width indicates the strength of the effect (based on estimates from sem.coefs). Dashed and grey arrows indicate non-significant effects. Red arrows indicate negative effects.

Details

Accepts either a list of structured equations and the data, or a table of coefficients obtained from sem.coefs.

See Also

sem.coefs

Examples

Run this code
# NOT RUN {
# Load example data
data(shipley2009)

# Load model packages
library(lme4)
library(nlme)

# Create list of models 
shipley2009.modlist = list(
  
  lme(DD ~ lat, random = ~1|site/tree, na.action = na.omit, 
      data = shipley2009),
  
  lme(Date ~ DD, random = ~1|site/tree, na.action = na.omit, 
      data = shipley2009),
  
  lme(Growth ~ Date, random = ~1|site/tree, na.action = na.omit, 
      data = shipley2009),
  
  glmer(Live ~ Growth+(1|site)+(1|tree), 
        family=binomial(link = "logit"), data = shipley2009) 
  
)

# Plot output
sem.plot(shipley2009.modlist, shipley2009)

# }
# NOT RUN {
  # Alternately get coefficient table and pass to sem.plot
  coef.table = sem.coefs(shipley2009.modlist, shipley2009)
  
  sem.plot(coef.table)
  
# }

Run the code above in your browser using DataLab