## Loading required package: readxl
## Loading required package: lubridate
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:data.table':
## 
##     hour, isoweek, mday, minute, month, quarter, second, wday, week,
##     yday, year
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
## Loading required package: solartime
## [1] "Winter data excluded."
## [1] "The counts of all passing species (not resident nor breeding) were set to zero. Abreed_and_non_breed contain original data."

Med-Desert Transition Zone

Factors are proximity to settlements and time. Total 5 campaigns. 5 sites with 6 plots per site.

Model gma, abundance and richness

Richness done with rare species. Abundance and mean abundance done without rare species. Full models include cosine and sine of the time difference from June 21st (in radians).

richness

Explore data and plot mean-variance plot. There is a strong relationship, indicating that employing GLMs is the proper way to analyze, rather than OLS (assumption of homogeneity is violated).

## [1] "RICHNESS WITH RARE SPECIES"

## Overlapping points were shifted along the y-axis to make them visible.
## 
##  PIPING TO 2nd MVFACTOR
## Only the variables Passer.domesticus, Galerida.cristata, Columba.livia, Streptopelia.decaocto, Prinia.gracilis, Chloris.chloris, Pycnonotus.xanthopygos, Spilopelia.senegalensis, Corvus.monedula, Curruca.conspicillata, Cecropis.daurica, Alectoris.chukar were included in the plot 
## (the variables with highest total abundance).
richness year_ct site settlements td_sc cos_td_rad sin_td_rad h_from_sunrise cos_hsun sin_hsun monitors_name wind precipitation temperature clouds
Min. : 1.00 Min. :0.000 Beit Yatir:24 Far :75 Min. :-2.06468 Min. :-0.2009 Min. :-0.99677 Length:150 Min. :0.4726 Min. :-0.2411 Eyal Shochat: 25 0 : 0 0 : 0 0 : 0 0 : 0
1st Qu.: 5.00 1st Qu.:2.000 Dvir : 6 Near:75 1st Qu.:-0.41891 1st Qu.: 0.5142 1st Qu.:-0.85766 Class :difftime 1st Qu.:0.8607 1st Qu.: 0.1797 Other : 5 1 : 0 3 : 0 1 : 0 1 : 0
Median : 7.00 Median :4.000 Har Amasa :29 NA Median : 0.07721 Median : 0.6917 Median :-0.72216 Mode :numeric Median :0.9336 Median : 0.3584 Adi Domer : 0 2 : 0 NA’s:150 2 : 0 2 : 0
Mean : 7.58 Mean :3.987 Lahav :31 NA Mean :-0.03353 Mean : 0.6007 Mean :-0.69390 NA Mean :0.8946 Mean : 0.3483 Asaf Mayrose: 0 3 : 0 NA 3 : 0 3 : 0
3rd Qu.: 9.00 3rd Qu.:6.000 Lehavim :30 NA 3rd Qu.: 0.22509 3rd Qu.: 0.7383 3rd Qu.:-0.67444 NA 3rd Qu.:0.9828 3rd Qu.: 0.5090 Eliraz Dvir : 0 NA’s:150 NA NA’s:150 NA’s:150
Max. :19.00 Max. :8.000 Meitar : 6 NA Max. : 1.90425 Max. : 1.0000 Max. : 0.01721 NA Max. :1.0000 Max. : 0.8813 (Other) : 0 NA NA NA NA
NA NA Mirsham :24 NA NA NA NA NA NA’s :61 NA’s :61 NA’s :120 NA NA NA NA

no observation for all 4 weather variables. many NAs (61) for sampling time of day variables. Try to add them to the model to see if they have a very strong effect; otherwise remove them.

## Warning in cor(P.anal[, lapply(X = .SD, FUN = as.numeric), .SDcols =
## IVs[1:11]], : the standard deviation is zero
richness year_ct site settlements td_sc cos_td_rad sin_td_rad h_from_sunrise cos_hsun sin_hsun monitors_name
richness 1.0000000 0.0106005 0.1305677 0.6598001 -0.0215457 0.0308580 -0.0806109 -0.1273441 0.2240561 -0.1058582 0.0368710
year_ct 0.0106005 1.0000000 0.0000166 -0.0047063 -0.4784485 -0.4613745 -0.4697934 -0.4334083 0.3814165 -0.4327722 NA
site 0.1305677 0.0000166 1.0000000 0.0035169 -0.2288120 -0.1363567 -0.3069781 -0.1032496 0.1542517 -0.0901054 0.0447214
settlements 0.6598001 -0.0047063 0.0035169 1.0000000 0.0121481 0.0062718 0.0170858 0.0349726 0.0873478 0.0587772 0.2683282
td_sc -0.0215457 -0.4784485 -0.2288120 0.0121481 1.0000000 0.9576971 0.9330875 -0.0786776 0.0634242 -0.0849265 -0.1529258
cos_td_rad 0.0308580 -0.4613745 -0.1363567 0.0062718 0.9576971 1.0000000 0.7938914 -0.1011147 0.0827235 -0.1075303 -0.1580054
sin_td_rad -0.0806109 -0.4697934 -0.3069781 0.0170858 0.9330875 0.7938914 1.0000000 0.0563677 -0.0500522 0.0519939 -0.0915087
h_from_sunrise -0.1273441 -0.4334083 -0.1032496 0.0349726 -0.0786776 -0.1011147 0.0563677 1.0000000 -0.9216766 0.9965659 0.2604084
cos_hsun 0.2240561 0.3814165 0.1542517 0.0873478 0.0634242 0.0827235 -0.0500522 -0.9216766 1.0000000 -0.8880762 -0.2261490
sin_hsun -0.1058582 -0.4327722 -0.0901054 0.0587772 -0.0849265 -0.1075303 0.0519939 0.9965659 -0.8880762 1.0000000 0.2583855
monitors_name 0.0368710 NA 0.0447214 0.2683282 -0.1529258 -0.1580054 -0.0915087 0.2604084 -0.2261490 0.2583855 1.0000000

Fit Poisson glm, check for existence of overdispersion

## [1] "Estimating overdispersion parameter phi: (Res. Dev.)/(n-p) where n=number of observations; p=number of parameters in the model."
## [1] "od = 0.946402758279505"

Overdispersion parameter is <1 (underdispersion) and therefore Poisson is preferable to negative binomial.

Observations 89 (61 missing obs. deleted)
Dependent variable richness
Type Generalized linear model
Family poisson
Link log
χ²(7) 109.12
Pseudo-R² (Cragg-Uhler) 0.71
Pseudo-R² (McFadden) 0.21
AIC 422.28
BIC 442.19
Est. S.E. z val. p
(Intercept) 1.91 1.36 1.40 0.16
settlementsNear 0.51 0.33 1.52 0.13
year_ct 0.02 0.05 0.44 0.66
cos_td_rad -0.32 0.37 -0.85 0.39
sin_td_rad 1.40 0.90 1.56 0.12
cos_hsun 0.92 0.91 1.01 0.31
sin_hsun -0.01 0.42 -0.02 0.99
settlementsNear:year_ct 0.04 0.05 0.81 0.42
Standard errors: MLE

cosine and sine of hours from sunrise are not significant. remove them because of many NAs.

## boundary (singular) fit: see help('isSingular')

Singular fit. Check VIF of terms.

##         settlements             year_ct          cos_td_rad          sin_td_rad 
##            2.932257            3.290801            2.791554            2.808034 
## settlements:year_ct 
##            5.025307

Remove interaction of settlements X year.

## boundary (singular) fit: see help('isSingular')

Still singular fit, use glm.

## 
## Call:
## glm(formula = richness ~ settlements * year_ct + cos_td_rad + 
##     sin_td_rad + site, family = poisson, data = P.anal)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.86744  -0.70363  -0.08607   0.65863   1.99517  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)              0.98274    0.29563   3.324 0.000887 ***
## settlementsNear          0.61552    0.10766   5.717 1.08e-08 ***
## year_ct                 -0.01011    0.02032  -0.498 0.618643    
## cos_td_rad               0.39213    0.20505   1.912 0.055829 .  
## sin_td_rad              -0.49006    0.22691  -2.160 0.030796 *  
## siteDvir                 0.14468    0.18195   0.795 0.426516    
## siteHar Amasa            0.04847    0.11397   0.425 0.670606    
## siteLahav                0.17667    0.10695   1.652 0.098545 .  
## siteLehavim              0.07396    0.11856   0.624 0.532723    
## siteMeitar               0.13569    0.18546   0.732 0.464384    
## siteMirsham              0.15749    0.10859   1.450 0.146955    
## settlementsNear:year_ct  0.01881    0.02206   0.853 0.393864    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 274.96  on 149  degrees of freedom
## Residual deviance: 132.10  on 138  degrees of freedom
## AIC: 720.54
## 
## Number of Fisher Scoring iterations: 4

perform stepwise model selection of poisson mixed model.

## Start:  AIC=720.54
## richness ~ settlements * year_ct + cos_td_rad + sin_td_rad + 
##     site
## 
##                       Df Deviance    AIC
## - site                 6   136.28 712.71
## - settlements:year_ct  1   132.83 719.26
## <none>                     132.10 720.54
## - cos_td_rad           1   135.86 722.29
## - sin_td_rad           1   136.94 723.37
## 
## Step:  AIC=712.71
## richness ~ settlements + year_ct + cos_td_rad + sin_td_rad + 
##     settlements:year_ct
## 
##                       Df Deviance    AIC
## - settlements:year_ct  1   136.98 711.42
## <none>                     136.28 712.71
## - cos_td_rad           1   144.06 718.49
## - sin_td_rad           1   146.34 720.77
## 
## Step:  AIC=711.42
## richness ~ settlements + year_ct + cos_td_rad + sin_td_rad
## 
##               Df Deviance    AIC
## - year_ct      1   137.00 709.43
## <none>             136.98 711.42
## - cos_td_rad   1   144.79 717.22
## - sin_td_rad   1   147.10 719.54
## - settlements  1   265.66 838.09
## 
## Step:  AIC=709.43
## richness ~ settlements + cos_td_rad + sin_td_rad
## 
##               Df Deviance    AIC
## <none>             137.00 709.43
## - cos_td_rad   1   145.12 715.55
## - sin_td_rad   1   147.35 717.79
## - settlements  1   265.67 836.10

settlements and time of year remain. Final model:

## 
## Call:
## glm(formula = richness ~ settlements + cos_td_rad + sin_td_rad, 
##     family = poisson, data = P.anal)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.72380  -0.70081  -0.09132   0.67524   2.37119  
## 
## Coefficients:
##                 Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      0.89105    0.24034   3.707 0.000209 ***
## settlementsNear  0.69267    0.06288  11.016  < 2e-16 ***
## cos_td_rad       0.49099    0.17683   2.777 0.005494 ** 
## sin_td_rad      -0.61983    0.19854  -3.122 0.001797 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 274.96  on 149  degrees of freedom
## Residual deviance: 137.00  on 146  degrees of freedom
## AIC: 709.43
## 
## Number of Fisher Scoring iterations: 4

Observations 150
Dependent variable richness
Type Generalized linear model
Family poisson
Link log
χ²(3) 137.966
Pseudo-R² (Cragg-Uhler) 0.604
Pseudo-R² (McFadden) 0.164
AIC 709.428
BIC 721.470
exp(Est.) 2.5% 97.5% z val. p
(Intercept) 2.438 1.522 3.904 3.707 0.000
settlementsNear 1.999 1.767 2.261 11.016 0.000
cos_td_rad 1.634 1.155 2.311 2.777 0.005
sin_td_rad 0.538 0.365 0.794 -3.122 0.002
Standard errors: MLE

There is a statistically significant effect for proximity to settlements and time of year. No statistically significant effect for the other factors tested.

geometric mean of abundance

Explore data. Exclude time of day because of high number of NAs.

## [1] "GEOMETRIC MEAN ABUNDANCE WITHOUT RARE SPECIES"
gma year_ct site settlements td_sc cos_td_rad sin_td_rad
Min. :1.000 Min. :0.000 Lahav :31 Far :75 Min. :-2.06468 Min. :-0.2009 Min. :-0.99677
1st Qu.:1.686 1st Qu.:2.000 Lehavim :30 Near:75 1st Qu.:-0.41891 1st Qu.: 0.5142 1st Qu.:-0.85766
Median :2.277 Median :4.000 Har Amasa :29 NA Median : 0.07721 Median : 0.6917 Median :-0.72216
Mean :2.425 Mean :3.987 Beit Yatir:24 NA Mean :-0.03353 Mean : 0.6007 Mean :-0.69390
3rd Qu.:2.902 3rd Qu.:6.000 Mirsham :24 NA 3rd Qu.: 0.22509 3rd Qu.: 0.7383 3rd Qu.:-0.67444
Max. :6.325 Max. :8.000 Dvir : 6 NA Max. : 1.90425 Max. : 1.0000 Max. : 0.01721
NA NA (Other) : 6 NA NA NA NA

Fit glm, compare gamma, gaussian (poisson inappropriate because response is not discrete)

Gamma seems better than gaussian. Remove rows 80 and 14 (1 species with abundance of 5 and 2 species with abundance of 13, respectively). Fit fixed and mixed models.

## boundary (singular) fit: see help('isSingular')

Mixed model did not converge, use glm:

## 
## Call:
## glm(formula = gma ~ settlements * year_ct + cos_td_rad + sin_td_rad + 
##     site, family = Gamma, data = P.anal)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -0.62585  -0.20756  -0.03878   0.15707   0.68699  
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              0.511507   0.103085   4.962 2.05e-06 ***
## settlementsNear         -0.037200   0.030016  -1.239   0.2174    
## year_ct                  0.030787   0.006833   4.505 1.41e-05 ***
## cos_td_rad              -0.169836   0.080077  -2.121   0.0357 *  
## sin_td_rad               0.054367   0.071247   0.763   0.4467    
## siteDvir                 0.024033   0.052820   0.455   0.6498    
## siteHar Amasa            0.017855   0.038731   0.461   0.6455    
## siteLahav               -0.010773   0.038383  -0.281   0.7794    
## siteLehavim             -0.028752   0.041712  -0.689   0.4918    
## siteMeitar              -0.055576   0.053538  -1.038   0.3011    
## siteMirsham             -0.013049   0.039936  -0.327   0.7444    
## settlementsNear:year_ct -0.012041   0.007557  -1.593   0.1134    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for Gamma family taken to be 0.08981959)
## 
##     Null deviance: 19.989  on 147  degrees of freedom
## Residual deviance: 11.900  on 136  degrees of freedom
## AIC: 311.7
## 
## Number of Fisher Scoring iterations: 5

perform stepwise model selection of Gaussian model.

## Start:  AIC=311.7
## gma ~ settlements * year_ct + cos_td_rad + sin_td_rad + site
## 
##                       Df Deviance    AIC
## - site                 6   12.202 303.07
## - sin_td_rad           1   11.953 310.29
## <none>                     11.900 311.70
## - settlements:year_ct  1   12.128 312.25
## - cos_td_rad           1   12.326 314.45
## 
## Step:  AIC=303.47
## gma ~ settlements + year_ct + cos_td_rad + sin_td_rad + settlements:year_ct
## 
##                       Df Deviance    AIC
## <none>                     12.202 303.47
## - sin_td_rad           1   12.428 304.05
## - settlements:year_ct  1   12.433 304.11
## - cos_td_rad           1   12.759 307.84

drop sine of time of year becauese \(\Delta AIC<2\)

## Single term deletions
## 
## Model:
## gma ~ settlements * year_ct + cos_td_rad
##                     Df Deviance    AIC
## <none>                   12.428 304.21
## cos_td_rad           1   12.787 306.23
## settlements:year_ct  1   12.658 304.79

drop settlements:year because \(\Delta AIC<2\).

## Single term deletions
## 
## Model:
## gma ~ settlements + year_ct + cos_td_rad
##             Df Deviance    AIC
## <none>           12.658 304.96
## settlements  1   13.785 315.47
## year_ct      1   15.943 339.43
## cos_td_rad   1   13.012 306.90

drop cosine of time of year becauese \(\Delta AIC<2\).

## Single term deletions
## 
## Model:
## gma ~ settlements + year_ct
##             Df Deviance    AIC
## <none>           13.012 307.11
## settlements  1   14.124 317.30
## year_ct      1   18.755 368.09

Settlements and year remain. This is the final model:

## 
## Call:
## glm(formula = gma ~ settlements + year_ct, family = Gamma, data = P.anal)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -0.57201  -0.24946  -0.04993   0.17284   0.62430  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      0.35840    0.01974  18.159  < 2e-16 ***
## settlementsNear -0.07207    0.02080  -3.465 0.000698 ***
## year_ct          0.02939    0.00374   7.857 8.11e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for Gamma family taken to be 0.09119238)
## 
##     Null deviance: 19.989  on 147  degrees of freedom
## Residual deviance: 13.012  on 145  degrees of freedom
## AIC: 307.11
## 
## Number of Fisher Scoring iterations: 5

Observations 148
Dependent variable gma
Type Generalized linear model
Family Gamma
Link inverse
χ²(2) 6.977
Pseudo-R² (Cragg-Uhler) 0.387
Pseudo-R² (McFadden) 0.178
AIC 307.109
BIC 319.098
Est. S.E. t val. p
(Intercept) 0.358 0.020 18.159 0.000
settlementsNear -0.072 0.021 -3.465 0.001
year_ct 0.029 0.004 7.857 0.000
Standard errors: MLE

Very significant temporal decrease in gma as well as lower gma far from settlements.

abundance

Explore data

## [1] "ABUNDANCE WITHOUT RARE SPECIES"
abundance year_ct site settlements td_sc cos_td_rad sin_td_rad
Min. : 3.00 Min. :0.000 Lahav :31 Far :75 Min. :-2.06468 Min. :-0.2009 Min. :-0.99677
1st Qu.: 9.00 1st Qu.:2.000 Lehavim :30 Near:75 1st Qu.:-0.41891 1st Qu.: 0.5142 1st Qu.:-0.85766
Median : 17.00 Median :4.000 Har Amasa :29 NA Median : 0.07721 Median : 0.6917 Median :-0.72216
Mean : 23.77 Mean :3.987 Beit Yatir:24 NA Mean :-0.03353 Mean : 0.6007 Mean :-0.69390
3rd Qu.: 32.75 3rd Qu.:6.000 Mirsham :24 NA 3rd Qu.: 0.22509 3rd Qu.: 0.7383 3rd Qu.:-0.67444
Max. :113.00 Max. :8.000 Dvir : 6 NA Max. : 1.90425 Max. : 1.0000 Max. : 0.01721
NA NA (Other) : 6 NA NA NA NA

Outlier with total abundance >100. Examine:

##                                    unit subunit    site year year_ct
## 1: Mediterranean-Desert Transition Zone    <NA> Lehavim 2012       0
##    settlements agriculture habitat dunes land_use     point_name       date
## 1:        Near        <NA>    <NA>  <NA>     <NA> Lehavim Near 4 2012-04-25
##    datetime      td_sc     td_rad cos_td_rad sin_td_rad timediff_Jun21
## 1:     <NA> -0.3091928 -0.9812098  0.5560174 -0.8311706       -57 days
##    monitors_name wind precipitation temperature clouds h_from_sunrise cos_hsun
## 1:          <NA> <NA>          <NA>        <NA>   <NA>       NA hours       NA
##    sin_hsun pilot richness abundance      gma
## 1:       NA  TRUE       14       113 4.830157

Exclude point with abundance of 113 (Lehavim Near 4 from 2012). Nearest total abundance is 80.

PHI>1, hence choose negative binomial. Fit fixed and mixed models. Choose mixed model if possible, otherwise choose a model with fixed-effects only.

## boundary (singular) fit: see help('isSingular')

Mixed model is singular. check variance inflation factor:

##         settlements             year_ct          cos_td_rad          sin_td_rad 
##            2.742010            2.760979            2.701299            2.683580 
## settlements:year_ct 
##            4.304603

none of the terms seem to have an extreme inflation factor (>5). Use glm.

## 
## Call:
## glm.nb(formula = abundance ~ settlements * year_ct + cos_td_rad + 
##     sin_td_rad + site, data = P.anal, init.theta = 5.037571108, 
##     link = log)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.6469  -0.9017  -0.0167   0.4426   2.1611  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)              1.81324    0.38426   4.719 2.37e-06 ***
## settlementsNear          0.82583    0.13942   5.923 3.16e-09 ***
## year_ct                 -0.11835    0.02578  -4.591 4.41e-06 ***
## cos_td_rad               0.92561    0.27720   3.339  0.00084 ***
## sin_td_rad              -0.81311    0.29399  -2.766  0.00568 ** 
## siteDvir                -0.10833    0.24057  -0.450  0.65249    
## siteHar Amasa           -0.23185    0.15220  -1.523  0.12769    
## siteLahav               -0.01785    0.14855  -0.120  0.90433    
## siteLehavim              0.03900    0.16242   0.240  0.81023    
## siteMeitar              -0.02033    0.25500  -0.080  0.93646    
## siteMirsham              0.09152    0.15086   0.607  0.54409    
## settlementsNear:year_ct  0.06823    0.02947   2.315  0.02061 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for Negative Binomial(5.0376) family taken to be 1)
## 
##     Null deviance: 373.50  on 149  degrees of freedom
## Residual deviance: 148.24  on 138  degrees of freedom
## AIC: 1115.6
## 
## Number of Fisher Scoring iterations: 1
## 
## 
##               Theta:  5.038 
##           Std. Err.:  0.712 
## 
##  2 x log-likelihood:  -1089.641

Perform stepwise model selection of mixed model.

## Start:  AIC=1113.64
## abundance ~ settlements * year_ct + cos_td_rad + sin_td_rad + 
##     site
## 
##                       Df Deviance    AIC
## - site                 6   153.68 1107.1
## <none>                     148.24 1113.6
## - settlements:year_ct  1   153.88 1117.3
## - sin_td_rad           1   155.45 1118.8
## - cos_td_rad           1   158.96 1122.4
## 
## Step:  AIC=1107
## abundance ~ settlements + year_ct + cos_td_rad + sin_td_rad + 
##     settlements:year_ct
## 
##                       Df Deviance    AIC
## <none>                     149.22 1107.0
## - settlements:year_ct  1   154.70 1110.5
## - sin_td_rad           1   164.30 1120.1
## - cos_td_rad           1   169.57 1125.4

The final model:

## 
## Call:
## glm.nb(formula = abundance ~ settlements + year_ct + cos_td_rad + 
##     sin_td_rad + settlements:year_ct, data = P.anal, init.theta = 4.852344004, 
##     link = log)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.60195  -0.89967  -0.07725   0.59045   2.29614  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)              1.49528    0.33359   4.482 7.38e-06 ***
## settlementsNear          0.81387    0.14127   5.761 8.35e-09 ***
## year_ct                 -0.11512    0.02361  -4.875 1.09e-06 ***
## cos_td_rad               1.12586    0.24894   4.523 6.11e-06 ***
## sin_td_rad              -1.05028    0.26643  -3.942 8.08e-05 ***
## settlementsNear:year_ct  0.06830    0.02980   2.292   0.0219 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for Negative Binomial(4.8523) family taken to be 1)
## 
##     Null deviance: 362.58  on 149  degrees of freedom
## Residual deviance: 149.22  on 144  degrees of freedom
## AIC: 1109
## 
## Number of Fisher Scoring iterations: 1
## 
## 
##               Theta:  4.852 
##           Std. Err.:  0.683 
## 
##  2 x log-likelihood:  -1095.005

Interpretation of abundance model:

## Error in glm.control(...) : 
##   unused argument (family = list("Negative Binomial(4.8523)", "log", function (mu) 
## log(mu), function (eta) 
## pmax(exp(eta), .Machine$double.eps), function (mu) 
## mu + mu^2/.Theta, function (y, mu, wt) 
## 2 * wt * (y * log(pmax(1, y)/mu) - (y + .Theta) * log((y + .Theta)/(mu + .Theta))), function (y, n, mu, wt, dev) 
## {
##     term <- (y + .Theta) * log(mu + .Theta) - y * log(mu) + lgamma(y + 1) - .Theta * log(.Theta) + lgamma(.Theta) - lgamma(.Theta + y)
##     2 * sum(term * wt)
## }, function (eta) 
## pmax(exp(eta), .Machine$double.eps), expression({
##     if (any(y < 0)) stop("negative values not allowed for the negative binomial family")
##     n <- rep(1, nobs)
##     mustart <- y + (y == 0)/6
## }), function (mu) 
## all(mu > 0), function (eta) 
## TRUE, function (object, nsim) 
## {
##     ftd <- fitted(object)
##     rnegbin(nsim * length(ftd), ftd, .Theta)
## }))
Observations 150
Dependent variable abundance
Type Generalized linear model
Family Negative Binomial(4.8523)
Link log
χ²(NA) NA
Pseudo-R² (Cragg-Uhler) NA
Pseudo-R² (McFadden) NA
AIC 1109.005
BIC 1130.079
Est. S.E. z val. p
(Intercept) 1.495 0.334 4.482 0.000
settlementsNear 0.814 0.141 5.761 0.000
year_ct -0.115 0.024 -4.875 0.000
cos_td_rad 1.126 0.249 4.523 0.000
sin_td_rad -1.050 0.266 -3.942 0.000
settlementsNear:year_ct 0.068 0.030 2.292 0.022
Standard errors: MLE

community analysis using package MVabund

##       nb       po 
## 196.9227 253.6069
## [1] "POISSON"

## [1] "NEGATIVE BINOMIAL"

negative binomial model is better than poisson according to residuals and AIC comparison.

##       nb       po      nb1 
## 196.9227 253.6069 191.3415

The addition of the explanatory variable ‘site’ is improving the AIC of the model. stepwise selection of model:

## Single term deletions
## 
## Model:
## spp_no_rare ~ settlements * year_ct + cos_td_rad + sin_td_rad + 
##     site
##                      Df    AIC
## <none>                  7845.0
## cos_td_rad           41 7860.7
## sin_td_rad           41 7888.3
## site                246 8073.8
## settlements:year_ct  41 7837.8

drop interaction of settlements with year.

## Single term deletions
## 
## Model:
## spp_no_rare ~ settlements + year_ct + cos_td_rad + sin_td_rad + 
##     site
##              Df    AIC
## <none>          7837.8
## settlements  41 8763.2
## year_ct      41 7854.6
## cos_td_rad   41 7853.2
## sin_td_rad   41 7884.2
## site        246 8051.7

final model includes settlements, year, sampling time of year and site.

## 
## Coefficients: (2 not defined because of singularities)
##                 wald value Pr(>wald)    
## (Intercept)            NaN     0.001 ***
## settlementsNear        NaN     0.001 ***
## year_ct                NaN     0.001 ***
## cos_td_rad             NaN     0.001 ***
## sin_td_rad             NaN     0.001 ***
## siteAderet             NaN     0.001 ***
## siteBeit Yatir         NaN     0.001 ***
## siteDvir               NaN     0.001 ***
## siteHar Amasa          NaN     0.001 ***
## siteLahav              NaN     0.001 ***
## siteLehavim            NaN     0.001 ***
## siteMeitar             NaN     0.001 ***
## siteMirsham            NaN     0.001 ***
## --- 
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Test statistic:    NaN, p-value: 0.001 
## Arguments:
##  Test statistics calculated assuming response assumed to be uncorrelated 
##  P-value calculated using 999 resampling iterations via pit.trap resampling (to account for correlation in testing).
## Analysis of Deviance Table
## 
## Model: spp_no_rare ~ settlements + year_ct + cos_td_rad + sin_td_rad + site
## 
## Multivariate test:
##             Res.Df Df.diff   Dev Pr(>Dev)    
## (Intercept)    149                           
## settlements    148       1 823.4    0.001 ***
## year_ct        147       1 131.9    0.001 ***
## cos_td_rad     146       1  77.4    0.003 ** 
## sin_td_rad     145       1 147.9    0.002 ** 
## site           139       8 705.3    0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Univariate Tests:
##             Acridotheres.tristis          Alectoris.chukar         
##                              Dev Pr(>Dev)              Dev Pr(>Dev)
## (Intercept)                                                        
## settlements               47.832    0.001            2.828    0.681
## year_ct                   19.477    0.003            1.321    0.999
## cos_td_rad                 1.296    1.000             0.96    1.000
## sin_td_rad                 1.647    0.994            2.553    0.981
## site                      19.206    0.195            8.707    0.955
##             Anthus.similis          Apus.apus          Apus.melba         
##                        Dev Pr(>Dev)       Dev Pr(>Dev)        Dev Pr(>Dev)
## (Intercept)                                                               
## settlements         22.266    0.001     7.183    0.119      0.526    0.977
## year_ct              0.023    1.000     0.214    1.000      0.339    1.000
## cos_td_rad            0.25    1.000     0.569    1.000      1.075    1.000
## sin_td_rad           0.127    1.000     6.432    0.579      8.356    0.292
## site                 7.763    0.955     3.725    0.999     16.079    0.425
##             Apus.pallidus          Bubulcus.ibis          Burhinus.oedicnemus
##                       Dev Pr(>Dev)           Dev Pr(>Dev)                 Dev
## (Intercept)                                                                  
## settlements         0.628    0.977         0.692    0.977                   0
## year_ct             2.015    0.985         0.082    1.000               0.071
## cos_td_rad          4.193    0.810         0.041    1.000               2.905
## sin_td_rad         13.679    0.035         5.666    0.677                0.04
## site               13.342    0.637         9.626    0.949               6.807
##                      Cecropis.daurica          Chloris.chloris         
##             Pr(>Dev)              Dev Pr(>Dev)             Dev Pr(>Dev)
## (Intercept)                                                            
## settlements    0.977           32.021    0.001          46.076    0.001
## year_ct        1.000            0.056    1.000           1.089    0.999
## cos_td_rad     0.957            0.392    1.000           1.852    0.991
## sin_td_rad     1.000            2.531    0.981           0.108    1.000
## site           0.959           25.448    0.046          17.316    0.314
##             Cinnyris.osea          Columba.livia          Corvus.cornix
##                       Dev Pr(>Dev)           Dev Pr(>Dev)           Dev
## (Intercept)                                                            
## settlements        41.406    0.001            53    0.001        50.914
## year_ct             8.852    0.129         0.485    1.000         1.249
## cos_td_rad          2.182    0.987         5.339    0.638         0.092
## sin_td_rad          4.529    0.820         3.444    0.943         1.206
## site               18.567    0.227        13.558    0.637        35.867
##                      Corvus.monedula          Curruca.conspicillata         
##             Pr(>Dev)             Dev Pr(>Dev)                   Dev Pr(>Dev)
## (Intercept)                                                                 
## settlements    0.001           9.184    0.052                57.418    0.001
## year_ct        0.999            1.44    0.996                 4.035    0.785
## cos_td_rad     1.000           4.401    0.788                 2.186    0.987
## sin_td_rad     0.998           2.638    0.980                 0.063    1.000
## site           0.005          37.938    0.004                 3.439    0.999
##             Curruca.melanocephala          Delichon.urbicum         
##                               Dev Pr(>Dev)              Dev Pr(>Dev)
## (Intercept)                                                         
## settlements                   5.2    0.340            3.584    0.589
## year_ct                     3.848    0.807             4.47    0.731
## cos_td_rad                  6.546    0.444            0.019    1.000
## sin_td_rad                  3.425    0.943            3.626    0.943
## site                       45.442    0.003            8.947    0.955
##             Emberiza.calandra          Emberiza.hortulana         
##                           Dev Pr(>Dev)                Dev Pr(>Dev)
## (Intercept)                                                       
## settlements             0.961    0.958              8.751    0.057
## year_ct                 0.711    1.000              3.297    0.884
## cos_td_rad                  0    1.000              0.284    1.000
## sin_td_rad              2.395    0.983             13.624    0.035
## site                   25.485    0.046              7.204    0.959
##             Falco.naumanni          Falco.tinnunculus         
##                        Dev Pr(>Dev)               Dev Pr(>Dev)
## (Intercept)                                                   
## settlements          0.312    0.977             1.443    0.902
## year_ct              1.693    0.994             0.071    1.000
## cos_td_rad           0.184    1.000             0.099    1.000
## sin_td_rad           0.669    1.000             0.571    1.000
## site                21.251    0.141             4.163    0.999
##             Galerida.cristata          Garrulus.glandarius         
##                           Dev Pr(>Dev)                 Dev Pr(>Dev)
## (Intercept)                                                        
## settlements            37.532    0.001              27.928    0.001
## year_ct                16.713    0.009               6.706    0.334
## cos_td_rad              1.991    0.991               0.526    1.000
## sin_td_rad              0.015    1.000               0.033    1.000
## site                   36.052    0.005              11.095    0.860
##             Hirundo.rustica          Lanius.senator          Merops.apiaster
##                         Dev Pr(>Dev)            Dev Pr(>Dev)             Dev
## (Intercept)                                                                 
## settlements            0.06    0.977          7.661    0.099             0.2
## year_ct               8.685    0.135          2.843    0.935           0.624
## cos_td_rad            5.478    0.622          3.773    0.856           0.004
## sin_td_rad           17.355    0.007          0.389    1.000           1.825
## site                 12.336    0.751          2.956    0.999           8.767
##                      Oenanthe.hispanica.melanoleuca          Parus.major
##             Pr(>Dev)                            Dev Pr(>Dev)         Dev
## (Intercept)                                                             
## settlements    0.977                          2.775    0.687      22.544
## year_ct        1.000                          0.302    1.000       0.071
## cos_td_rad     1.000                          3.944    0.840       0.032
## sin_td_rad     0.994                          0.579    1.000       1.946
## site           0.955                         27.468    0.028      23.277
##                      Passer.domesticus          Petronia.petronia         
##             Pr(>Dev)               Dev Pr(>Dev)               Dev Pr(>Dev)
## (Intercept)                                                               
## settlements    0.001            34.617    0.001              8.64    0.070
## year_ct        1.000            12.018    0.040              0.35    1.000
## cos_td_rad     1.000             0.013    1.000             3.376    0.906
## sin_td_rad     0.994             9.288    0.209             0.823    1.000
## site           0.080            20.032    0.182            16.089    0.425
##             Prinia.gracilis          Pycnonotus.xanthopygos         
##                         Dev Pr(>Dev)                    Dev Pr(>Dev)
## (Intercept)                                                         
## settlements            3.78    0.574                 24.463    0.001
## year_ct               1.108    0.999                  4.364    0.733
## cos_td_rad            4.335    0.798                  0.676    1.000
## sin_td_rad            0.113    1.000                  0.087    1.000
## site                  19.33    0.195                 22.526    0.093
##             Scotocerca.inquieta          Serinus.serinus         
##                             Dev Pr(>Dev)             Dev Pr(>Dev)
## (Intercept)                                                      
## settlements              13.177    0.007          10.117    0.034
## year_ct                   1.287    0.999           0.404    1.000
## cos_td_rad                2.778    0.966           0.268    1.000
## sin_td_rad                0.615    1.000           0.144    1.000
## site                     20.024    0.182          26.547    0.034
##             Spilopelia.senegalensis          Streptopelia.decaocto         
##                                 Dev Pr(>Dev)                   Dev Pr(>Dev)
## (Intercept)                                                                
## settlements                  68.189    0.001                81.258    0.001
## year_ct                      10.358    0.056                  0.33    1.000
## cos_td_rad                    0.371    1.000                 0.698    1.000
## sin_td_rad                   12.268    0.060                 0.187    1.000
## site                         14.283    0.555                 9.068    0.955
##             Streptopelia.turtur          Sylvia.atricapilla         
##                             Dev Pr(>Dev)                Dev Pr(>Dev)
## (Intercept)                                                         
## settlements              17.901    0.001             11.678    0.015
## year_ct                   5.018    0.628              1.625    0.994
## cos_td_rad                6.524    0.444              2.209    0.987
## sin_td_rad                 0.72    1.000             16.725    0.009
## site                     25.303    0.046             16.367    0.394
##             Turdus.merula          Upupa.epops          Vanellus.spinosus
##                       Dev Pr(>Dev)         Dev Pr(>Dev)               Dev
## (Intercept)                                                              
## settlements         41.91    0.001       0.355    0.977            16.373
## year_ct             3.432    0.880       0.506    1.000              0.33
## cos_td_rad          4.273    0.800       0.095    1.000             1.133
## sin_td_rad          1.973    0.994       5.103    0.746             0.404
## site               15.664    0.431       4.256    0.999            23.939
##                     
##             Pr(>Dev)
## (Intercept)         
## settlements    0.003
## year_ct        1.000
## cos_td_rad     1.000
## sin_td_rad     1.000
## site           0.068
## Arguments:
##  Test statistics calculated assuming uncorrelated response (for faster computation) 
## P-value calculated using 999 iterations via PIT-trap resampling.

All factors (settlements, year, time of year and site) have a statistically significant effect on community composition.

## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## [[1]]

## 
## [[2]]

## 
## [[3]]

## [[1]]

## 
## [[2]]

## 
## [[3]]

Significant negative temporal effect on house sparrow and positive effect on common myna. Significant effect of settlement proximity: synanthrope / invasive species near settlements, endangered and / or batha specialists far from settlements.