Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (32 sloc) 1.236 kb
9dee27b @jebyrnes Adding Example of Grace and Bollen, Bull. Ecol. Soc. Amer.
authored
1 ####
2 #
3 # Example of the direct and indirect effects of elevation on plant cover via fires.
4 # Model taken from Figure 2. In the original paper, this example was used
5 # to illustrate the meaning of standardized coefficients in SEM versus multiple
6 # regression. Try using the covariance matrix to createa correlation matrix
7 # and calculate partial and semipartial correlation coefficients yourself.
8 # How do they compare?
9 #
10 # Grace, J.B. and Bollen, K.A. 2005. Interpreting the results from multiple regression and structural
11 # equation models. Bulletin of the Ecological Society of America. 86:283-295
12 #
13 # last tested: 5/5/11
14 # last lavaan version tested: 0.4-8
15 #
16 # byrnes@nceas.ucsb.edu
17 ###########
18
19
20 library(lavaan)
21
22 GB05Mat<-matrix(c(1006.2, -26.2, -139.4, 3636.3,
23 -26.2, 2.722, 13.47, -170.4,
24 -139.4, 13.47, 157.8, -1459.6,
25 3636.3, -170.4, -1459.6, 66693), ncol=4)
26
27 rownames(GB05Mat)<-colnames(GB05Mat)<-c("Plant.Cover",
28 "Fire.Severity", "Stand.Age", "Elevation")
29
30
31 model<-'
32 Stand.Age ~ Elevation
33 Fire.Severity ~ Stand.Age
34 Plant.Cover ~ Elevation + Fire.Severity
35 '
36
37 fit<-sem(model, sample.cov=GB05Mat, sample.nobs=90)
38
39 summary(fit)
40
41 standardizedSolution(fit)
Something went wrong with that request. Please try again.