An SEM approach to eelgrass communities in southeast Alaska

As an alternative to using only limear models we may also be able to describe the eelgrass community structure with strutual equation modeling (SEM). This will follow the apprach and package developed by Lefcheck. All of the pre data processing will follow that same as the glm models in other scripts.

Data

Response metrics 1. eelgrass aboveground biomass density (g / m2) 2. eelgrass belowground biomass density (g / m2) 3. eelgrass shoot density (count / m2) 4. ratio of aboveground to belowground biomass density (g / m2) 5. epiphyte load (g epiphyte / g eelgrass) 6. total grazer load (g grazers/ g eelgrass) + gastropod load (g grazers/ g eelgrass) + crustaecean load (g grazers/ g eelgrass) 7. crab biomass (g) - can also be counts 8. fish biomass (g) - can also be counts

Explanatory factors 1. Sea otter index 2. Time 3. Sediment type (primary sediment type from the “inside” eelgrass transect) 4. Light attenuation 5. crab biomass (g) 6. fish biomass (g) 7. grazer load (g/g) 8. epiphyte load (g/g)

Data Prep

Sediment data preparation. Average by site.

Light availability calculation

Crab data preparation. This needs to be done to summarise by site and string (i.e. loose species information). Average by site.

Crab data preparation. Summarize counts and mass of cancer/rock crabs. Average by site.

Fish data preparation. append taxonomy

This needs to be done to summarise by site across all species.

Analytical Approach

Question Does a sea otter mediated trophic cascade occur in Southeast Alaska? What are the relationships among eelgrass community constiuents, and do sea otters play a role in that?

Analysis will follow four major steps.

  1. Define a conceptual model that shows all biologically defenseable paths among variables.
  2. Reduce the possible varibles to ones that actually seem important for describing the relationship among variables.
  3. Adjust the conceptual model to incule only those varibles which were deemed important from above.
  4. Fit SEM

For our analysis we will first define our exogenous and endogenous variables.

Exogenous - varibles that only have paths going away from them 1. Sea otters 2. Nutrients 3. Light availability 4. Sediment 5. Time - kinda, but we will deal with that later

Endogenous - variables that have paths coming to them and potentially going away from them 1. Crabs 2. Fish 3. Grazers 4. Epiphytes 5. Eelgrass

1. Conceptual model

Diagram represents all reasonable direct biological paths among the eelgrass associated community.

2. Suitable data and variable reduction

Following the rule of thumb that any responce of one of the component models should have 5 >= N/5 predictors, we will evaluate potential component models. For our data set we have N = 21 so 21/5 = 4.2, so any componenet model should have no more than 4 predictors. Looking at the conceptual model no endogenous variables have more than 4 paths going towards them, indicating that we have aduaquate data to fit all the paths. So thats good.

Grace at al 2012 is of the opinion of keeping models simple and tightly defining your question. I tend to agree, especailly considering the low sample size of the study.

4. Set of structural equations

Final variable set for full model

Exogeneous 1. Sea otters 2. Total water nitrogen 3. Light availability 4. Sediment

Endogeneous 1. Eelgrass (as abovegound biomass - de-trended with respect to julian day) 2. Epiphytes (as epiphte load - log trasformed and de-trended with respect to julian day) 3. Grazers (as grazer load - log transformed) 4. Fish (as total fish biomass - log tranformed) 5. Crabs (as total crab biomass - square-root transformed)

Simplified data

To simplify the analysis work space I will create a new data frame with all the data I am going to use in its final form. So tranfromed and de-trended where appropriate.

5. Full SEM

SEM 1

Following paths indicated in figure

sem.1 <- psem(
  lm(crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln, data = dat.redu),

  lm(grazermass_shoot_ln ~ crab_mass_sq + fish_mass_ln, data = dat.redu),
  
  lm(epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim + Ntotal_site + light_avail, data = dat.redu),
  
  lm(abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + Ntotal_site + light_avail, data = dat.redu)

)
Model checking and diagnostics

Below we will run through model components and diagnostics.

Basis Set
d-seperation

No evidence of any d-separation

##                                            Independ.Claim    Estimate
## 1        grazermass_shoot_ln  ~  sea_otter_index_tr + ... -0.17621453
## 2  epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...  0.20759550
## 3             abvgnd_mass_dt  ~  sea_otter_index_tr + ... 21.39346938
## 4        epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...  0.07624657
## 5                   abvgnd_mass_dt  ~  fish_mass_ln + ... -5.31087302
## 6                  crab_mass_sq  ~  sed_inside_prim + ...  0.43661200
## 7           grazermass_shoot_ln  ~  sed_inside_prim + ... -0.13610085
## 8                      crab_mass_sq  ~  Ntotal_site + ...  0.16803730
## 9               grazermass_shoot_ln  ~  Ntotal_site + ... -0.01829266
## 10                     crab_mass_sq  ~  light_avail + ...  2.69546218
## 11              grazermass_shoot_ln  ~  light_avail + ... -2.59590142
## 12       epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...  0.05190418
## 13                  abvgnd_mass_dt  ~  crab_mass_sq + ... -0.14199655
## 14           abvgnd_mass_dt  ~  grazermass_shoot_ln + ... -0.90973130
##      Std.Error DF  Crit.Value    P.Value 
## 1   0.54025721 17 -0.32616784 0.74827826 
## 2   0.59725179 15  0.34758456 0.73298143 
## 3  14.00962243 15  1.52705539 0.14755592 
## 4   0.16478673 15  0.46269850 0.65022166 
## 5   4.12452288 15 -1.28763330 0.21738609 
## 6   0.72891632 17  0.59898782 0.55707956 
## 7   0.18877765 17 -0.72095850 0.48073298 
## 8   0.54237961 17  0.30981492 0.76046724 
## 9   0.16006393 17 -0.11428349 0.91035198 
## 10  4.99331025 17  0.53981468 0.59632580 
## 11  1.37769962 17 -1.88422888 0.07675209 
## 12  0.07963127 13  0.65180645 0.52588258 
## 13  1.82510139 13 -0.07780201 0.93917030 
## 14  7.71955840 13 -0.11784758 0.90798981
Fisher’s C

High p-value, indicating that the model is good.

##   Fisher.C df P.Value
## 1   20.084 28   0.861
Coefficients and R-sq
##                     Response                 Predictor Estimate Std.Error
## 1               crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410
## 2               crab_mass_sq              fish_mass_ln  -0.7238    0.5341
## 3        grazermass_shoot_ln              crab_mass_sq   0.0557    0.0534
## 4        grazermass_shoot_ln              fish_mass_ln   0.0606    0.1641
## 5  epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.3791    0.2485
## 6  epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2543    0.1640
## 7  epiphmass_shootmass_ln_dt               Ntotal_site   0.0986    0.1701
## 8  epiphmass_shootmass_ln_dt               light_avail   1.1102    1.7389
## 9             abvgnd_mass_dt epiphmass_shootmass_ln_dt  -4.6238    6.0970
## 10            abvgnd_mass_dt           sed_inside_prim  -5.9518    4.5762
## 11            abvgnd_mass_dt               Ntotal_site   3.7254    4.4260
## 12            abvgnd_mass_dt               light_avail  -7.9908   43.9192
##    DF Crit.Value P.Value Std.Estimate   
## 1  18    -3.6302  0.0019      -0.6315 **
## 2  18    -1.3551  0.1922      -0.2357   
## 3  18     1.0429  0.3108       0.2456   
## 4  18     0.3695  0.7160       0.0870   
## 5  16    -1.5256  0.1466      -0.3434   
## 6  16    -1.5511  0.1404      -0.3299   
## 7  16     0.5797  0.5702       0.1318   
## 8  16     0.6384  0.5322       0.1582   
## 9  16    -0.7584  0.4593      -0.1969   
## 10 16    -1.3006  0.2118      -0.3288   
## 11 16     0.8417  0.4124       0.2122   
## 12 16    -0.1819  0.8579      -0.0485
##                    Response   family     link method  R.squared
## 1              crab_mass_sq gaussian identity   none 0.45522906
## 2       grazermass_shoot_ln gaussian identity   none 0.05776055
## 3 epiphmass_shootmass_ln_dt gaussian identity   none 0.30797385
## 4            abvgnd_mass_dt gaussian identity   none 0.14481387
Full output
summary(sem.1, .progressBar = FALSE)
## 
## Structural Equation Model of sem.1 
## 
## Call:
##   crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln
##   grazermass_shoot_ln ~ crab_mass_sq + fish_mass_ln
##   epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim + Ntotal_site + light_avail
##   abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + Ntotal_site + light_avail
## 
##     AIC      BIC
##  60.084   80.974
## 
## ---
## Tests of directed separation:
## 
##                                           Independ.Claim Estimate Std.Error
##         grazermass_shoot_ln  ~  sea_otter_index_tr + ...  -0.1762    0.5403
##   epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...   0.2076    0.5973
##              abvgnd_mass_dt  ~  sea_otter_index_tr + ...  21.3935   14.0096
##         epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...   0.0762    0.1648
##                    abvgnd_mass_dt  ~  fish_mass_ln + ...  -5.3109    4.1245
##                   crab_mass_sq  ~  sed_inside_prim + ...   0.4366    0.7289
##            grazermass_shoot_ln  ~  sed_inside_prim + ...  -0.1361    0.1888
##                       crab_mass_sq  ~  Ntotal_site + ...   0.1680    0.5424
##                grazermass_shoot_ln  ~  Ntotal_site + ...  -0.0183    0.1601
##                       crab_mass_sq  ~  light_avail + ...   2.6955    4.9933
##                grazermass_shoot_ln  ~  light_avail + ...  -2.5959    1.3777
##         epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...   0.0519    0.0796
##                    abvgnd_mass_dt  ~  crab_mass_sq + ...  -0.1420    1.8251
##             abvgnd_mass_dt  ~  grazermass_shoot_ln + ...  -0.9097    7.7196
##   DF Crit.Value P.Value 
##   17    -0.3262  0.7483 
##   15     0.3476  0.7330 
##   15     1.5271  0.1476 
##   15     0.4627  0.6502 
##   15    -1.2876  0.2174 
##   17     0.5990  0.5571 
##   17    -0.7210  0.4807 
##   17     0.3098  0.7605 
##   17    -0.1143  0.9104 
##   17     0.5398  0.5963 
##   17    -1.8842  0.0768 
##   13     0.6518  0.5259 
##   13    -0.0778  0.9392 
##   13    -0.1178  0.9080 
## 
## Global goodness-of-fit:
## 
##   Fisher's C = 20.084 with P-value = 0.861 and on 28 degrees of freedom
## 
## ---
## Coefficients:
## 
##                    Response                 Predictor Estimate Std.Error DF
##                crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410 18
##                crab_mass_sq              fish_mass_ln  -0.7238    0.5341 18
##         grazermass_shoot_ln              crab_mass_sq   0.0557    0.0534 18
##         grazermass_shoot_ln              fish_mass_ln   0.0606    0.1641 18
##   epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.3791    0.2485 16
##   epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2543    0.1640 16
##   epiphmass_shootmass_ln_dt               Ntotal_site   0.0986    0.1701 16
##   epiphmass_shootmass_ln_dt               light_avail   1.1102    1.7389 16
##              abvgnd_mass_dt epiphmass_shootmass_ln_dt  -4.6238    6.0970 16
##              abvgnd_mass_dt           sed_inside_prim  -5.9518    4.5762 16
##              abvgnd_mass_dt               Ntotal_site   3.7254    4.4260 16
##              abvgnd_mass_dt               light_avail  -7.9908   43.9192 16
##   Crit.Value P.Value Std.Estimate   
##      -3.6302  0.0019      -0.6315 **
##      -1.3551  0.1922      -0.2357   
##       1.0429  0.3108       0.2456   
##       0.3695  0.7160       0.0870   
##      -1.5256  0.1466      -0.3434   
##      -1.5511  0.1404      -0.3299   
##       0.5797  0.5702       0.1318   
##       0.6384  0.5322       0.1582   
##      -0.7584  0.4593      -0.1969   
##      -1.3006  0.2118      -0.3288   
##       0.8417  0.4124       0.2122   
##      -0.1819  0.8579      -0.0485   
## 
##   Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05
## 
## Individual R-squared:
## 
##                    Response method R.squared
##                crab_mass_sq   none      0.46
##         grazermass_shoot_ln   none      0.06
##   epiphmass_shootmass_ln_dt   none      0.31
##              abvgnd_mass_dt   none      0.14
SEM 2

Given the restuls from the first SEM I will attempt to refine the model. Given that there was no indocation of d-sep I will focus on the specified paths. There are a few variables that have very little explanatory power. Abv mass - light and grazer - fish.

sem.2 <- psem(
  lm(crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln, data = dat.redu),

  lm(grazermass_shoot_ln ~ crab_mass_sq, data = dat.redu),
  
  lm(epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim + Ntotal_site + light_avail, data = dat.redu),
  
  lm(abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + Ntotal_site, data = dat.redu)

)
Basis Set
d-seperation

No evidence of any d-separation

##                                            Independ.Claim    Estimate
## 1        grazermass_shoot_ln  ~  sea_otter_index_tr + ... -0.20683179
## 2  epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...  0.20759550
## 3             abvgnd_mass_dt  ~  sea_otter_index_tr + ... 21.47214684
## 4              grazermass_shoot_ln  ~  fish_mass_ln + ...  0.06063472
## 5        epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...  0.07624657
## 6                   abvgnd_mass_dt  ~  fish_mass_ln + ... -5.30974507
## 7                  crab_mass_sq  ~  sed_inside_prim + ...  0.43661200
## 8           grazermass_shoot_ln  ~  sed_inside_prim + ... -0.11978316
## 9                      crab_mass_sq  ~  Ntotal_site + ...  0.16803730
## 10              grazermass_shoot_ln  ~  Ntotal_site + ... -0.01499625
## 11                     crab_mass_sq  ~  light_avail + ...  2.69546218
## 12              grazermass_shoot_ln  ~  light_avail + ... -2.52498112
## 13                   abvgnd_mass_dt  ~  light_avail + ... -7.99080829
## 14       epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...  0.05190418
## 15                  abvgnd_mass_dt  ~  crab_mass_sq + ... -0.15007984
## 16           abvgnd_mass_dt  ~  grazermass_shoot_ln + ... -2.30272105
##      Std.Error DF  Crit.Value    P.Value 
## 1   0.51613758 18 -0.40072995 0.69333558 
## 2   0.59725179 15  0.34758456 0.73298143 
## 3  13.53026386 16  1.58697177 0.13208214 
## 4   0.16408139 18  0.36954047 0.71603657 
## 5   0.16478673 15  0.46269850 0.65022166 
## 6   3.99822628 16 -1.32802515 0.20280451 
## 7   0.72891632 17  0.59898782 0.55707956 
## 8   0.18179759 18 -0.65888202 0.51831209 
## 9   0.54237961 17  0.30981492 0.76046724 
## 10  0.15591439 18 -0.09618259 0.92443834 
## 11  4.99331025 17  0.53981468 0.59632580 
## 12  1.34576917 18 -1.87623640 0.07693422 
## 13 43.91917242 16 -0.18194351 0.85791218 
## 14  0.07963127 13  0.65180645 0.52588258 
## 15  1.75573746 14 -0.08547966 0.93309049 
## 16  7.09728822 15 -0.32445083 0.75007724
Fisher’s C

High p-value, indicating that the model is good.

##   Fisher.C df P.Value
## 1   21.781 32   0.913
Coefficients and R-sq
##                     Response                 Predictor Estimate Std.Error
## 1               crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410
## 2               crab_mass_sq              fish_mass_ln  -0.7238    0.5341
## 3        grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507
## 4  epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.3791    0.2485
## 5  epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2543    0.1640
## 6  epiphmass_shootmass_ln_dt               Ntotal_site   0.0986    0.1701
## 7  epiphmass_shootmass_ln_dt               light_avail   1.1102    1.7389
## 8             abvgnd_mass_dt epiphmass_shootmass_ln_dt  -4.9502    5.6590
## 9             abvgnd_mass_dt           sed_inside_prim  -6.1871    4.2630
## 10            abvgnd_mass_dt               Ntotal_site   3.4498    4.0386
##    DF Crit.Value P.Value Std.Estimate   
## 1  18    -3.6302  0.0019      -0.6315 **
## 2  18    -1.3551  0.1922      -0.2357   
## 3  19     1.0064  0.3269       0.2250   
## 4  16    -1.5256  0.1466      -0.3434   
## 5  16    -1.5511  0.1404      -0.3299   
## 6  16     0.5797  0.5702       0.1318   
## 7  16     0.6384  0.5322       0.1582   
## 8  17    -0.8748  0.3939      -0.2108   
## 9  17    -1.4513  0.1649      -0.3418   
## 10 17     0.8542  0.4049       0.1965
##                    Response   family     link method  R.squared
## 1              crab_mass_sq gaussian identity   none 0.45522906
## 2       grazermass_shoot_ln gaussian identity   none 0.05061209
## 3 epiphmass_shootmass_ln_dt gaussian identity   none 0.30797385
## 4            abvgnd_mass_dt gaussian identity   none 0.14304452
Full output
summary(sem.2, .progressBar = FALSE)
## 
## Structural Equation Model of sem.2 
## 
## Call:
##   crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln
##   grazermass_shoot_ln ~ crab_mass_sq
##   epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim + Ntotal_site + light_avail
##   abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + Ntotal_site
## 
##     AIC      BIC
##  57.781   76.582
## 
## ---
## Tests of directed separation:
## 
##                                           Independ.Claim Estimate Std.Error
##         grazermass_shoot_ln  ~  sea_otter_index_tr + ...  -0.2068    0.5161
##   epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...   0.2076    0.5973
##              abvgnd_mass_dt  ~  sea_otter_index_tr + ...  21.4721   13.5303
##               grazermass_shoot_ln  ~  fish_mass_ln + ...   0.0606    0.1641
##         epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...   0.0762    0.1648
##                    abvgnd_mass_dt  ~  fish_mass_ln + ...  -5.3097    3.9982
##                   crab_mass_sq  ~  sed_inside_prim + ...   0.4366    0.7289
##            grazermass_shoot_ln  ~  sed_inside_prim + ...  -0.1198    0.1818
##                       crab_mass_sq  ~  Ntotal_site + ...   0.1680    0.5424
##                grazermass_shoot_ln  ~  Ntotal_site + ...  -0.0150    0.1559
##                       crab_mass_sq  ~  light_avail + ...   2.6955    4.9933
##                grazermass_shoot_ln  ~  light_avail + ...  -2.5250    1.3458
##                     abvgnd_mass_dt  ~  light_avail + ...  -7.9908   43.9192
##         epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...   0.0519    0.0796
##                    abvgnd_mass_dt  ~  crab_mass_sq + ...  -0.1501    1.7557
##             abvgnd_mass_dt  ~  grazermass_shoot_ln + ...  -2.3027    7.0973
##   DF Crit.Value P.Value 
##   18    -0.4007  0.6933 
##   15     0.3476  0.7330 
##   16     1.5870  0.1321 
##   18     0.3695  0.7160 
##   15     0.4627  0.6502 
##   16    -1.3280  0.2028 
##   17     0.5990  0.5571 
##   18    -0.6589  0.5183 
##   17     0.3098  0.7605 
##   18    -0.0962  0.9244 
##   17     0.5398  0.5963 
##   18    -1.8762  0.0769 
##   16    -0.1819  0.8579 
##   13     0.6518  0.5259 
##   14    -0.0855  0.9331 
##   15    -0.3245  0.7501 
## 
## Global goodness-of-fit:
## 
##   Fisher's C = 21.781 with P-value = 0.913 and on 32 degrees of freedom
## 
## ---
## Coefficients:
## 
##                    Response                 Predictor Estimate Std.Error DF
##                crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410 18
##                crab_mass_sq              fish_mass_ln  -0.7238    0.5341 18
##         grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507 19
##   epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.3791    0.2485 16
##   epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2543    0.1640 16
##   epiphmass_shootmass_ln_dt               Ntotal_site   0.0986    0.1701 16
##   epiphmass_shootmass_ln_dt               light_avail   1.1102    1.7389 16
##              abvgnd_mass_dt epiphmass_shootmass_ln_dt  -4.9502    5.6590 17
##              abvgnd_mass_dt           sed_inside_prim  -6.1871    4.2630 17
##              abvgnd_mass_dt               Ntotal_site   3.4498    4.0386 17
##   Crit.Value P.Value Std.Estimate   
##      -3.6302  0.0019      -0.6315 **
##      -1.3551  0.1922      -0.2357   
##       1.0064  0.3269       0.2250   
##      -1.5256  0.1466      -0.3434   
##      -1.5511  0.1404      -0.3299   
##       0.5797  0.5702       0.1318   
##       0.6384  0.5322       0.1582   
##      -0.8748  0.3939      -0.2108   
##      -1.4513  0.1649      -0.3418   
##       0.8542  0.4049       0.1965   
## 
##   Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05
## 
## Individual R-squared:
## 
##                    Response method R.squared
##                crab_mass_sq   none      0.46
##         grazermass_shoot_ln   none      0.05
##   epiphmass_shootmass_ln_dt   none      0.31
##              abvgnd_mass_dt   none      0.14
Compare SEM 1 and SEM2

Looking at AIC and Fisher C values SEM 2 seems to be an improvement.

AIC(sem.1, sem.2)
##   df    AIC
## x 20 60.084
## y 18 57.781
fisherC(dsep.1)
##   Fisher.C df P.Value
## 1   20.084 28   0.861
fisherC(dsep.2)
##   Fisher.C df P.Value
## 1   21.781 32   0.913
SEM 3

Can we refine SEM 2? Given the restuls from the first SEM I will attempt to refine the model. Given that there was no indocation of d-sep I will focus on the specified paths. There are a few variables that have very little explanatory power. Epi - light, Epi - Ntotal and Abv mass - Ntotal.

sem.3 <- psem(
  lm(crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln, data = dat.redu),

  lm(grazermass_shoot_ln ~ crab_mass_sq, data = dat.redu),
  
  lm(epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim, data = dat.redu),
  
  lm(abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim, data = dat.redu)

)
Basis Set
d-seperation

No evidence of any d-separation

##                                            Independ.Claim    Estimate
## 1        grazermass_shoot_ln  ~  sea_otter_index_tr + ... -0.20683179
## 2  epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...  0.24623051
## 3             abvgnd_mass_dt  ~  sea_otter_index_tr + ... 22.84278669
## 4              grazermass_shoot_ln  ~  fish_mass_ln + ...  0.06063472
## 5        epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...  0.09089906
## 6                   abvgnd_mass_dt  ~  fish_mass_ln + ... -5.12105491
## 7                  crab_mass_sq  ~  sed_inside_prim + ...  0.43661200
## 8           grazermass_shoot_ln  ~  sed_inside_prim + ... -0.11978316
## 9        epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...  0.06201160
## 10                  abvgnd_mass_dt  ~  crab_mass_sq + ... -0.10196179
## 11           abvgnd_mass_dt  ~  grazermass_shoot_ln + ... -1.84540171
##      Std.Error DF  Crit.Value    P.Value 
## 1   0.51613758 18 -0.40072995 0.69333558 
## 2   0.56343465 17  0.43701699 0.66759957 
## 3  13.10502009 17  1.74305621 0.09938086 
## 4   0.16408139 18  0.36954047 0.71603657 
## 5   0.15972376 17  0.56910168 0.57672969 
## 6   3.97921636 17 -1.28695061 0.21535987 
## 7   0.72891632 17  0.59898782 0.55707956 
## 8   0.18179759 18 -0.65888202 0.51831209 
## 9   0.07482292 15  0.82877817 0.42022274 
## 10  1.72310100 15 -0.05917343 0.95359512 
## 11  6.99758765 16 -0.26371970 0.79536230
Fisher’s C

High p-value, indicating that the model is good.

##   Fisher.C df P.Value
## 1   15.769 22   0.827
Coefficients and R-sq
##                    Response                 Predictor Estimate Std.Error
## 1              crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410
## 2              crab_mass_sq              fish_mass_ln  -0.7238    0.5341
## 3       grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507
## 4 epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.4476    0.2247
## 5 epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2375    0.1570
## 6            abvgnd_mass_dt epiphmass_shootmass_ln_dt  -3.9084    5.4843
## 7            abvgnd_mass_dt           sed_inside_prim  -6.0569    4.2282
##   DF Crit.Value P.Value Std.Estimate   
## 1 18    -3.6302  0.0019      -0.6315 **
## 2 18    -1.3551  0.1922      -0.2357   
## 3 19     1.0064  0.3269       0.2250   
## 4 18    -1.9916  0.0618      -0.4055   
## 5 18    -1.5129  0.1477      -0.3080   
## 6 18    -0.7126  0.4852      -0.1665   
## 7 18    -1.4325  0.1691      -0.3346
##                    Response   family     link method  R.squared
## 1              crab_mass_sq gaussian identity   none 0.45522906
## 2       grazermass_shoot_ln gaussian identity   none 0.05061209
## 3 epiphmass_shootmass_ln_dt gaussian identity   none 0.25422995
## 4            abvgnd_mass_dt gaussian identity   none 0.10626371
Full output
summary(sem.3, .progressBar = FALSE)
## 
## Structural Equation Model of sem.3 
## 
## Call:
##   crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln
##   grazermass_shoot_ln ~ crab_mass_sq
##   epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim
##   abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim
## 
##     AIC      BIC
##  45.769   61.437
## 
## ---
## Tests of directed separation:
## 
##                                           Independ.Claim Estimate Std.Error
##         grazermass_shoot_ln  ~  sea_otter_index_tr + ...  -0.2068    0.5161
##   epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...   0.2462    0.5634
##              abvgnd_mass_dt  ~  sea_otter_index_tr + ...  22.8428   13.1050
##               grazermass_shoot_ln  ~  fish_mass_ln + ...   0.0606    0.1641
##         epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...   0.0909    0.1597
##                    abvgnd_mass_dt  ~  fish_mass_ln + ...  -5.1211    3.9792
##                   crab_mass_sq  ~  sed_inside_prim + ...   0.4366    0.7289
##            grazermass_shoot_ln  ~  sed_inside_prim + ...  -0.1198    0.1818
##         epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...   0.0620    0.0748
##                    abvgnd_mass_dt  ~  crab_mass_sq + ...  -0.1020    1.7231
##             abvgnd_mass_dt  ~  grazermass_shoot_ln + ...  -1.8454    6.9976
##   DF Crit.Value P.Value 
##   18    -0.4007  0.6933 
##   17     0.4370  0.6676 
##   17     1.7431  0.0994 
##   18     0.3695  0.7160 
##   17     0.5691  0.5767 
##   17    -1.2870  0.2154 
##   17     0.5990  0.5571 
##   18    -0.6589  0.5183 
##   15     0.8288  0.4202 
##   15    -0.0592  0.9536 
##   16    -0.2637  0.7954 
## 
## Global goodness-of-fit:
## 
##   Fisher's C = 15.769 with P-value = 0.827 and on 22 degrees of freedom
## 
## ---
## Coefficients:
## 
##                    Response                 Predictor Estimate Std.Error DF
##                crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410 18
##                crab_mass_sq              fish_mass_ln  -0.7238    0.5341 18
##         grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507 19
##   epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.4476    0.2247 18
##   epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2375    0.1570 18
##              abvgnd_mass_dt epiphmass_shootmass_ln_dt  -3.9084    5.4843 18
##              abvgnd_mass_dt           sed_inside_prim  -6.0569    4.2282 18
##   Crit.Value P.Value Std.Estimate   
##      -3.6302  0.0019      -0.6315 **
##      -1.3551  0.1922      -0.2357   
##       1.0064  0.3269       0.2250   
##      -1.9916  0.0618      -0.4055   
##      -1.5129  0.1477      -0.3080   
##      -0.7126  0.4852      -0.1665   
##      -1.4325  0.1691      -0.3346   
## 
##   Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05
## 
## Individual R-squared:
## 
##                    Response method R.squared
##                crab_mass_sq   none      0.46
##         grazermass_shoot_ln   none      0.05
##   epiphmass_shootmass_ln_dt   none      0.25
##              abvgnd_mass_dt   none      0.11
Compare SEM 2 and SEM 3

Pretty big drop in AIC and Fisher C is still pretty good. SEM 3 looks better. Now, there were no “significant” d-sep terms but the sea otter abv is 0.09, which is somewhat suggestive. So I will fit another model with that term and compare.

AIC(sem.2, sem.3)
##   df    AIC
## x 18 57.781
## y 15 45.769
fisherC(dsep.2)
##   Fisher.C df P.Value
## 1   21.781 32   0.913
fisherC(dsep.3)
##   Fisher.C df P.Value
## 1   15.769 22   0.827
SEM 3.2

add sea otter in abv mass equation.

sem.3.2 <- psem(
  lm(crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln, data = dat.redu),

  lm(grazermass_shoot_ln ~ crab_mass_sq, data = dat.redu),
  
  lm(epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim, data = dat.redu),
  
  lm(abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + sea_otter_index_tr, data = dat.redu)

)
Basis Set
d-seperation

No evidence of any d-separation

##                                            Independ.Claim    Estimate
## 1        grazermass_shoot_ln  ~  sea_otter_index_tr + ... -0.20683179
## 2  epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...  0.24623051
## 3             abvgnd_mass_dt  ~  sea_otter_index_tr + ... 22.84278669
## 4              grazermass_shoot_ln  ~  fish_mass_ln + ...  0.06063472
## 5        epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...  0.09089906
## 6                   abvgnd_mass_dt  ~  fish_mass_ln + ... -5.12105491
## 7                  crab_mass_sq  ~  sed_inside_prim + ...  0.43661200
## 8           grazermass_shoot_ln  ~  sed_inside_prim + ... -0.11978316
## 9        epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...  0.06201160
## 10                  abvgnd_mass_dt  ~  crab_mass_sq + ... -0.10196179
## 11           abvgnd_mass_dt  ~  grazermass_shoot_ln + ... -1.84540171
##      Std.Error DF  Crit.Value    P.Value 
## 1   0.51613758 18 -0.40072995 0.69333558 
## 2   0.56343465 17  0.43701699 0.66759957 
## 3  13.10502009 17  1.74305621 0.09938086 
## 4   0.16408139 18  0.36954047 0.71603657 
## 5   0.15972376 17  0.56910168 0.57672969 
## 6   3.97921636 17 -1.28695061 0.21535987 
## 7   0.72891632 17  0.59898782 0.55707956 
## 8   0.18179759 18 -0.65888202 0.51831209 
## 9   0.07482292 15  0.82877817 0.42022274 
## 10  1.72310100 15 -0.05917343 0.95359512 
## 11  6.99758765 16 -0.26371970 0.79536230
Fisher’s C

High p-value, indicating that the model is good.

##   Fisher.C df P.Value
## 1   11.132 20   0.943
Coefficients and R-sq
##                    Response                 Predictor Estimate Std.Error
## 1              crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410
## 2              crab_mass_sq              fish_mass_ln  -0.7238    0.5341
## 3       grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507
## 4 epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.4476    0.2247
## 5 epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2375    0.1570
## 6            abvgnd_mass_dt epiphmass_shootmass_ln_dt  -5.9471    5.3279
## 7            abvgnd_mass_dt           sed_inside_prim  -0.4837    5.1266
## 8            abvgnd_mass_dt        sea_otter_index_tr  22.8428   13.1050
##   DF Crit.Value P.Value Std.Estimate   
## 1 18    -3.6302  0.0019      -0.6315 **
## 2 18    -1.3551  0.1922      -0.2357   
## 3 19     1.0064  0.3269       0.2250   
## 4 18    -1.9916  0.0618      -0.4055   
## 5 18    -1.5129  0.1477      -0.3080   
## 6 17    -1.1162  0.2799      -0.2533   
## 7 17    -0.0944  0.9259      -0.0267   
## 8 17     1.7431  0.0994       0.5039
##                    Response   family     link method  R.squared
## 1              crab_mass_sq gaussian identity   none 0.45522906
## 2       grazermass_shoot_ln gaussian identity   none 0.05061209
## 3 epiphmass_shootmass_ln_dt gaussian identity   none 0.25422995
## 4            abvgnd_mass_dt gaussian identity   none 0.24177407
Full output
summary(sem.3.2, .progressBar = FALSE)
## 
## Structural Equation Model of sem.3.2 
## 
## Call:
##   crab_mass_sq ~ sea_otter_index_tr + fish_mass_ln
##   grazermass_shoot_ln ~ crab_mass_sq
##   epiphmass_shootmass_ln_dt ~ grazermass_shoot_ln + sed_inside_prim
##   abvgnd_mass_dt ~ epiphmass_shootmass_ln_dt + sed_inside_prim + sea_otter_index_tr
## 
##     AIC      BIC
##  43.132   59.844
## 
## ---
## Tests of directed separation:
## 
##                                           Independ.Claim Estimate Std.Error
##         grazermass_shoot_ln  ~  sea_otter_index_tr + ...  -0.2068    0.5161
##   epiphmass_shootmass_ln_dt  ~  sea_otter_index_tr + ...   0.2462    0.5634
##               grazermass_shoot_ln  ~  fish_mass_ln + ...   0.0606    0.1641
##         epiphmass_shootmass_ln_dt  ~  fish_mass_ln + ...   0.0909    0.1597
##                    abvgnd_mass_dt  ~  fish_mass_ln + ...  -5.1863    3.7395
##                   crab_mass_sq  ~  sed_inside_prim + ...   0.4366    0.7289
##            grazermass_shoot_ln  ~  sed_inside_prim + ...  -0.1198    0.1818
##         epiphmass_shootmass_ln_dt  ~  crab_mass_sq + ...   0.0620    0.0748
##                    abvgnd_mass_dt  ~  crab_mass_sq + ...  -0.1020    1.7231
##             abvgnd_mass_dt  ~  grazermass_shoot_ln + ...  -0.5367    6.7318
##   DF Crit.Value P.Value 
##   18    -0.4007  0.6933 
##   17     0.4370  0.6676 
##   18     0.3695  0.7160 
##   17     0.5691  0.5767 
##   16    -1.3869  0.1845 
##   17     0.5990  0.5571 
##   18    -0.6589  0.5183 
##   15     0.8288  0.4202 
##   15    -0.0592  0.9536 
##   15    -0.0797  0.9375 
## 
## Global goodness-of-fit:
## 
##   Fisher's C = 11.132 with P-value = 0.943 and on 20 degrees of freedom
## 
## ---
## Coefficients:
## 
##                    Response                 Predictor Estimate Std.Error DF
##                crab_mass_sq        sea_otter_index_tr  -4.8681    1.3410 18
##                crab_mass_sq              fish_mass_ln  -0.7238    0.5341 18
##         grazermass_shoot_ln              crab_mass_sq   0.0510    0.0507 19
##   epiphmass_shootmass_ln_dt       grazermass_shoot_ln  -0.4476    0.2247 18
##   epiphmass_shootmass_ln_dt           sed_inside_prim  -0.2375    0.1570 18
##              abvgnd_mass_dt epiphmass_shootmass_ln_dt  -5.9471    5.3279 17
##              abvgnd_mass_dt           sed_inside_prim  -0.4837    5.1266 17
##              abvgnd_mass_dt        sea_otter_index_tr  22.8428   13.1050 17
##   Crit.Value P.Value Std.Estimate   
##      -3.6302  0.0019      -0.6315 **
##      -1.3551  0.1922      -0.2357   
##       1.0064  0.3269       0.2250   
##      -1.9916  0.0618      -0.4055   
##      -1.5129  0.1477      -0.3080   
##      -1.1162  0.2799      -0.2533   
##      -0.0944  0.9259      -0.0267   
##       1.7431  0.0994       0.5039   
## 
##   Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05
## 
## Individual R-squared:
## 
##                    Response method R.squared
##                crab_mass_sq   none      0.46
##         grazermass_shoot_ln   none      0.05
##   epiphmass_shootmass_ln_dt   none      0.25
##              abvgnd_mass_dt   none      0.24
Compare SEM 3 to SEM 3.2
AIC(sem.3, sem.3.2)
##   df    AIC
## x 15 45.769
## y 16 43.132
fisherC(dsep.3)
##   Fisher.C df P.Value
## 1   15.769 22   0.827
fisherC(dsep.3.2)
##   Fisher.C df P.Value
## 1   11.132 20   0.943