What’s new since last meeting (focused on research questions 1 and 2 (listed below) so these modifications only apply to those):

-month.yr is now a date factor. Since month-year is not a format recognized by R I added “01” as the date for all of them. This should be ok since we’re more interested in month and year than date anyway. I like that it’s a date vs a character now
-Research question 1: Site is fixed factor in all lm
-Research question 1:tried month-year as fixed and random. When it’s random I added an interaction term between them
-Research question 2: tried season as fixed factor and site as a random factor (to account for the fact they spatially aggregated) to see if they are all responding in the same way over time
-Research question 2: keeping season as time factor for now but can also try it as month-yr
-Research question 2: looked at model without interaction term as well

Things to consider:
-fixed vs random sites. Doesn’t have to be apriori. Are the sites different? or are they spatial blocks?

Note for self (sing I keep forgetting): fixed factor use factor(x/factor of interest), for random factor just list column. For example, in lm(cover ~ factor(site) + month.yr, data =all), site is fized and month.yr is random

Questions for analysis:

ABUNDANCE (site only, no time)
1. Is there a difference in Fucus abundance between sites?
1.1 Is there a difference in Fucus percent cover amoung sites?
1.2 Is there a difference in Fucus total density amoung sites?
notes: include sampling date as random factor? Samples independent of each other? Time fixed or random? Find best fit (Gaussain, Poisson (density), normal). Percent cover as a proporation (i.e. 50% = 0.5)

-Site is the main factor. Sample month-year is a random factor but try both. Site is definitely a fixed factor.
-when site and time are fixed, add an interaction term to assess model fit.

ABUNDANCE (site and time)
2. Is there a difference in Fucus abundance between site and time? (site:time)
2.1 Is there a difference in Fucus percent cover between site and time?
2.2 Is there a difference in Fucus total density between site and time?
notes: Find best fit (Gaussain, Poisson (density), normal). Seasonality time by quadrat. Percent cover as a proporation (i.e. 50% = 0.5)

-Seasonaly: time as fixed factor, site as a random factor (to account for the fact they spatially aggregated). –> are they all responding in the same way over time?

REPRODUCTIVE PHENOLOGY (with seasonality)
3. Is reproduction affected by the season? 3.1 Is oogonia/receptacle affected by the season?
3.2 Is oogonia/thalli affected by the season?
3.3 Is conceptical/thalli affected by the season?
3.4 Is percent reproductive tissue affected by the season?
3.5 Is adult density affected by the season?
3.6 Is juvenile density affected by the season?

REPRODUCTIVE PHENOLOGY (without seasonality)
4. Is reproductive phenology affected by environmental conditions (salinity, pH, water temperature and air temperature)? (not sure which metric of each variable I should be using? mean? daily min?) For now I’m just using mean between survey dates which is a good starting point while I’m figuring out the code.
4.1 Is oogoina/receptical affected by environmental conditions (salinity, pH, water temperature and air temperature)?
4.2 Is oogonia/thalli affected by environmental conditions (salinity, pH, water temperature and air temperature)?
4.3 Is conceptacle/thalli affected by environmental conditions (salinity, pH, water temperature and air temperature)?
4.4 Is percent reproductive tissue affected by environmental conditions (salinity, pH, water temperature and air temperature)?
4.5 Is juvenile density affected by environmental conditions (salinity, pH, water temperature and air temperature)?
4.6 Is adult density affected by environmental conditions (salinity, pH, water temperature and air temperature)?
notes: site and time as random factors. x ~ salintiy + ph + water temp + air temp + site(random) + time(random). In AIC ranking, do a model for every combination.

Additional inquires:
-timing of oogonia/thalli -> juvenile abundance

Notes:
-Time: month + year or season +year or season:year –> I don’t think I’m doing this correctly right now. I have a season year column and a month year column. I think it accomplishes the same thing but I should probably have these columns all separate and then add an iteraction term. So far season shows more of an effect than month so I’ll be using season-year for all “time” factors" in this markdown (at least for now).

Initial interpretation of results:
1. Is there a difference in Fucus abundance between sites?
Looks like there is possibly a difference in Fucus cover and density between sites with P ~= 0.06 - 0.07
2. Is there a difference in Fucus abundance between site and time? (site:time)
There is a difference in Fucus cover P <.001 and density between site and time
3. Is reproduction affected by the season?
Only number of large thalli and number of small thalli are affected by season. Other reproductive measures didn’t show significance
4. Is reproductive phenology affected by environmental conditions (salinity, pH, water temperature and air temperature)? Water temperature affects oogonia per receptical
Water temperature and salinity affects the number of small thalli per quadrat

Set up

rm(list=ls())

library(tidyverse)
library(ggpubr)
library(scales)
library(chron)
library(plotly)
library(taRifx)
library(aweek)
library(easypackages)
library(renv)
library(here)
library(ggthemes)
library(gridExtra)
library(patchwork)
library(tidyquant)
library(recipes) 
library(cranlogs)
library(knitr)
library(openair)

#new
library(AICcmodavg)
library(plm) #for random factors
library(lme4)

Read in data

#read in data
all<-read.csv(
      "https://raw.githubusercontent.com/Cmwegener/thesis/master/data/environment_field/envi.field.all.csv",
    header = TRUE
  )

Make month year column. Was originally going to do just month but since I have some duplicate months I decided to do month-year. NOTE: since you need a day to convert to date format, I added the same date to all of them so that the only difference is the month-year which is what we’re really interested in anyway

all$date<-as.Date(all$date, format = c("%Y-%m-%d")) 

all$month.yr<-format(all$date, "%Y-%m") #can't convert month-year format as date so it's character, I'm going to assign them all the same date then so that it can be converted to a date

all$day<-"-01" #assigning place holder "day"
all$month.yr<-paste(all$month.yr,all$day, sep="")#merging with month.yr column 
all$month.yr<-as.Date(all$month.yr, format=c("%Y-%m-%d")) #format as date

all<-subset(all, select = -c(day) ) #remove unneeded day column

#probably a much cleaner way to do this but this works

Season column. Split year into quarters. Added year since there’s some duplicate months? Since it’s a character I’ll need to list all the month.yr per season.
2018-06 - 2018-08 summer.2018
2018-09 - 2018-11 fall.2018
2018-12 - 2019-02 winter.2018
2019-03 - 2019-05 spring.2019
2019-06 - 2019-08 summer.2019
2019-09 - 2019-11 fall.2019 incomplete season, only have field data for 2019-09 –> Think I should probably remove this term and put “NA” since I only have field data for that month. Doesn’t seem right to compare it to the other seasons with more months and data.

all$season[all$month.yr == "2018-06-01"] <- "summer.2018"
all$season[all$month.yr == "2018-07-01"] <- "summer.2018"
all$season[all$month.yr == "2018-08-01"] <- "summer.2018"

all$season[all$month.yr == "2018-09-01"] <- "fall.2018"
all$season[all$month.yr == "2018-10-01"] <- "fall.2018"
all$season[all$month.yr == "2018-11-01"] <- "fall.2018"

all$season[all$month.yr == "2018-12-01"] <- "winter.2018"
all$season[all$month.yr == "2019-01-01"] <- "winter.2018"
all$season[all$month.yr == "2019-02-01"] <- "winter.2018"

all$season[all$month.yr == "2019-03-01"] <- "spring.2019"
all$season[all$month.yr == "2019-04-01"] <- "spring.2019"
all$season[all$month.yr == "2019-05-01"] <- "spring.2019"

all$season[all$month.yr == "2019-06-01"] <- "summer.2019"
all$season[all$month.yr == "2019-07-01"] <- "summer.2019"
all$season[all$month.yr == "2019-08-01"] <- "summer.2019"

all$season[all$month.yr == "2019-09-01"] <- "fall.2019"

Converting percent cover as a proporation (i.e. 50% = 0.5) to make it easier to interpret

all$cover<-all$cover/100

####ABUNDANCE (site only, no time)####
1. Is there a difference in Fucus abundance between sites?
1.1 Is there a difference in Fucus percent cover amoung sites?
1.2 Is there a difference in Fucus total density amoung sites?
notes: include sampling date as random factor? Samples independent of each other? Time fixed or random? Percent cover as a proporation (i.e. 50% = 0.5).
Looking at site as fixed and random

Notes from most recent meeting:
-Site is the main factor. Sample month-year is a random factor but try both. Site is definitely a fixed factor.
-when site and time are fixed, add an interaction term to assess model fit.

####1.1 Is there a difference in Fucus percent cover amoung sites?####
percent cover ~ Site as fixed factor + month-year as random

lm1.1 <- lm(cover ~ factor(site) + month.yr, data =all)  
lm1.1
## 
## Call:
## lm(formula = cover ~ factor(site) + month.yr, data = all)
## 
## Coefficients:
##        (Intercept)   factor(site)hs.fp  factor(site)nd.eos   factor(site)pc.cc  
##          8.8468653          -0.1084375          -0.0878202          -0.0114250  
##           month.yr  
##         -0.0004728
summary (lm1.1)
## 
## Call:
## lm(formula = cover ~ factor(site) + month.yr, data = all)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.23229 -0.07419  0.01286  0.08046  0.21931 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         8.8468653  1.8386227   4.812 1.17e-05 ***
## factor(site)hs.fp  -0.1084375  0.0402736  -2.693  0.00934 ** 
## factor(site)nd.eos -0.0878202  0.0409426  -2.145  0.03631 *  
## factor(site)pc.cc  -0.0114250  0.0417085  -0.274  0.78515    
## month.yr           -0.0004728  0.0001026  -4.606 2.41e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1139 on 56 degrees of freedom
## Multiple R-squared:  0.3593, Adjusted R-squared:  0.3136 
## F-statistic: 7.853 on 4 and 56 DF,  p-value: 4.259e-05
anova (lm1.1)
## Analysis of Variance Table
## 
## Response: cover
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## factor(site)  3 0.13228 0.044095  3.3983  0.02389 *  
## month.yr      1 0.27529 0.275291 21.2159 2.41e-05 ***
## Residuals    56 0.72664 0.012976                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm1.1)

both factors look significant, and model fit looks good enough

percent cover ~ Site as fixed factor + month-year as fixed factor + interaction term

lm1.1 <- lm(cover ~ factor(site) + factor(month.yr) + site:month.yr, data =all) 
lm1.1
## 
## Call:
## lm(formula = cover ~ factor(site) + factor(month.yr) + site:month.yr, 
##     data = all)
## 
## Coefficients:
##                (Intercept)           factor(site)hs.fp  
##                  5.040e-01                  -1.471e+01  
##         factor(site)nd.eos           factor(site)pc.cc  
##                 -3.604e+00                  -7.976e-02  
## factor(month.yr)2018-07-01  factor(month.yr)2018-08-01  
##                  2.176e-02                   5.427e-02  
## factor(month.yr)2018-09-01  factor(month.yr)2018-10-01  
##                  8.879e-02                   7.847e-02  
## factor(month.yr)2018-11-01  factor(month.yr)2018-12-01  
##                  8.808e-02                   1.382e-02  
## factor(month.yr)2019-01-01  factor(month.yr)2019-02-01  
##                  1.658e-02                  -2.565e-02  
## factor(month.yr)2019-03-01  factor(month.yr)2019-04-01  
##                 -1.439e-02                  -3.013e-02  
## factor(month.yr)2019-05-01  factor(month.yr)2019-06-01  
##                  6.132e-03                  -1.706e-01  
## factor(month.yr)2019-07-01  factor(month.yr)2019-08-01  
##                 -2.773e-01                  -2.866e-01  
## factor(month.yr)2019-09-01          siteby.rb:month.yr  
##                 -2.746e-01                  -4.491e-06  
##         sitehs.fp:month.yr         sitend.eos:month.yr  
##                  8.108e-04                   1.921e-04  
##         sitepc.cc:month.yr  
##                         NA
summary (lm1.1)
## 
## Call:
## lm(formula = cover ~ factor(site) + factor(month.yr) + site:month.yr, 
##     data = all)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.146970 -0.048865 -0.005254  0.054135  0.116080 
## 
## Coefficients: (1 not defined because of singularities)
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.040e-01  3.774e+00   0.134 0.894450    
## factor(site)hs.fp          -1.471e+01  3.714e+00  -3.961 0.000308 ***
## factor(site)nd.eos         -3.604e+00  3.742e+00  -0.963 0.341508    
## factor(site)pc.cc          -7.976e-02  3.800e+00  -0.021 0.983360    
## factor(month.yr)2018-07-01  2.176e-02  5.826e-02   0.374 0.710771    
## factor(month.yr)2018-08-01  5.427e-02  5.867e-02   0.925 0.360644    
## factor(month.yr)2018-09-01  8.879e-02  5.936e-02   1.496 0.142799    
## factor(month.yr)2018-10-01  7.847e-02  6.402e-02   1.226 0.227650    
## factor(month.yr)2018-11-01  8.808e-02  7.395e-02   1.191 0.240827    
## factor(month.yr)2018-12-01  1.382e-02  6.288e-02   0.220 0.827159    
## factor(month.yr)2019-01-01  1.658e-02  6.454e-02   0.257 0.798557    
## factor(month.yr)2019-02-01 -2.565e-02  6.641e-02  -0.386 0.701383    
## factor(month.yr)2019-03-01 -1.439e-02  6.826e-02  -0.211 0.834111    
## factor(month.yr)2019-04-01 -3.013e-02  7.047e-02  -0.428 0.671352    
## factor(month.yr)2019-05-01  6.132e-03  7.277e-02   0.084 0.933272    
## factor(month.yr)2019-06-01 -1.706e-01  7.529e-02  -2.266 0.029072 *  
## factor(month.yr)2019-07-01 -2.773e-01  7.784e-02  -3.563 0.000987 ***
## factor(month.yr)2019-08-01 -2.866e-01  8.060e-02  -3.555 0.001008 ** 
## factor(month.yr)2019-09-01 -2.746e-01  8.347e-02  -3.289 0.002134 ** 
## siteby.rb:month.yr         -4.491e-06  2.120e-04  -0.021 0.983208    
## sitehs.fp:month.yr          8.108e-04  2.120e-04   3.824 0.000462 ***
## sitend.eos:month.yr         1.921e-04  2.125e-04   0.904 0.371560    
## sitepc.cc:month.yr                 NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0822 on 39 degrees of freedom
## Multiple R-squared:  0.7677, Adjusted R-squared:  0.6425 
## F-statistic: 6.136 on 21 and 39 DF,  p-value: 5.918e-07
anova (lm1.1)
## Analysis of Variance Table
## 
## Response: cover
##                  Df  Sum Sq  Mean Sq F value    Pr(>F)    
## factor(site)      3 0.13228 0.044095  6.5255 0.0011031 ** 
## factor(month.yr) 15 0.60030 0.040020  5.9225 3.821e-06 ***
## site:month.yr     3 0.13810 0.046033  6.8124 0.0008404 ***
## Residuals        39 0.26353 0.006757                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm1.1)

Both significant, not sure about Residuals vs Leverage plot

####1.2 Is there a difference in Fucus total density amoung sites?###
density ~ site as fixed factor + month-year as random

lm1.2 <- lm(no.fuc.q ~ factor(site) + month.yr, data =all)  
lm1.2
## 
## Call:
## lm(formula = no.fuc.q ~ factor(site) + month.yr, data = all)
## 
## Coefficients:
##        (Intercept)   factor(site)hs.fp  factor(site)nd.eos   factor(site)pc.cc  
##          2245.5084            -30.3625             -9.0141             -2.9728  
##           month.yr  
##            -0.1227
summary (lm1.2)
## 
## Call:
## lm(formula = no.fuc.q ~ factor(site) + month.yr, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -43.583 -19.693  -4.829  13.943  97.399 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        2245.5084   454.9479   4.936 7.54e-06 ***
## factor(site)hs.fp   -30.3625     9.9653  -3.047  0.00352 ** 
## factor(site)nd.eos   -9.0141    10.1308  -0.890  0.37740    
## factor(site)pc.cc    -2.9728    10.3203  -0.288  0.77437    
## month.yr             -0.1227     0.0254  -4.830 1.10e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 28.19 on 56 degrees of freedom
## Multiple R-squared:  0.3782, Adjusted R-squared:  0.3338 
## F-statistic: 8.517 on 4 and 56 DF,  p-value: 1.93e-05
anova (lm1.2)
## Analysis of Variance Table
## 
## Response: no.fuc.q
##              Df Sum Sq Mean Sq F value    Pr(>F)    
## factor(site)  3   8534  2844.5  3.5805   0.01933 *  
## month.yr      1  18531 18530.9 23.3253 1.099e-05 ***
## Residuals    56  44490   794.5                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm1.2)

Both factors significant, plots looks good but not sure about Residuals vs Leverage plot

density ~ site as fixed factor + month.yr as fixed factor + interaction term

lm1.2 <- lm(no.fuc.q ~ factor(site) + factor(month.yr) + site:month.yr, data =all) 
lm1.2
## 
## Call:
## lm(formula = no.fuc.q ~ factor(site) + factor(month.yr) + site:month.yr, 
##     data = all)
## 
## Coefficients:
##                (Intercept)           factor(site)hs.fp  
##                 -1.420e+03                  -1.807e+03  
##         factor(site)nd.eos           factor(site)pc.cc  
##                  4.902e+02                   1.481e+03  
## factor(month.yr)2018-07-01  factor(month.yr)2018-08-01  
##                  4.568e+01                   6.612e+01  
## factor(month.yr)2018-09-01  factor(month.yr)2018-10-01  
##                  3.494e+01                  -7.665e-01  
## factor(month.yr)2018-11-01  factor(month.yr)2018-12-01  
##                 -1.631e+01                  -2.769e+01  
## factor(month.yr)2019-01-01  factor(month.yr)2019-02-01  
##                 -2.959e+01                  -3.357e+01  
## factor(month.yr)2019-03-01  factor(month.yr)2019-04-01  
##                 -3.756e+01                  -3.801e+01  
## factor(month.yr)2019-05-01  factor(month.yr)2019-06-01  
##                 -3.309e+01                  -5.189e+01  
## factor(month.yr)2019-07-01  factor(month.yr)2019-08-01  
##                 -3.937e+01                  -4.147e+01  
## factor(month.yr)2019-09-01          siteby.rb:month.yr  
##                 -4.763e+01                   8.288e-02  
##         sitehs.fp:month.yr         sitend.eos:month.yr  
##                  1.821e-01                   5.495e-02  
##         sitepc.cc:month.yr  
##                         NA
summary (lm1.2)
## 
## Call:
## lm(formula = no.fuc.q ~ factor(site) + factor(month.yr) + site:month.yr, 
##     data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -43.963 -10.954  -1.371   9.329  36.748 
## 
## Coefficients: (1 not defined because of singularities)
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                -1.420e+03  8.785e+02  -1.617 0.113995    
## factor(site)hs.fp          -1.807e+03  8.646e+02  -2.090 0.043157 *  
## factor(site)nd.eos          4.902e+02  8.712e+02   0.563 0.576835    
## factor(site)pc.cc           1.481e+03  8.845e+02   1.674 0.102080    
## factor(month.yr)2018-07-01  4.568e+01  1.356e+01   3.368 0.001714 ** 
## factor(month.yr)2018-08-01  6.612e+01  1.366e+01   4.841 2.07e-05 ***
## factor(month.yr)2018-09-01  3.494e+01  1.382e+01   2.529 0.015612 *  
## factor(month.yr)2018-10-01 -7.665e-01  1.490e+01  -0.051 0.959239    
## factor(month.yr)2018-11-01 -1.631e+01  1.722e+01  -0.948 0.349130    
## factor(month.yr)2018-12-01 -2.769e+01  1.464e+01  -1.891 0.066013 .  
## factor(month.yr)2019-01-01 -2.959e+01  1.502e+01  -1.970 0.056025 .  
## factor(month.yr)2019-02-01 -3.357e+01  1.546e+01  -2.172 0.036033 *  
## factor(month.yr)2019-03-01 -3.756e+01  1.589e+01  -2.364 0.023168 *  
## factor(month.yr)2019-04-01 -3.801e+01  1.641e+01  -2.317 0.025836 *  
## factor(month.yr)2019-05-01 -3.309e+01  1.694e+01  -1.953 0.057989 .  
## factor(month.yr)2019-06-01 -5.189e+01  1.753e+01  -2.961 0.005197 ** 
## factor(month.yr)2019-07-01 -3.937e+01  1.812e+01  -2.172 0.035962 *  
## factor(month.yr)2019-08-01 -4.147e+01  1.876e+01  -2.210 0.033026 *  
## factor(month.yr)2019-09-01 -4.763e+01  1.943e+01  -2.451 0.018830 *  
## siteby.rb:month.yr          8.288e-02  4.936e-02   1.679 0.101108    
## sitehs.fp:month.yr          1.821e-01  4.936e-02   3.689 0.000685 ***
## sitend.eos:month.yr         5.495e-02  4.947e-02   1.111 0.273467    
## sitepc.cc:month.yr                 NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.14 on 39 degrees of freedom
## Multiple R-squared:  0.8004, Adjusted R-squared:  0.693 
## F-statistic: 7.448 on 21 and 39 DF,  p-value: 4.419e-08
anova (lm1.2)
## Analysis of Variance Table
## 
## Response: no.fuc.q
##                  Df Sum Sq Mean Sq F value    Pr(>F)    
## factor(site)      3   8534 2844.51  7.7683 0.0003479 ***
## factor(month.yr) 15  43443 2896.17  7.9094 1.038e-07 ***
## site:month.yr     3   5297 1765.78  4.8223 0.0059722 ** 
## Residuals        39  14281  366.17                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm1.2)

Got warning: “ANOVA F-tests on an essentially perfect fit are unreliable” need to look into more and couldn’t get plot. Might have to do with site and month.yr being character?

####ABUNDANCE (site and time)####
2. Is there a difference in Fucus abundance between site and time? (site:time)
2.1 Is there a difference in Fucus percent cover between site and time?
2.2 Is there a difference in Fucus total density between site and time?
notes:Find best fit (Gaussain, Poisson (density), normal). Seasonality time by quadrat. Percent cover as a proporation (i.e. 50% = 0.5)

From last meeting: Seasonaly: time as fixed factor, site as a random factor (to account for the fact they spatially aggregated). –> are they all responding in the same way over time?

####2.1 Is there a difference in Fucus percent cover between site and time?####
cover ~ site as random factor + season as fixed factor

lm2.1 <- lm(cover ~ site + factor(season), data =all)  
lm2.1
## 
## Call:
## lm(formula = cover ~ site + factor(season), data = all)
## 
## Coefficients:
##               (Intercept)                  sitehs.fp  
##                  0.475838                  -0.108437  
##                sitend.eos                  sitepc.cc  
##                 -0.083744                  -0.003737  
##   factor(season)fall.2019  factor(season)spring.2019  
##                 -0.268358                  -0.044858  
## factor(season)summer.2018  factor(season)summer.2019  
##                 -0.074941                  -0.254024  
## factor(season)winter.2018  
##                 -0.052858
summary (lm2.1)
## 
## Call:
## lm(formula = cover ~ site + factor(season), data = all)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.15554 -0.06346  0.00102  0.06246  0.13916 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                0.475838   0.035849  13.274  < 2e-16 ***
## sitehs.fp                 -0.108437   0.032715  -3.315  0.00168 ** 
## sitend.eos                -0.083744   0.033306  -2.514  0.01506 *  
## sitepc.cc                 -0.003737   0.034089  -0.110  0.91312    
## factor(season)fall.2019   -0.268358   0.055785  -4.811 1.33e-05 ***
## factor(season)spring.2019 -0.044858   0.041048  -1.093  0.27951    
## factor(season)summer.2018 -0.074941   0.041048  -1.826  0.07364 .  
## factor(season)summer.2019 -0.254024   0.041048  -6.188 9.69e-08 ***
## factor(season)winter.2018 -0.052858   0.041048  -1.288  0.20355    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.09253 on 52 degrees of freedom
## Multiple R-squared:  0.6074, Adjusted R-squared:  0.5471 
## F-statistic: 10.06 on 8 and 52 DF,  p-value: 2.433e-08
anova (lm2.1)
## Analysis of Variance Table
## 
## Response: cover
##                Df  Sum Sq  Mean Sq F value    Pr(>F)    
## site            3 0.13228 0.044095  5.1499  0.003417 ** 
## factor(season)  5 0.55669 0.111338 13.0032 3.216e-08 ***
## Residuals      52 0.44524 0.008562                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm2.1)

Both significant, plots look good except not sure about the residual vs leverage one

cover ~ site as random factor + season as fixed factor + interaction term

lm2.1 <- lm(cover ~ site + season + site:season, data =all)  
lm2.1
## 
## Call:
## lm(formula = cover ~ site + season + site:season, data = all)
## 
## Coefficients:
##                  (Intercept)                     sitehs.fp  
##                     0.538000                     -0.251667  
##                   sitend.eos                     sitepc.cc  
##                    -0.172500                      0.044000  
##              seasonfall.2019             seasonspring.2019  
##                    -0.397000                     -0.083333  
##            seasonsummer.2018             seasonsummer.2019  
##                    -0.135000                     -0.408667  
##            seasonwinter.2018     sitehs.fp:seasonfall.2019  
##                    -0.088333                      0.268667  
##   sitend.eos:seasonfall.2019     sitepc.cc:seasonfall.2019  
##                     0.201500                     -0.020000  
##  sitehs.fp:seasonspring.2019  sitend.eos:seasonspring.2019  
##                     0.197000                      0.004833  
##  sitepc.cc:seasonspring.2019   sitehs.fp:seasonsummer.2018  
##                    -0.112333                      0.059333  
## sitend.eos:seasonsummer.2018   sitepc.cc:seasonsummer.2018  
##                     0.167167                     -0.050667  
##  sitehs.fp:seasonsummer.2019  sitend.eos:seasonsummer.2019  
##                     0.361667                      0.221833  
##  sitepc.cc:seasonsummer.2019   sitehs.fp:seasonwinter.2018  
##                    -0.029333                      0.056333  
## sitend.eos:seasonwinter.2018   sitepc.cc:seasonwinter.2018  
##                     0.003500                      0.017667
summary (lm2.1)
## 
## Call:
## lm(formula = cover ~ site + season + site:season, data = all)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.105000 -0.026667 -0.004333  0.018333  0.137667 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   0.538000   0.039178  13.732 4.24e-16 ***
## sitehs.fp                    -0.251667   0.055407  -4.542 5.75e-05 ***
## sitend.eos                   -0.172500   0.061946  -2.785   0.0084 ** 
## sitepc.cc                     0.044000   0.078357   0.562   0.5778    
## seasonfall.2019              -0.397000   0.078357  -5.067 1.15e-05 ***
## seasonspring.2019            -0.083333   0.055407  -1.504   0.1411    
## seasonsummer.2018            -0.135000   0.055407  -2.437   0.0198 *  
## seasonsummer.2019            -0.408667   0.055407  -7.376 9.00e-09 ***
## seasonwinter.2018            -0.088333   0.055407  -1.594   0.1194    
## sitehs.fp:seasonfall.2019     0.268667   0.110813   2.424   0.0203 *  
## sitend.eos:seasonfall.2019    0.201500   0.114224   1.764   0.0860 .  
## sitepc.cc:seasonfall.2019    -0.020000   0.123893  -0.161   0.8726    
## sitehs.fp:seasonspring.2019   0.197000   0.078357   2.514   0.0164 *  
## sitend.eos:seasonspring.2019  0.004833   0.083110   0.058   0.9539    
## sitepc.cc:seasonspring.2019  -0.112333   0.095967  -1.171   0.2493    
## sitehs.fp:seasonsummer.2018   0.059333   0.078357   0.757   0.4537    
## sitend.eos:seasonsummer.2018  0.167167   0.083110   2.011   0.0516 .  
## sitepc.cc:seasonsummer.2018  -0.050667   0.095967  -0.528   0.6007    
## sitehs.fp:seasonsummer.2019   0.361667   0.078357   4.616 4.59e-05 ***
## sitend.eos:seasonsummer.2019  0.221833   0.083110   2.669   0.0112 *  
## sitepc.cc:seasonsummer.2019  -0.029333   0.095967  -0.306   0.7616    
## sitehs.fp:seasonwinter.2018   0.056333   0.078357   0.719   0.4767    
## sitend.eos:seasonwinter.2018  0.003500   0.083110   0.042   0.9666    
## sitepc.cc:seasonwinter.2018   0.017667   0.095967   0.184   0.8549    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.06786 on 37 degrees of freedom
## Multiple R-squared:  0.8498, Adjusted R-squared:  0.7564 
## F-statistic:   9.1 on 23 and 37 DF,  p-value: 3.148e-09
anova (lm2.1)
## Analysis of Variance Table
## 
## Response: cover
##             Df  Sum Sq  Mean Sq F value    Pr(>F)    
## site         3 0.13228 0.044095  9.5758 8.168e-05 ***
## season       5 0.55669 0.111338 24.1784 9.952e-11 ***
## site:season 15 0.27486 0.018324  3.9793 0.0003102 ***
## Residuals   37 0.17038 0.004605                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm2.1)
## Warning: not plotting observations with leverage one:
##   4, 14, 29, 45, 61

All significant, more significance than previous model, plots look good except again I’m not sure about the residual vs leverage one

####2.2 Is there a difference in Fucus total density between site and time?####
density ~ site as random factor + season as fixed factor

lm2.2 <- lm(no.fuc.q ~ site + factor(season), data =all)  
lm2.2
## 
## Call:
## lm(formula = no.fuc.q ~ site + factor(season), data = all)
## 
## Coefficients:
##               (Intercept)                  sitehs.fp  
##                    64.533                    -30.363  
##                sitend.eos                  sitepc.cc  
##                    -8.564                     -2.281  
##   factor(season)fall.2019  factor(season)spring.2019  
##                   -30.356                    -31.214  
## factor(season)summer.2018  factor(season)summer.2019  
##                    20.411                    -31.906  
## factor(season)winter.2018  
##                   -32.448
summary (lm2.2)
## 
## Call:
## lm(formula = no.fuc.q ~ site + factor(season), data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.663 -15.219  -4.604  13.946  80.837 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 64.533     10.053   6.419 4.16e-08 ***
## sitehs.fp                  -30.363      9.174  -3.310  0.00170 ** 
## sitend.eos                  -8.564      9.340  -0.917  0.36338    
## sitepc.cc                   -2.281      9.559  -0.239  0.81234    
## factor(season)fall.2019    -30.356     15.643  -1.941  0.05775 .  
## factor(season)spring.2019  -31.214     11.511  -2.712  0.00905 ** 
## factor(season)summer.2018   20.411     11.511   1.773  0.08205 .  
## factor(season)summer.2019  -31.906     11.511  -2.772  0.00772 ** 
## factor(season)winter.2018  -32.448     11.511  -2.819  0.00680 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 25.95 on 52 degrees of freedom
## Multiple R-squared:  0.5107, Adjusted R-squared:  0.4354 
## F-statistic: 6.784 on 8 and 52 DF,  p-value: 4.606e-06
anova (lm2.2)
## Analysis of Variance Table
## 
## Response: no.fuc.q
##                Df Sum Sq Mean Sq F value    Pr(>F)    
## site            3   8534  2844.5  4.2247  0.009534 ** 
## factor(season)  5  28008  5601.6  8.3195 7.835e-06 ***
## Residuals      52  35012   673.3                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm2.2)

Significant, plots look good, not sure about residual vs leverage TO DO: look into other fits

site as random factor + season as fixed factor + interaction term

lm2.2 <- lm(no.fuc.q ~ site + factor(season) + site:season, data =all)  
lm2.2
## 
## Call:
## lm(formula = no.fuc.q ~ site + factor(season) + site:season, 
##     data = all)
## 
## Coefficients:
##                  (Intercept)                     sitehs.fp  
##                       61.833                       -43.767  
##                   sitend.eos                     sitepc.cc  
##                       -6.933                        58.967  
##      factor(season)fall.2019     factor(season)spring.2019  
##                     -105.700                      -103.000  
##    factor(season)summer.2018     factor(season)summer.2019  
##                      -26.233                      -102.800  
##    factor(season)winter.2018     siteby.rb:seasonfall.2019  
##                      -91.233                        94.267  
##    sitehs.fp:seasonfall.2019    sitend.eos:seasonfall.2019  
##                       99.833                        68.600  
##    sitepc.cc:seasonfall.2019   siteby.rb:seasonspring.2019  
##                           NA                        67.600  
##  sitehs.fp:seasonspring.2019  sitend.eos:seasonspring.2019  
##                      106.567                        74.300  
##  sitepc.cc:seasonspring.2019   siteby.rb:seasonsummer.2018  
##                           NA                        58.533  
##  sitehs.fp:seasonsummer.2018  sitend.eos:seasonsummer.2018  
##                       31.700                        57.667  
##  sitepc.cc:seasonsummer.2018   siteby.rb:seasonsummer.2019  
##                           NA                        79.533  
##  sitehs.fp:seasonsummer.2019  sitend.eos:seasonsummer.2019  
##                       97.767                        67.600  
##  sitepc.cc:seasonsummer.2019   siteby.rb:seasonwinter.2018  
##                           NA                        50.533  
##  sitehs.fp:seasonwinter.2018  sitend.eos:seasonwinter.2018  
##                       89.800                        56.133  
##  sitepc.cc:seasonwinter.2018  
##                           NA
summary (lm2.2)
## 
## Call:
## lm(formula = no.fuc.q ~ site + factor(season) + site:season, 
##     data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -64.567  -4.367   0.000   5.267  68.933 
## 
## Coefficients: (5 not defined because of singularities)
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    61.833     14.231   4.345 0.000104 ***
## sitehs.fp                     -43.767     20.126  -2.175 0.036125 *  
## sitend.eos                     -6.933     22.502  -0.308 0.759714    
## sitepc.cc                      58.967     28.462   2.072 0.045316 *  
## factor(season)fall.2019      -105.700     34.859  -3.032 0.004418 ** 
## factor(season)spring.2019    -103.000     28.462  -3.619 0.000880 ***
## factor(season)summer.2018     -26.233     28.462  -0.922 0.362666    
## factor(season)summer.2019    -102.800     28.462  -3.612 0.000897 ***
## factor(season)winter.2018     -91.233     28.462  -3.205 0.002778 ** 
## siteby.rb:seasonfall.2019      94.267     45.003   2.095 0.043106 *  
## sitehs.fp:seasonfall.2019      99.833     45.003   2.218 0.032748 *  
## sitend.eos:seasonfall.2019     68.600     46.114   1.488 0.145329    
## sitepc.cc:seasonfall.2019          NA         NA      NA       NA    
## siteby.rb:seasonspring.2019    67.600     34.859   1.939 0.060128 .  
## sitehs.fp:seasonspring.2019   106.567     34.859   3.057 0.004136 ** 
## sitend.eos:seasonspring.2019   74.300     36.283   2.048 0.047726 *  
## sitepc.cc:seasonspring.2019        NA         NA      NA       NA    
## siteby.rb:seasonsummer.2018    58.533     34.859   1.679 0.101553    
## sitehs.fp:seasonsummer.2018    31.700     34.859   0.909 0.369040    
## sitend.eos:seasonsummer.2018   57.667     36.283   1.589 0.120486    
## sitepc.cc:seasonsummer.2018        NA         NA      NA       NA    
## siteby.rb:seasonsummer.2019    79.533     34.859   2.282 0.028365 *  
## sitehs.fp:seasonsummer.2019    97.767     34.859   2.805 0.007980 ** 
## sitend.eos:seasonsummer.2019   67.600     36.283   1.863 0.070394 .  
## sitepc.cc:seasonsummer.2019        NA         NA      NA       NA    
## siteby.rb:seasonwinter.2018    50.533     34.859   1.450 0.155583    
## sitehs.fp:seasonwinter.2018    89.800     34.859   2.576 0.014120 *  
## sitend.eos:seasonwinter.2018   56.133     36.283   1.547 0.130348    
## sitepc.cc:seasonwinter.2018        NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 24.65 on 37 degrees of freedom
## Multiple R-squared:  0.6858, Adjusted R-squared:  0.4905 
## F-statistic: 3.512 on 23 and 37 DF,  p-value: 0.0003338
anova (lm2.2)
## Analysis of Variance Table
## 
## Response: no.fuc.q
##                Df  Sum Sq Mean Sq F value    Pr(>F)    
## site            3  8533.5  2844.5  4.6817  0.007177 ** 
## factor(season)  5 28008.2  5601.6  9.2195 9.154e-06 ***
## site:season    15 12531.6   835.4  1.3750  0.210492    
## Residuals      37 22480.6   607.6                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm2.2)
## Warning: not plotting observations with leverage one:
##   4, 14, 29, 45, 61

Significant, plots look good

####REPRODUCTIVE PHENOLOGY (with seasonality)####
3. Is reproduction affected by the season?

####3.1 Is oogonia/receptacle affected by the season?####

lm3.1 <- lm(avg.oog ~ season, data =all)  
lm3.1
## 
## Call:
## lm(formula = avg.oog ~ season, data = all)
## 
## Coefficients:
##       (Intercept)  seasonspring.2019  seasonsummer.2018  seasonsummer.2019  
##            25.753             -1.633             -0.429            -10.591  
## seasonwinter.2018  
##             7.506
summary (lm3.1)
## 
## Call:
## lm(formula = avg.oog ~ season, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -24.120 -11.435  -5.148  11.519  37.454 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         25.753      5.341   4.822 1.28e-05 ***
## seasonspring.2019   -1.633      7.065  -0.231    0.818    
## seasonsummer.2018   -0.429      7.065  -0.061    0.952    
## seasonsummer.2019  -10.591      7.065  -1.499    0.140    
## seasonwinter.2018    7.506      7.065   1.062    0.293    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.02 on 52 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.1297, Adjusted R-squared:  0.06276 
## F-statistic: 1.938 on 4 and 52 DF,  p-value: 0.118
anova (lm3.1)
## Analysis of Variance Table
## 
## Response: avg.oog
##           Df  Sum Sq Mean Sq F value Pr(>F)
## season     4  1989.4  497.36  1.9375  0.118
## Residuals 52 13348.4  256.70
plot (lm3.1)

####3.2 Is oogonia/thalli affected by the season?####

lm3.2 <- lm(oog.thalli ~ season, data =all)  
lm3.2
## 
## Call:
## lm(formula = oog.thalli ~ season, data = all)
## 
## Coefficients:
##       (Intercept)  seasonspring.2019  seasonsummer.2018  seasonsummer.2019  
##            397819            -118122            -208708            -252414  
## seasonwinter.2018  
##           -260220
summary (lm3.2)
## 
## Call:
## lm(formula = oog.thalli ~ season, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -386196 -170441  -91554   73943 1757053 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)   
## (Intercept)         397819     115588   3.442  0.00115 **
## seasonspring.2019  -118122     152908  -0.773  0.44331   
## seasonsummer.2018  -208708     152908  -1.365  0.17815   
## seasonsummer.2019  -252414     152908  -1.651  0.10482   
## seasonwinter.2018  -260220     152908  -1.702  0.09476 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 346800 on 52 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.07225,    Adjusted R-squared:  0.0008898 
## F-statistic: 1.012 on 4 and 52 DF,  p-value: 0.4096
anova (lm3.2)
## Analysis of Variance Table
## 
## Response: oog.thalli
##           Df     Sum Sq    Mean Sq F value Pr(>F)
## season     4 4.8698e+11 1.2174e+11  1.0125 0.4096
## Residuals 52 6.2527e+12 1.2024e+11
plot (lm3.2)

####3.3 Is conceptacle/thalli affected by the season?####

lm3.3 <- lm(con.thalli ~ season, data =all)  
lm3.3
## 
## Call:
## lm(formula = con.thalli ~ season, data = all)
## 
## Coefficients:
##       (Intercept)  seasonspring.2019  seasonsummer.2018  seasonsummer.2019  
##             18468              -3002              -7925              -3119  
## seasonwinter.2018  
##            -10864
summary (lm3.3)
## 
## Call:
## lm(formula = con.thalli ~ season, data = all)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -16096  -7231  -2131   5639  57509 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          18468       4245   4.351 6.35e-05 ***
## seasonspring.2019    -3002       5615  -0.535   0.5952    
## seasonsummer.2018    -7925       5615  -1.411   0.1641    
## seasonsummer.2019    -3119       5615  -0.556   0.5809    
## seasonwinter.2018   -10864       5615  -1.935   0.0585 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12730 on 52 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.08934,    Adjusted R-squared:  0.01929 
## F-statistic: 1.275 on 4 and 52 DF,  p-value: 0.2916
anova (lm3.3)
## Analysis of Variance Table
## 
## Response: con.thalli
##           Df     Sum Sq   Mean Sq F value Pr(>F)
## season     4  827224705 206806176  1.2754 0.2916
## Residuals 52 8431680714 162147706
plot (lm3.3)

####3.4 Is percent reproductive tissue affected by the season?####

lm3.4 <- lm(perc.rdw ~ season, data =all)  
lm3.4
## 
## Call:
## lm(formula = perc.rdw ~ season, data = all)
## 
## Coefficients:
##       (Intercept)  seasonspring.2019  seasonsummer.2018  seasonsummer.2019  
##            24.367             -8.205             -5.058              1.804  
## seasonwinter.2018  
##           -11.406
summary (lm3.4)
## 
## Call:
## lm(formula = perc.rdw ~ season, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -24.083 -10.392  -1.393   9.394  33.425 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         24.367      4.575   5.326 2.18e-06 ***
## seasonspring.2019   -8.205      6.052  -1.356   0.1810    
## seasonsummer.2018   -5.058      6.052  -0.836   0.4072    
## seasonsummer.2019    1.804      6.052   0.298   0.7668    
## seasonwinter.2018  -11.406      6.052  -1.885   0.0651 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.73 on 52 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.1246, Adjusted R-squared:  0.05727 
## F-statistic:  1.85 on 4 and 52 DF,  p-value: 0.1332
anova (lm3.4)
## Analysis of Variance Table
## 
## Response: perc.rdw
##           Df Sum Sq Mean Sq F value Pr(>F)
## season     4 1394.4  348.59  1.8504 0.1332
## Residuals 52 9796.1  188.39
plot (lm3.4)

####3.5 Is adult density affected by the season?####

lm3.5 <- lm(no.large.fuc.q ~ season, data =all)  
lm3.5
## 
## Call:
## lm(formula = no.large.fuc.q ~ season, data = all)
## 
## Coefficients:
##       (Intercept)    seasonfall.2019  seasonspring.2019  seasonsummer.2018  
##             5.967             -3.592              3.083              5.646  
## seasonsummer.2019  seasonwinter.2018  
##            -2.450              1.875
summary (lm3.5)
## 
## Call:
## lm(formula = no.large.fuc.q ~ season, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.4125 -1.1750 -0.4125  1.2875 11.2875 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          5.967      1.173   5.085 5.32e-06 ***
## seasonfall.2019     -3.592      2.115  -1.698  0.09564 .  
## seasonspring.2019    3.083      1.552   1.986  0.05239 .  
## seasonsummer.2018    5.646      1.711   3.300  0.00177 ** 
## seasonsummer.2019   -2.450      1.552  -1.578  0.12069    
## seasonwinter.2018    1.875      1.552   1.208  0.23268    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.52 on 51 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.4264, Adjusted R-squared:  0.3702 
## F-statistic: 7.582 on 5 and 51 DF,  p-value: 2.184e-05
anova (lm3.5)
## Analysis of Variance Table
## 
## Response: no.large.fuc.q
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## season     5 469.84  93.968  7.5822 2.184e-05 ***
## Residuals 51 632.05  12.393                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm3.5)

####3.6 Is juvenile density affected by the season?####

lm3.6 <- lm(no.small.fuc.q ~ season, data =all)  
lm3.6
## 
## Call:
## lm(formula = no.small.fuc.q ~ season, data = all)
## 
## Coefficients:
##       (Intercept)    seasonfall.2019  seasonspring.2019  seasonsummer.2018  
##             46.29             -24.79             -32.32              36.59  
## seasonsummer.2019  seasonwinter.2018  
##            -27.48             -32.35
summary (lm3.6)
## 
## Call:
## lm(formula = no.small.fuc.q ~ season, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -68.575  -9.500  -1.667   4.358  70.211 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         46.289      8.521   5.433 1.56e-06 ***
## seasonfall.2019    -24.789     15.361  -1.614  0.11275    
## seasonspring.2019  -32.322     11.272  -2.868  0.00600 ** 
## seasonsummer.2018   36.586     12.421   2.946  0.00485 ** 
## seasonsummer.2019  -27.481     11.272  -2.438  0.01829 *  
## seasonwinter.2018  -32.347     11.272  -2.870  0.00596 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 25.56 on 51 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.4954, Adjusted R-squared:  0.446 
## F-statistic: 10.02 on 5 and 51 DF,  p-value: 1.021e-06
anova (lm3.6)
## Analysis of Variance Table
## 
## Response: no.small.fuc.q
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## season     5  32721  6544.2  10.015 1.021e-06 ***
## Residuals 51  33324   653.4                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm3.6)

####REPRODUCTIVE PHENOLOGY (without seasonality)###
4. Is reproductive phenology affected by environmental conditions (salinity, pH, water temperature and air temperature)?
TO DO: check which metric I should be using for each of these variables. For now just sticking with the mean between survey dates but I think mean daily minimun or maximum might be more interesting and insightful

####4.1 Is oogoina/receptical affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.1 <- lm(avg.oog ~ salinity + ph + water.temp, data =all)  
lm4.1
## 
## Call:
## lm(formula = avg.oog ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##     288.777        1.152      -29.813       -3.675
summary (lm4.1)
## 
## Call:
## lm(formula = avg.oog ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -17.635  -9.566  -1.689   6.475  34.053 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 288.7770   125.5277   2.301  0.02700 *  
## salinity      1.1523     0.3257   3.537  0.00108 ** 
## ph          -29.8126    15.7331  -1.895  0.06573 .  
## water.temp   -3.6748     0.8275  -4.441 7.48e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.45 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.4057, Adjusted R-squared:  0.3588 
## F-statistic: 8.647 on 3 and 38 DF,  p-value: 0.000168
anova (lm4.1)
## Analysis of Variance Table
## 
## Response: avg.oog
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## salinity    1  553.1   553.1  3.0584   0.08840 .  
## ph          1  571.6   571.6  3.1611   0.08342 .  
## water.temp  1 3566.6  3566.6 19.7230 7.477e-05 ***
## Residuals  38 6871.7   180.8                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm4.1)

####4.2 Is oogonia/thalli affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.2 <- lm(oog.thalli ~ salinity + ph + water.temp, data =all)  
lm4.2
## 
## Call:
## lm(formula = oog.thalli ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##     3068710         9392      -375880       -11561
summary (lm4.2)
## 
## Call:
## lm(formula = oog.thalli ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -208605 -125253  -24487   61299  855759 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  3068710    1784692   1.719   0.0937 .
## salinity        9392       4631   2.028   0.0496 *
## ph           -375881     223686  -1.680   0.1011  
## water.temp    -11561      11764  -0.983   0.3320  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 191200 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.1627, Adjusted R-squared:  0.09662 
## F-statistic: 2.462 on 3 and 38 DF,  p-value: 0.07734
anova (lm4.2)
## Analysis of Variance Table
## 
## Response: oog.thalli
##            Df     Sum Sq    Mean Sq F value  Pr(>F)  
## salinity    1 1.3454e+11 1.3454e+11  3.6806 0.06259 .
## ph          1 1.0012e+11 1.0012e+11  2.7389 0.10617  
## water.temp  1 3.5297e+10 3.5297e+10  0.9656 0.33199  
## Residuals  38 1.3890e+12 3.6553e+10                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm4.2)

####4.3 Is conceptacle/thalli affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.3 <- lm(con.thalli ~ salinity + ph + water.temp, data =all)  
lm4.3
## 
## Call:
## lm(formula = con.thalli ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##     58775.2        161.4      -6342.5       -129.4
summary (lm4.3)
## 
## Call:
## lm(formula = con.thalli ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -10380  -5529  -2928   2812  31992 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)  58775.2    85416.1   0.688    0.496
## salinity       161.4      221.7   0.728    0.471
## ph           -6342.5    10705.7  -0.592    0.557
## water.temp    -129.4      563.1  -0.230    0.819
## 
## Residual standard error: 9150 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.02485,    Adjusted R-squared:  -0.05213 
## F-statistic: 0.3229 on 3 and 38 DF,  p-value: 0.8088
anova (lm4.3)
## Analysis of Variance Table
## 
## Response: con.thalli
##            Df     Sum Sq  Mean Sq F value Pr(>F)
## salinity    1   47864762 47864762  0.5717 0.4543
## ph          1   28807975 28807975  0.3441 0.5610
## water.temp  1    4423765  4423765  0.0528 0.8194
## Residuals  38 3181730439 83729748
plot (lm4.3)

####4.4 Is percent reproductive tissue affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.4 <- lm(perc.rdw ~ salinity + ph + water.temp, data =all)  
lm4.4
## 
## Call:
## lm(formula = perc.rdw ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##    329.7386       0.2022     -40.9228       0.3886
summary (lm4.4)
## 
## Call:
## lm(formula = perc.rdw ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -17.097 -11.126  -1.268   9.220  29.659 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept) 329.7386   122.9021   2.683   0.0107 *
## salinity      0.2022     0.3189   0.634   0.5298  
## ph          -40.9228    15.4040  -2.657   0.0115 *
## water.temp    0.3886     0.8102   0.480   0.6343  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.17 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.1886, Adjusted R-squared:  0.1246 
## F-statistic: 2.945 on 3 and 38 DF,  p-value: 0.04509
anova (lm4.4)
## Analysis of Variance Table
## 
## Response: perc.rdw
##            Df Sum Sq Mean Sq F value  Pr(>F)  
## salinity    1  255.6  255.57  1.4743 0.23216  
## ph          1 1236.0 1236.03  7.1303 0.01109 *
## water.temp  1   39.9   39.87  0.2300 0.63426  
## Residuals  38 6587.2  173.35                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm4.4)

####4.5 Is juvenile density affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.5 <- lm(no.small.fuc.q ~ salinity + ph + water.temp, data =all)  
lm4.5
## 
## Call:
## lm(formula = no.small.fuc.q ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##    -196.608        1.501       14.907        4.941
summary (lm4.5)
## 
## Call:
## lm(formula = no.small.fuc.q ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.774 -20.807  -6.178  19.982  83.552 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -196.6076   314.3187  -0.626   0.5354  
## salinity       1.5011     0.7607   1.973   0.0558 .
## ph            14.9069    39.4949   0.377   0.7079  
## water.temp     4.9405     1.8316   2.697   0.0104 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 31.22 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.3624, Adjusted R-squared:  0.3121 
## F-statistic:   7.2 on 3 and 38 DF,  p-value: 0.0006082
anova (lm4.5)
## Analysis of Variance Table
## 
## Response: no.small.fuc.q
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## salinity    1  13787 13787.0 14.1477 0.0005693 ***
## ph          1    172   172.2  0.1767 0.6766207    
## water.temp  1   7091  7090.6  7.2761 0.0103617 *  
## Residuals  38  37031   974.5                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot (lm4.5)

####4.6 Is adult density affected by environmental conditions (salinity, pH, water temperature and air temperature)?####

lm4.6 <- lm(no.large.fuc.q ~ salinity + ph + water.temp, data =all)  
lm4.6
## 
## Call:
## lm(formula = no.large.fuc.q ~ salinity + ph + water.temp, data = all)
## 
## Coefficients:
## (Intercept)     salinity           ph   water.temp  
##  -11.428619     0.009459     3.089848    -0.368876
summary (lm4.6)
## 
## Call:
## lm(formula = no.large.fuc.q ~ salinity + ph + water.temp, data = all)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.057 -3.407 -1.521  3.009 16.395 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept) -11.428619  49.474480  -0.231    0.819
## salinity      0.009459   0.119731   0.079    0.937
## ph            3.089848   6.216584   0.497    0.622
## water.temp   -0.368876   0.288292  -1.280    0.208
## 
## Residual standard error: 4.914 on 38 degrees of freedom
##   (19 observations deleted due to missingness)
## Multiple R-squared:  0.05791,    Adjusted R-squared:  -0.01646 
## F-statistic: 0.7786 on 3 and 38 DF,  p-value: 0.5132
anova (lm4.6)
## Analysis of Variance Table
## 
## Response: no.large.fuc.q
##            Df Sum Sq Mean Sq F value Pr(>F)
## salinity    1  11.38  11.382  0.4714 0.4965
## ph          1   5.49   5.488  0.2273 0.6362
## water.temp  1  39.53  39.528  1.6372 0.2085
## Residuals  38 917.47  24.144
plot (lm4.6)