Commit cee3ce1b authored by peguerin's avatar peguerin
Browse files

underlying data model

parent 9c4935d1
...@@ -133,6 +133,19 @@ modAutocovF=lm(acinv2a~SST+nb_species+nb_indv_mean+regions+Alt+SlopeAvg,data= en ...@@ -133,6 +133,19 @@ modAutocovF=lm(acinv2a~SST+nb_species+nb_indv_mean+regions+Alt+SlopeAvg,data= en
## residuals (part of spatial autocorrelation not explained by the model) ## residuals (part of spatial autocorrelation not explained by the model)
autocor=residuals(modAutocovF) autocor=residuals(modAutocovF)
## underlying data fig 3c
underlying_data_fig3c=data.frame(
x=env2$x,
y=env2$y,
mean_genetic_diversity=env2$GD_mean,
regional_temperature=env2$SST,
regions=env2$regions,
number_of_species=env2$nb_species,
number_of_sequences=env2$nb_indv_mean,
autocor=autocor
)
write.table(underlying_data_fig3c,"14-tables/figure_3c_underlying_data.tsv",col.names=T,row.names=F,sep="\t")
########################################################################## ##########################################################################
## step AIC with term of spatial autocorrelation ## step AIC with term of spatial autocorrelation
...@@ -172,7 +185,7 @@ p_ic_F=p_ic_F+theme(plot.title = element_text(size = 24), ...@@ -172,7 +185,7 @@ p_ic_F=p_ic_F+theme(plot.title = element_text(size = 24),
panel.border=element_rect(fill=NA,size=1), panel.border=element_rect(fill=NA,size=1),
panel.background = element_blank())+ggtitle("(c)") panel.background = element_blank())+ggtitle("(c)")
## underlying data ## underlying data
sink("14-tables/figure_3c_underlying_data.tsv") sink("13-analysis/freshwater_summary_lm.txt")
print(summary(modclimF.autof)) print(summary(modclimF.autof))
sink() sink()
...@@ -259,6 +272,18 @@ dcM.r4<-data.frame(x=dcM.r3$x, ...@@ -259,6 +272,18 @@ dcM.r4<-data.frame(x=dcM.r3$x,
### Missing value distance to the coast : 2 missing values ### Missing value distance to the coast : 2 missing values
dcM.r4$distanceFromShore[c(139,337)]=mean(na.omit(dcM.r4)$distanceFromShore) dcM.r4$distanceFromShore[c(139,337)]=mean(na.omit(dcM.r4)$distanceFromShore)
underlying_data_fig3a=data.frame(
x=dcM.r4$x,
y=dcM.r4$y,
mean_genetic_diversity=dcM.r4$GD_mean,
sea_surface_temperature=dcM.r4$SST,
regions=dcM.r4$regions,
number_of_species=dcM.r4$nb_species,
number_of_sequences=dcM.r4$nb_indv_mean
)
write.table(underlying_data_fig3a,"14-tables/figure_3a_underlying_data.tsv",col.names=T,row.names=F,sep="\t")
########################################################################## ##########################################################################
## Selection top 200 cells ## Selection top 200 cells
...@@ -333,7 +358,7 @@ p_ic_M=p_ic_M+theme(plot.title = element_text(size = 24), ...@@ -333,7 +358,7 @@ p_ic_M=p_ic_M+theme(plot.title = element_text(size = 24),
panel.border=element_rect(fill=NA,size=1), panel.border=element_rect(fill=NA,size=1),
panel.background = element_blank())+ggtitle("(a)") panel.background = element_blank())+ggtitle("(a)")
## underlying data ## underlying data
sink("14-tables/figure_3a_underlying_data.tsv") sink("13-analysis/marine_summary_lm.txt")
print(summary(modclimM.autof)) print(summary(modclimM.autof))
sink() sink()
......
Call:
lm(formula = GD_mean ~ SST + scale(SlopeAvg) + regions + scale(autocor) +
nb_species + nb_indv_mean, data = env2)
Residuals:
Min 1Q Median 3Q Max
-2.77334 -0.53425 0.04287 0.58127 2.23167
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.602047 0.150004 -4.014 7.37e-05 ***
Mean regional\ntemperature 0.134435 0.058521 2.297 0.0222 *
Average slope -0.225852 0.050788 -4.447 1.18e-05 ***
Regions 0.121156 0.028227 4.292 2.31e-05 ***
Autocor 0.237272 0.048076 4.935 1.26e-06 ***
Number of species 0.004486 0.005001 0.897 0.3703
Number of sequences 0.020028 0.048674 0.411 0.6810
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.893 on 339 degrees of freedom
Multiple R-squared: 0.2081, Adjusted R-squared: 0.1941
F-statistic: 14.85 on 6 and 339 DF, p-value: 4.382e-15
Call:
lm(formula = GD_mean ~ SST + regions + scale(autocor) + nb_species +
nb_indv_mean, data = dcM.r4)
Residuals:
Min 1Q Median 3Q Max
-3.1807 -0.5386 -0.0072 0.5799 3.5761
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.138762 0.061680 -2.250 0.02489 *
Sea surface\ntemperature 0.341185 0.040324 8.461 2.84e-16 ***
Regions 0.221148 0.082181 2.691 0.00736 **
Autocor 0.076247 0.040835 1.867 0.06245 .
Number of species 0.002905 0.001370 2.120 0.03450 *
Number of sequences -0.083582 0.043620 -1.916 0.05591 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9249 on 508 degrees of freedom
Multiple R-squared: 0.168, Adjusted R-squared: 0.1598
F-statistic: 20.51 on 5 and 508 DF, p-value: < 2.2e-16
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment