Permalink
Browse files

Adding Cardinale et al 2009 Ecology example.

  • Loading branch information...
1 parent 75b545d commit 63118a3b6e8875c0c23ecb54ee2f7b127980e1a1 @jebyrnes committed May 2, 2011
Showing with 164 additions and 11 deletions.
  1. +28 −0 cardinale_et_al_2008.r
  2. +130 −0 cardinale_et_al_2008_data.txt
  3. +6 −11 grace_bollen_2006.r
View
@@ -0,0 +1,28 @@
+######
+#
+# Data from http://www.esapubs.org/archive/ecol/E090/079/suppl-1.htm
+#
+#
+#######
+
+library(lavaan)
+
+cards<-read.table("./cardinale_et_al_2008_data.txt", sep="\t", header=T)
+cards<-na.omit(cards)
+
+cardModel<-'
+ SA ~ logN + logNcen2 + SR
+ logChl ~ SA + logN
+ GPP ~ logN + logChl
+ SR ~~ 0*logN + 0*logNcen2 #from path model - otherwise these are estimated
+
+ '
+
+#fixed.x=F in order to allow the dropping of paths between
+#SR and logN and LogNcen2
+cardFit <- sem(cardModel, data=cards, fixed.x=F)
+
+summary(cardFit)
+
+standardizedSolution(cardFit)
+
Oops, something went wrong.

0 comments on commit 63118a3

Please sign in to comment.