SlopeReg.R

lourymigliorelli — Sep 19, 2013, 1:52 PM

install.packages("vegan")
Error: trying to use CRAN without setting a mirror
install.packages("knitr")
Error: trying to use CRAN without setting a mirror
require(vegan)
Loading required package: vegan Loading required package: permute This is
vegan 2.0-8
require(knitr)

env <- read.csv("rs_env_plot.csv")
slope <- read.csv("abun_slope.csv")

head(env)
         Study.Site NDVI.mean NDVI.CV Int.NDVI EVI.mean EVI.CV mean.sla.wt
1  Awaawapuhi Trail      0.81    7.23    182.9     0.38  12.41       8.649
2     Nualolo Trail      0.82    3.93    184.4     0.40  11.50      11.729
3     Milolii Ridge      0.79    8.05    179.8     0.40  13.71      12.489
4     Waimea Canyon      0.79   10.92    174.7     0.47  19.44      18.908
5       Honouliuli       0.80    9.62    178.3     0.47  21.05      28.624
6 Kaluakauila Gulch      0.66   17.75    149.2     0.43  28.95       8.825
  mean.sla.new sum.sla.wt mean.sla.wt.dom mean.sla.dom sum.sla.wt.dom
1        82.22      95.14          12.085        81.17         48.340
2        76.88      93.83          13.670        77.79         68.352
3        76.68      87.42          22.829        86.98         68.487
4        96.90     132.36           9.428        63.52         18.856
5        99.39     143.12           3.288        63.99          6.576
6        98.76      70.60          20.157        71.95         60.472
  mean.sub sum.sub sum.sub.wt Precip Temp Species.Richness Density
1    82.41   741.7      71.49   1823   21               21     245
2    75.57   453.4      71.08   1520   22               13     279
3    74.91   449.5      72.58   1314   20                9     313
4   100.38   501.9     114.15   1452   19               10     166
5    83.70   334.8     129.65   1020   21               12     161
6    85.17   596.2      69.95   1047   22               13     326
  Basal.Area Canopy.Height   NSR Substrate.Age      D common not.singleton
1        4.5          7.11  9.52           4.7 0.8871     98           175
2        6.3          8.37 15.38           4.7 0.8318    189           268
3        2.5          8.88 22.22           4.7 0.6793    227           275
4        3.8          9.82 60.00           4.7 0.7876      1           109
5        3.6          9.44 33.33           3.0 0.7085      4           148
6        2.1          5.98 46.15           3.0 0.4328    249           303
  pca.structure indiv    comp Evenness    H. Abun.Slope
1        1.1009   250 -0.8639   0.8142 2.479   -0.09163
2        2.4268   278 -0.7366   0.7860 2.016   -0.16200
3        0.9945   283 -0.9894   0.6881 1.512   -0.23000
4        0.9118   166 -0.3115   0.7691 1.771   -0.20930
5        0.7024   161  0.4703   0.6928 1.722   -0.14550
6        0.2292   326  0.1177   0.4168 1.069   -0.12439
head(slope)
  Abun.Slope
1   -0.09163
2   -0.16200
3   -0.23000
4   -0.20930
5   -0.14550
6   -0.12439
lm(env$Abun.Slope ~ env$Species.Richness)

Call:
lm(formula = env$Abun.Slope ~ env$Species.Richness)

Coefficients:
         (Intercept)  env$Species.Richness  
              -0.400                 0.018  
lm(env$Abun.Slope ~ env$NDVI.mean)

Call:
lm(formula = env$Abun.Slope ~ env$NDVI.mean)

Coefficients:
  (Intercept)  env$NDVI.mean  
       -0.411          0.291  
lm(env$Abun.Slope ~ env$Substrate.Age)

Call:
lm(formula = env$Abun.Slope ~ env$Substrate.Age)

Coefficients:
      (Intercept)  env$Substrate.Age  
          -0.2659             0.0206  
lm(env$Abun.Slope ~ env$Precip)

Call:
lm(formula = env$Abun.Slope ~ env$Precip)

Coefficients:
(Intercept)   env$Precip  
  -0.401982     0.000169  
lm(env$Abun.Slope ~ env$Temp)

Call:
lm(formula = env$Abun.Slope ~ env$Temp)

Coefficients:
(Intercept)     env$Temp  
   -0.09553     -0.00599  
mod = lm(env$Abun.Slope ~ env$Species.Richness+env$NDVI.mean+env$Substrate.Age+env$Precip+env$Temp)
adonis(slope~NDVI.mean+Precip+pca.structure+Species.Richness+Substrate.Age, env, perm = 9999, method="bray")
Warning: results may be meaningless because data have negative entries in
method "bray"

Call:
adonis(formula = slope ~ NDVI.mean + Precip + pca.structure +      Species.Richness + Substrate.Age, data = env, permutations = 9999,      method = "bray") 

Terms added sequentially (first to last)

                 Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
NDVI.mean         1         0       0                  
Precip            1         0       0                  
pca.structure     1         0       0                  
Species.Richness  1         0       0                  
Substrate.Age     1         0       0                  
Residuals         8         0       0                  
Total            13         0                          
adonis(slope~Precip+Temp+Species.Richness+Substrate.Age, env, perm = 9999, method="bray")
Warning: results may be meaningless because data have negative entries in
method "bray"

Call:
adonis(formula = slope ~ Precip + Temp + Species.Richness + Substrate.Age,      data = env, permutations = 9999, method = "bray") 

Terms added sequentially (first to last)

                 Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Precip            1         0       0                  
Temp              1         0       0                  
Species.Richness  1         0       0                  
Substrate.Age     1         0       0                  
Residuals         9         0       0                  
Total            13         0                          
adonis(slope~Species.Richness+Substrate.Age, env, perm = 9999, method="bray")
Warning: results may be meaningless because data have negative entries in
method "bray"

Call:
adonis(formula = slope ~ Species.Richness + Substrate.Age, data = env,      permutations = 9999, method = "bray") 

Terms added sequentially (first to last)

                 Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Species.Richness  1         0       0                  
Substrate.Age     1         0       0                  
Residuals        11         0       0                  
Total            13         0