diff --git a/news/index.html b/news/index.html index 863a94e..47956d9 100644 --- a/news/index.html +++ b/news/index.html @@ -34,7 +34,7 @@

Changelog

-

douconca 1.2.1

+

douconca 1.2.1

CRAN release: 2024-09-25

diff --git a/pkgdown.yml b/pkgdown.yml index a91188e..bdd0db5 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,4 +3,4 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: douconca: douconca.html -last_built: 2024-09-25T07:32Z +last_built: 2024-10-22T11:41Z diff --git a/search.json b/search.json index e85d5cc..aa44266 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"/articles/douconca.html","id":"the-douconca-package","dir":"Articles","previous_headings":"","what":"The douconca package","title":"douconca","text":"aim douconca package help ecologists unravel trait-environment relationships abundance data table associated multi-trait multi-environment data tables. popular method aim RLQ (Dolédec et al. 1996; Dray et al. 2014), also three-tables method. RLQ available R-package ade4(Dray Dufour 2007; Thioulouse et al. 2018). douconca package provides alternative method, termed double-constrained correspondence analysis (dc-CA), natural extension commonly used method community-weighted means (CWMs) regression (Ter Braak, Šmilauer, Dray 2018; Kleyer et al. 2012). dc-CA based regression analysis ordination (factorial analysis), allows usual forms testing, model building, biplots resulting scores. number recent applications also contain discussion value dc-CA compared RLQ (Peng et al. 2021; Gobbi et al. 2022; Pinho et al. 2021), summarized document ResearchGate. douconca package formula-interface specify dc-CA model, scores, anova, plot predict functions, mostly fairly similar vegan package (Oksanen et al. 2024) douconca based.","code":""},{"path":"/articles/douconca.html","id":"double-constained-correspondence-analysis","dir":"Articles","previous_headings":"","what":"Double constained correspondence analysis","title":"douconca","text":"RLQ, dc-CA seeks ordination (.e. low-dimensional representation ) multi-trait, multi-environment relationships, dc-CA differs RLQ dc-CA based regression traits environmental variables predictors, whereas RLQ based co-variance. dc-CA method thus allows variation-partitioning type model-building familiar users regression analysis, whereas RLQ . dc-CA axis consists two regression models (linear combinations), one traits environmental predictors, fitted values can thought composite trait composite environmental gradient. response variables regressions species niche centroids CWMs composites. circularity typical eigenvalue ordination method. linear combinations maximizes fourth-corner correlation composite trait composite environmental gradient. dc-CA eigenvalues squared fourth-corner correlations, also variances, namely amounts variation abundance data consecutive axes explain (Ter Braak, Šmilauer, Dray 2018). Statistical testing max test (Ter Braak, Cormont, Dray 2012), evaluated extensive simulation (Ter Braak 2019). test combines two permutations tests, one permuting sites permuting species, maximum P-value final P-value. vegan package, permutations specified via permute package (Simpson 2022), allow analysis hierarchical nested data designs (Gobbi et al. 2022). douconca, dc-CA models specified two formulas: formula sites (rows) environmental predictors formula species (columns) trait predictors, may contain factors, quantitative variables transformations thereof, interactions, like (generalized) linear regression model. formulas specify constraints applied site species scores; without constraints dc-CA simply correspondence analysis. double constrained version principal components analysis also exists available Canoco software (Ter Braak Šmilauer 2018), less appeal ecological applications lacks ecological realism, ease interpretation link methods, CWM-regression fourth-corner correlation analysis, proven useful trait-based ecology.","code":""},{"path":"/articles/douconca.html","id":"example-data-and-questions","dir":"Articles","previous_headings":"","what":"Example data and questions","title":"douconca","text":"use dune_trait_env data package illustrate dc-CA. consists abundances 28 plant species 20 meadows (plots, called sites), trait data plant species environmental data sites. five morphological traits (LEDA trait database) four ecological traits (Ellenberg indicator values moisture, acidity, nutrients light). five environmental variables two sets two spatial coordinates, approximately equal. X Y coordinates plot. lot-variables center meadow sample taken. type questions dc-CA able address : many dimenstions needed represent major part trait-environment relations? trait-environment relationship statistically significant? many dimensions statistically significant? importance variable dc-CA axis? trait-structured variation trait sets larger variation? trait sets (morphological versus ecological) closely related environmental variables?","code":"library(douconca) data(\"dune_trait_env\") names(dune_trait_env) #> [1] \"comm\" \"traits\" \"envir\" dim(dune_trait_env$comm[, -1]) ## without the variable \"Sites\" #> [1] 20 28 dim(dune_trait_env$traits) #> [1] 28 11 dim(dune_trait_env$envir) #> [1] 20 10 names(dune_trait_env$traits) #> [1] \"Species\" \"Species_abbr\" \"SLA\" \"Height\" \"LDMC\" #> [6] \"Seedmass\" \"Lifespan\" \"F\" \"R\" \"N\" #> [11] \"L\" names(dune_trait_env$envir) #> [1] \"Sites\" \"A1\" \"Moist\" \"Mag\" \"Use\" \"Manure\" \"X\" \"Y\" #> [9] \"X_lot\" \"Y_lot\""},{"path":"/articles/douconca.html","id":"basic-analysis","dir":"Articles","previous_headings":"Example data and questions","what":"Basic analysis","title":"douconca","text":"next code gives basic dc-CA analysis. response matrix data frame must numerical, columns representing species. first variable (Sites) must therefore deleted. douconca, dc-CA calculated two steps provide useful information . Step 1 dc-CA algorithm summarizes canonical correspondence analysis (CCA) transposed response matrix trait data using formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan. morphological traits formula explain 28.85% total inertia (variance) abundance data Y. inertia (0.6776) called trait-structured variation. Inertia general weighted variance, case thus unweighted sites equal weight analysis, divideBySiteTotals true defaults. Formally, total (unweighted) variance community weighted means orthonormalized traits (traits orthonormalized Step 1). trait-structured variation analyzed Step 2 using redundancy analysis (RDA). Step 2 shows 65.73% variation can explained environmental variables using formulaEnv = ~ A1 + Moist + Use + Manure + Mag. constrained axes RDA also dc-CA eigenvalues: first axis explains 53% trait-environment variance axis dominated moisture SLA Seedmass, judged size regression coefficient (optimistic) t-value axis print model. default plot shows intra-set correlations variables axis, t-values can visualized ","code":"Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" mod <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Use + #> Manure + Mag, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" mod$eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 plot(mod,gradient_description = \"t\")"},{"path":"/articles/douconca.html","id":"statistical-testing","dir":"Articles","previous_headings":"Example data and questions","what":"Statistical testing","title":"douconca","text":"two-ways statistically test model: (1) omnibus test (using five dimensions) obtained anova(mod), giving P-value 0.02 (2) test per dc-CA axis, obtained test per axis, first axis P-values 0.09 0.001 species- site-level, respectively, P-value max test 0.09. little explanation may instructive. species-level test consists testing (weighted) regression species-niche-centroids respect orthonormalized environmental variables traits. site-level test consists testing (case, unweighted) regression community-weighted means orthonormalized traits environmental variables. tests carried permutation, first permuting species trait data, second permuting sites environmental data. new dc-CA carried permuted data set. full description see Details help system.","code":"set.seed(1) anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.087 . #> dcCA2 1 0.10903 0.082419 2.7336 0.476 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.816 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.075 . #> dcCA3 1 0.059336 0.08757 3.5776 0.409 #> dcCA4 1 0.037919 0.05596 2.2863 0.676 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.087 . #> dcCA2 1 0.10903 0.082419 2.7336 0.476 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.816 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1"},{"path":"/articles/douconca.html","id":"fitted-values-and-predictions","dir":"Articles","previous_headings":"Example data and questions","what":"Fitted values and predictions","title":"douconca","text":"three kinds fitted values (predictions new data): fitted traits per site, obtained predict(mod, type = \"traits\" ) fitted environmental values per species, obtained predict(mod, type = \"env\") fitted abundances, obtained predict(mod, type = \"response\" ) fitted traits per site simply fitted community-weighted means fitted environmental values fitted species-niche centroids. Note 10% fitted abundance values negative example. Negative values indicate likely absences low abundance values species specified traits environmental values.","code":""},{"path":"/articles/douconca.html","id":"which-set-of-traits-is-most-closely-related-to-abundance-and-to-the-environment","dir":"Articles","previous_headings":"","what":"Which set of traits is most closely related to abundance and to the environment?","title":"douconca","text":"section, pose question whether set morphological (functional) traits less related species abundance environmental variables set ecological traits. entry traits_explain 0.87, variance abundance data explained traits. can directly compared corresponding entry previous model, 0.678. entry constraintsTE variance abundance data explained traits environmental variables jointly. value second model higher first. closer examination results, second eigenvalue last model even higher first one first model , indeed, first two dc-CA axes significant can seen anova: fourth-corner correlation best linear combination ecological traits best linear combination environmental variables compared 0.49 best linear combination morphological traits. conclusion, ecological traits explain abundance data closer related environmental variables.","code":"mod_e <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ F + R + N + L, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ F + R + N + L, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.8701 0.3704 4 #> Unconstrained 1.4789 0.6296 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.4771 0.3122 0.0580 0.0228 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.27842 0.24457 0.18230 0.16241 0.14740 0.09916 0.09167 0.06649 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Manure + #> Use + Mag, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.8701 1.0000 #> Constrained 0.6331 0.7277 4 #> Unconstrained 0.2369 0.2723 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.3684 0.2452 0.0141 0.0054 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.14787 0.06377 0.01573 0.00954 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 0.1527 1.3122 #> Moist 2.90 7.8613 1.7658 0.4584 3.8618 #> Manure 1.75 6.4614 9.3847 0.0243 0.0888 #> Use 1.90 3.4351 1.7825 0.0886 0.7432 #> MagBF 0.15 1.5969 4.5016 -0.0086 -0.0452 #> MagHF 0.25 1.9365 2.6715 0.0136 0.0930 #> MagNM 0.30 2.0494 9.5666 0.1136 0.4110 #> Avg SDS VIF Regr1 tval1 #> F 6.1126 1.6685 1.1323 0.8158 6.0720 #> R 5.8061 1.1894 1.7564 -0.1812 -1.0830 #> N 5.1674 1.6303 1.7822 -0.1905 -1.1304 #> L 7.3839 0.8774 1.1378 0.3043 2.2594 #> #> weighted variance #> total 2.349 #> traits_explain 0.870 #> constraintsTE 0.633 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod_e, by = \"axis\")$max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~F + R + N + L, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the community-level test: #> Residualized response permutation using vegan::rda #> which performs well in this equi-weight case. #> #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.36835 0.42337 23.3220 0.002 ** #> dcCA2 1 0.24525 0.28188 15.5276 0.017 * #> dcCA3 1 0.01413 0.01624 0.8944 0.996 #> dcCA4 1 0.00541 0.00622 0.3427 1.000 #> Residual 15 0.23691 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 round(sqrt(mod_e$eigenvalues[1]), 2) #> dcCA1 #> 0.61"},{"path":"/articles/douconca.html","id":"do-the-morphological-traits-contribute-after-accounting-for-the-ecological-traits","dir":"Articles","previous_headings":"","what":"Do the morphological traits contribute after accounting for the ecological traits?","title":"douconca","text":"morphological traits carry important additional information species (beyond ecological traits) understanding species occur ? (.e. understanding species-environment relationships). address question, specify ecological traits Condition trait formula perform anova resulting model. jugded test significance axes, morphological traits contribute little.","code":"mod_mGe <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan + Condition(F+R+N+L), response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) anova(mod_mGe, by= \"axis\")$max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan + Condition(F + R + N + L), response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.09333 0.135306 3.4800 0.183 #> dcCA2 1 0.07101 0.102951 2.6479 0.280 #> dcCA3 1 0.03381 0.049017 1.2607 0.837 #> dcCA4 1 0.00629 0.009115 0.2344 1.000 #> dcCA5 1 0.00259 0.003761 0.0967 1.000 #> Residual 18 0.48274"},{"path":[]},{"path":"/articles/douconca.html","id":"introduction","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"Introduction","title":"douconca","text":"CWM regression know suffer serious type error inflation statistical testing (Peres-Neto, Dray, Ter Braak 2017; Lepš De Bello 2023). section shows perform CWM regression single trait using dc-CA max test guard type error inflation. test suffer , sometimes extreme, conservativeness ZS (Zelený & Schaffers) modified test (Ter Braak, Peres-Neto, Dray 2018; Lepš De Bello 2023). also show equivalence site-level test CWM-regression equivalence dc-CA CWM regression coefficients. way, give examples scores fCWM_SNC functions douconca package.","code":""},{"path":"/articles/douconca.html","id":"testing-the-relationship-between-ldmc-and-the-environmental-variables","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"Testing the relationship between LDMC and the environmental variables","title":"douconca","text":"P-values species-level site-level permutation tests 0.396 0.028, respectively, final P-value 0.396. thus evidence trait LDMC related environmental variables model. now show performing CWM-regression lead opposite conclusion. , first calculate CWMs LDMC, using function fCWM_SNC, arguments similar dc_CA function. result, CWMSNC_LDMC, list containing CWMs LDMC, among items. combine (community-weighted) mean LDMC environmental data, apply linear regresion compare model null model using anova. resulting P-value 0.0279, agreement P-value site-level permutation test model. CWM-regression LDMC shows evidence relationship environmental variables whereas fact little evidence shown dc-CA.","code":"mod_LDMC <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) anova(mod_LDMC) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 1 0.05605 0.042368 1.1503 0.396 #> Residual 26 1.26686 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.056048 0.67074 3.4922 0.028 * #> Residual 12 0.027513 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 1 0.05605 0.042368 1.1503 0.396 #> Residual 26 1.26686 CWMSNC_LDMC <- fCWM_SNC(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) envCWM <- cbind(dune_trait_env$envir, CWMSNC_LDMC$CWM) lmLDMC <- lm(LDMC ~ A1 + Moist + Manure + Use + Mag, data = envCWM) anova(lmLDMC, lm(LDMC ~ 1, data = envCWM)) #> Analysis of Variance Table #> #> Model 1: LDMC ~ A1 + Moist + Manure + Use + Mag #> Model 2: LDMC ~ 1 #> Res.Df RSS Df Sum of Sq F Pr(>F) #> 1 12 2771.8 #> 2 19 8418.3 -7 -5646.5 3.4922 0.0279 * #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1"},{"path":"/articles/douconca.html","id":"the-coefficients-of-a-cwm-regression-are-proportional-to-those-of-dc-ca","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"The coefficients of a CWM-regression are proportional to those of dc-CA","title":"douconca","text":"introduction said dc-CA extends CWM-regression multiple traits. now show regression coefficients issued dc-CA single trait , scaling constant, identical linear CWM-regression trait. first extract regression coefficients dc-CA model using scores function. second line calculates regression coefficients dividing standardize regression coefficients dc_CA standard deviation environmental variable. result shows two sets coefficients equal constant proportionality, 154.4359. t-values also equal:","code":"(regr_table <- scores(mod_LDMC, display = \"reg\")) #> Avg SDS VIF dcCA1 #> A1 4.85 9.498947 1.696694 -0.16636060 #> Moist 2.90 7.861298 1.765817 -0.02346540 #> Manure 1.75 6.461424 9.384723 0.78784718 #> Use 1.90 3.435113 1.782458 -0.33963301 #> MagBF 0.15 1.596872 4.501582 0.25168168 #> MagHF 0.25 1.936492 2.671474 0.09905591 #> MagNM 0.30 2.049390 9.566575 0.71778929 #> attr(,\"meaning\") #> [1] \"mean, sd, VIF, standardized regression coefficients.\" coefs_LDMC_dcCA <- regr_table[, \"dcCA1\"] / regr_table[, \"SDS\"] range(coef(lmLDMC)[-1] / coefs_LDMC_dcCA) #> [1] 154.4359 154.4359 cbind(summary(lmLDMC)$coefficients[-1, \"t value\", drop = FALSE], scores(mod_LDMC, display = \"tval\")) #> t value dcCA1 #> A1 -1.2978033 -1.2978033 #> Moist -0.1794383 -0.1794383 #> Manure 2.6133127 2.6133127 #> Use -2.5849991 -2.5849991 #> MagBF 1.2053943 1.2053943 #> MagHF 0.6158360 0.6158360 #> MagNM 2.3581903 2.3581903"},{"path":[]},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Cajo J.F ter Braak. Author. Bart-Jan van Rossum. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"ter Braak C, van Rossum B (2024). douconca: Double Constrained Correspondence Analysis Trait-Environment Analysis Ecology. R package version 1.2.1, https://github.com/Biometris/douconca.","code":"@Manual{, title = {douconca: Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology}, author = {Cajo J.F {ter Braak} and Bart-Jan {van Rossum}}, year = {2024}, note = {R package version 1.2.1}, url = {https://github.com/Biometris/douconca}, }"},{"path":"/index.html","id":"douconca","dir":"","previous_headings":"","what":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","title":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","text":"R library douconca analyzes multi-trait multi-environment ecological data double constrained correspondence analysis (ter Braak et al. 2018) using vegan native R code. formula interface trait- (column-) environment- (row-) models, allows assess, example, importance trait interactions shaping ecological communities. Throughout two step algorithm ter Braak et al. (2018) used. algorithm combines extends community- (sample-) species-level analyses, .e. usual community weighted means (CWM)-based regression analysis species-level analysis species-niche centroids (SNC)-based regression analysis. CWM regressions specified environmental formula SNC regressions specified trait formula. dcCA finds environmental trait gradients optimize regressions. first step uses cca (Oksanen et al. 2022) regress transposed abundance data traits (weighted) redundancy analysis regress community-weighted means (CWMs) orthonormalized traits, obtained first step, environmental predictors. sample total abundance data used weights. redundancy analysis carried using rda sites equal weights (division rows total) , general weighted case, using wrda. Division sample total advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted, may give puzzling difference common univariate multivariate analysis. Reference: ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. https://doi.org/10.1007/s10651-017-0395-x","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","text":"can install development version douconca like :","code":"install.packages(\"remotes\") remotes::install_github(\"CajoterBraak/douconca\")"},{"path":"/reference/anova.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"anova.dcca performs community- species-level permutation tests dc-CA combines 'max test', takes maximum P-values. function arguments similar (restrictive ) anova.cca.","code":""},{"path":"/reference/anova.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"","code":"# S3 method for class 'dcca' anova(object, ..., permutations = 999, by = c(\"omnibus\", \"axis\"))"},{"path":"/reference/anova.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"object object dc_CA. ... unused. permutations list control values permutations species sites (species first, sites second, traits environment) returned function , number permutations required (default 999, two-vector number species-level test first sites-level second), list two permutation matrices (, species first, sites second) row gives permuted indices. character \"axis\" performs series tests, one axis, eigenvalue axis test statistic. Default: NULL sets test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA. interpretation inertia , species-level, environmentally constrained inertia explained traits (without trait covariates) , community-level, trait-constrained inertia explained environmental predictors (without covariates). default (NULL) computationally quicker avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"list 3 structures anova.cca. elements c(\"species\", \"sites\", \"max\")","code":""},{"path":"/reference/anova.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"general case varying site abundance totals (divideBySiteTotals = FALSE) community-level test species-level test use residualized predictor permutation (ter Braak 2022), ensure anova.dcca robust differences species site total abundance response (ter Braak & te Beest, 2022). community-level test uses anova_sites. species-level test, anova_species used. equal site weights, obtained divide..site.total = TRUE, community-level test obtained applying anova object$RDAonEnv using anova.cca. performs residualized response permutation performs equal residualized predictor permutation equi-weight case. function anova.cca implemented C therefore factor 20 quicker native R-code used anova_sites.","code":""},{"path":"/reference/anova.dcca.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0160000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/anova.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Permutation Test for weighted redundancy analysis — anova.wrda","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"anova.wrda performs residual predictor permutation weighted redundancy analysis (wRDA), robust differences weights (ter Braak, 2022). arguments function similar anova.cca, restricted.","code":""},{"path":"/reference/anova.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"","code":"# S3 method for class 'wrda' anova(object, ..., permutations = 999, by = c(\"omnibus\", \"axis\"))"},{"path":"/reference/anova.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"object object dc_CA. ... unused. permutations list control values permutations returned function , number permutations required (default 999), permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue RDA model. Default: NULL sets test statistic weighted variance fitted predictors (=sum constrained eigenvalues). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives wrda eigenvalues.","code":""},{"path":"/reference/anova.wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"algorithm based published R-code residual predictor permutation weighted redundancy analysis (ter Braak, 2022), using QR-decomposition instead ad-hoc least-squares functions.","code":""},{"path":"/reference/anova.wrda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.012 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/anova_sites.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"anova_sites performs community-level permutation test dc-CA site weights vary. test uses residual predictor permutation (ter Braak 2022), robust differences site total abundance response dc_CA (ter Braak & te Beest, 2022). arguments function similar anova.cca, restricted. equal site-totals dc_CA, anova(object$RDAonEnv) much faster.","code":""},{"path":"/reference/anova_sites.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"","code":"anova_sites(object, permutations = 999, by = NULL)"},{"path":"/reference/anova_sites.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"object object dc_CA. permutations list control values permutations returned function , number permutations required (default 999), permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue dc-CA model. Default: NULL sets test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA). trait constrained inertia explained environmental predictors (without covariates), equal environmentally-constrained inertia explained traits (without trait covariates). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova_sites.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives dc-CA eigenvalues.","code":""},{"path":"/reference/anova_sites.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"algorithm analogous anova.wrda. function used anova.dcca.","code":""},{"path":"/reference/anova_sites.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova_sites.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.009 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.002 ** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.009 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.008 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0080000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/anova_species.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"anova_species performs species-level permutation test dc-CA part anova.dcca. test uses residual predictor permutation (ter Braak 2022), robust differences species total abundance response dc_CA (ter Braak & te Beest, 2022). arguments function similar anova.cca, restrictive.","code":""},{"path":"/reference/anova_species.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"","code":"anova_species(object, permutations = 999, by = NULL)"},{"path":"/reference/anova_species.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"object object dc_CA. permutations list control values permutations returned function , number permutations required (default 999) permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue dc-CA model. Default: NULL set test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA). environmentally constrained inertia explained traits (without trait covariates), equal trait-constrained inertia explained environmental predictors (without covariates). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova_species.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives dc-CA eigenvalues. output can used scripting forward selection traits, similar forward selection environmental variables demo dune_select.r.","code":""},{"path":"/reference/anova_species.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"anova_species, first step extracts species-niche centroids (SNC) respect dc-CA ordination axes existing dc-CA analysis. second step, applies weighted redundancy analysis SNCs traits predictors. second step thus species-level analysis, final results (eigenvalues/ordination axes) identical analyses steps dc_CA.second step uses R-code analogous anova.wrda.","code":""},{"path":"/reference/anova_species.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova_species.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.021 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.021 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0160000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.002 ** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/dc_CA.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Double constrained correspondence analysis (dc-CA) analyzing (multi-)trait (multi-)environment ecological data using library vegan native R code. formula interface allows assess, example, importance trait interactions shaping ecological communities. function dc_CA option divide abundance data site site total, giving equal site weights. division advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted (Kleyer et al. 2012).","code":""},{"path":"/reference/dc_CA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"","code":"dc_CA( formulaEnv = NULL, formulaTraits = NULL, response = NULL, dataEnv = NULL, dataTraits = NULL, divideBySiteTotals = TRUE, dc_CA_object = NULL, verbose = TRUE )"},{"path":"/reference/dc_CA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"formulaEnv formula one-sided formula rows (samples) row predictors dataEnv. two-sided, left hand side formula used. Specify row covariates () adding + Condition(covariate-formula) formulaEnv rda. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataEnv predictor variables. formulaTraits formula one-sided formula columns (species) column predictors dataTraits. two-sided, left hand side formula used. Specify column covariates () adding + Condition(covariate-formula) formulaTraits cca. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataTraits predictor traits. response matrix, data frame abundance data (dimension n x m) list community weighted means (CWMs) fCWM_SNC. See Details analyses starting community weighted means. Rownames response, , carried . dataEnv matrix data frame row predictors, rows corresponding response. (dimension n x p). dataTraits matrix data frame column predictors, rows corresponding columns response. (dimension m x q). divideBySiteTotals logical; default TRUE closing data dividing rows response total. dc_CA_object optional object earlier run function. Useful formula columns (formulaTraits), dataTraits response used new formula rows. set, data previous run used result first step taken new analysis. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/dc_CA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"list class dcca; list elements CCAonTraits cca.object cca analysis transpose closed response using formula formulaTraits. formulaTraits argument formulaTraits. formula ~., changed explicit trait names. data list Y, dataEnv dataTraits, removing empty rows columns response closure divideBySiteTotals = TRUE corresponding rows dataEnv dataTraits removed. weights list unit-sum weights row columns. names list c(\"row\", \"columns\"), order. Nobs number sites (rows). CWMs_orthonormal_traits Community weighted means w.r.t. orthonormalized traits. RDAonEnv wrda object cca.object wrda , equal row weights, rda analysis, respectively column scores cca, CWMs orthonormalized traits, using formula formulaEnv. formulaEnv argument formulaEnv. formula ~., changed explicit environmental variable names. eigenvalues dc-CA eigenvalues (rda analysis). c_traits_normed0 mean, sd, VIF (regression) coefficients traits define dc-CA axes terms traits t-ratios missing indicated NAs 'tval1'. inertia one-column matrix four inertias (weighted variances): total: total inertia. conditionT: inertia explained condition formulaTraits present (neglecting row constraints). traits_explain: inertia explained traits (neglecting row predictors condition formulaTraits). maximum row predictors explain dc-CA (sum following two items thus less value). conditionE: trait-constrained inertia explained condition formulaEnv. constraintsTE: trait-constrained inertia explained predictors (without row covariates). verbose TRUE (<- print() invoked) three items. c_traits_normed: mean, sd, VIF (regression) coefficients traits define dc-CA trait axes (composite traits), optimistic t-ratio. c_env_normed: mean, sd, VIF (regression) coefficients environmental variables define dc-CA axes terms environmental variables (composite gradients), optimistic t-ratio. species_axes: list four items species_scores: list names c(\"species_scores_unconstrained\", \"lc_traits_scores\") matrix species niche centroids along dc-CA axes (composite gradients) matrix linear combinations traits. correlation: matrix inter-set correlations traits SNCs. b_se: matrix (unstandardized) regression coefficients traits optimistic standard errors. R2_traits: vector coefficient determination (R2) SNCs traits. square-root thereof called species-trait correlation analogy species-environment correlation CCA. sites_axes: list four items site_scores: list names c(\"site_scores_unconstrained\", \"lc_env_scores\") matrix community weighted means (CWMs) along dc-CA axes (composite gradients) matrix linear combinations environmental variables. correlation: matrix inter-set correlations environmental variables CWMs. b_se: matrix (unstandardized) regression coefficients environmental variables optimistic standard errors. R2_env: vector coefficient determination (R2) CWMs environmental variables. square-root thereof called species-environmental correlation CCA. scores dcca object scaling \"sites\" (1): scaling Focus Case distances .","code":""},{"path":"/reference/dc_CA.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Empty (zero) rows columns response removed response corresponding rows dataEnv dataTraits. Subsequently, columns missing values removed dataEnv dataTraits. gives error ('name_of_variable' found), variables missing entries specified formulaEnv formulaTraits. Computationally, dc-CA can carried single singular value decomposition (ter Braak et al. 2018), computed two steps. first step, transpose response regressed traits (column predictors) using cca formulaTraits. column scores analysis (scaling 1) community weighted means (CWM) orthonormalized traits. regressed environmental (row) predictors using wrda formulaEnv using rda, site weights equal. dc-CA can carried , statisticians call, sufficient statistics method. useful, abundance data available made public paper attempting reproducible research. case, response list first element community weighted means (CWMs) respect traits, trait data, , optionally, elements, functions related dc_CA. minimum list(CWM, weight = list(columns = species_weights)) CWM matrix data.frame, formulaEnv, formulaTraits, dataEnv, dataTraits must specified call dc_CA. function fCWM_SNC example show set response helps create response abundance data non-standard applications dc-CA. Species site weights, set response$weights can set variable weight data frames dataTraits dataEnv, respectively, formulas ~.. statistics scores example dune_dcCA.r, checked results Canoco 5.15 (ter Braak & Šmilauer, 2018).","code":""},{"path":"/reference/dc_CA.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Kleyer, M., Dray, S., Bello, F., Lepš, J., Pakeman, R.J., Strauss, B., Thuiller, W. & Lavorel, S. (2012) Assessing species community functional responses environmental gradients: multivariate methods? Journal Vegetation Science, 23, 805-821. doi:10.1111/j.1654-1103.2012.01402.x ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2024) vegan: Community Ecology Package. R package version 2.6-6.1. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/dc_CA.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.106 #> dcCA2 1 0.10903 0.082419 2.7336 0.501 #> dcCA3 1 0.05934 0.044853 1.4877 0.742 #> dcCA4 1 0.03792 0.028663 0.9507 0.806 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.096 . #> dcCA3 1 0.059336 0.08757 3.5776 0.410 #> dcCA4 1 0.037919 0.05596 2.2863 0.654 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.106 #> dcCA2 1 0.10903 0.082419 2.7336 0.501 #> dcCA3 1 0.05934 0.044853 1.4877 0.742 #> dcCA4 1 0.03792 0.028663 0.9507 0.806 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/douconca-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"Double constrained correspondence analysis (dc-CA) analyzing (multi-)trait (multi-)environment ecological data using library vegan native R code. formula interface allows assess, example, importance trait interactions shaping ecological communities. function dc_CA option divide abundance data site site total, giving equal site weights. division advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted. Throughout two step algorithm ter Braak et al. (2018) used. algorithm combines extends community- (sample-) species-level analyses, .e. (1) usual community weighted means (CWM) regression analysis (2) species-level analysis species-niche centroids (SNC) regression analysis. SNC center realized niche species along environmental variable , case dc-CA, environmental gradient, .e. dc-CA ordination axis. Computationally, dc-CA can carried single singular value decomposition (ter Braak et al. 2018), computed two steps. first step uses canonical correspondence analysis (cca) regress (transposed) abundance data traits second step uses weighed redundancy analysis (wrda , equal site weights, rda) regress CWMs orthonormalized traits, obtained first step, environmental predictors. second step thus community-level analysis. divideBySiteTotals = FALSE, second step uses wrda performs weighted redundancy analysis CWMs environmental variables. Division abundance data site totals advantage resulting analysis (without dimension reduction, .e. retaining dc-CA axes) corresponds series unweighted community-level analyses, instead analyses weighted. Warning: dcCA package built vegan version 2.6-4 uses internal structure vegan cca.object -exported functions f_inertia get_QR source code file functions_using_cca_object_internals.r. main user-functions dc_CA, plot.dcca, scores.dcca, print.dcca anova.dcca.","code":""},{"path":"/reference/douconca-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/douconca-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"Maintainer: Bart-Jan van Rossum bart-jan.vanrossum@wur.nl (ORCID) Authors: Cajo J.F ter Braak cajo.terbraak@wur.nl (ORCID)","code":""},{"path":"/reference/dune_trait_env.html","id":null,"dir":"Reference","previous_headings":"","what":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","title":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","text":"data dune_trait_env contains three data frames abundance data 28 plant species 20 samples (relevés), trait data (9 traits: 5 morphological 4 ecological (Ellenberg indicator values) environmental data (9 environmental variables, four geographic coordinates). Compared data Jongman et al. (1987, 1995), two moss species lacking, traits plant species geographic coordinates samples added. data following description edited version DataKey Jamil2013_AJ data set CESTES database (Jeliazkov et al. 2020). Dune Meadow Data originate MSc thesis report Batterink & Wijffels (1983). consisted 80 relevés 68 dune meadows (lots) island Terschelling Netherlands. subset data selected Caspar Looman example data set edited book Jongman, ter Braak van Tongeren (1987, 1995). subset consists 20 relevés, 28 species (2 mosses, excluded ) 5 environmental variables. trait data taken LEDA database Jamil et al 2013. spatial coordinates retrieved geo-referencing GIS maps Batterink & Wijffels (1993) Ruut Wegman Cajo ter Braak. X, Y coordinates geo-referencing relevé locations Kaart 3a, 3b 3c; X_lot, Y_lot coordinates Kaart 2a, 2b 2c. Ellenberg indicator values see Ellenberg (1992). data dune_trait_env list elements data frames comm: community data; vegetation data. traits: trait data, taken LEDA database. envir: environmental data, taken Jongman et al. (1987,1995). community data collection done Braun-Blanquet method; data recorded according ordinal scale van der Maarel (1979, Vegetatio, 39, 97-114); see pages XVII-XVIII 18 Jongman, ter Braak & van Tongeren 1995. Nomenclature follows Heukels-Van der Meijden (1983) Flora van Nederland, 20th ed. morphological traits SLA:\t Specific Leaf Area Height:\t Canopy height shoot LDMC: \t Lead dry matter content Seedmass:\tSeed mass Lifespan:\tLife span. Nominal; annual vs. perennial ecological traits (habitat requirements) Ellenberg values F:\t Moisture (ranging [1 12] (low high)) R:\t Soil acidity, ranging [1 9] (acidic alkaline) N: \t Nitrogen requirement, ranging [1 9] (low high) L:\t Light requirement, ranging [1 9] (low high) data frame envir contains environmental variables A1: horizon thickness Moist:\tMoisture content soil (five point scale) Mag: Grassland management type Use:\ttype use (Agricultural grassland use (1) hay production (2) intermediate (3) grazing) Manure:\tQuantity manure applied based N P manuring (N/P class B&W 1983) X:\tlongitude\tgeographical coordinates (m) 2x2 m2 sample (relevé) Y:\tlatitude\tgeographical coordinates (m) 2x2 m2 sample (relevé) X_lot:\tlongitude\tgeographical coordinates (m) lot center Y_lot: latitude\tgeographical coordinates (m) lot center management types standard farming (SF), biological farming (BF), hobby farming (HF), nature conservation management (NM). coordinates Rijksdriehoekscoordinaten meters. https://nl.wikipedia.org/wiki/Rijksdriehoekscoordinaten","code":""},{"path":"/reference/dune_trait_env.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","text":"Batterink, M. & Wijffels, G. (1983) Een vergelijkend vegetatiekundig onderzoek naar de typologie en invloeden van het beheer van 1973 tot 1982 de duinweilanden op Terschelling. Landbouwhogeschool. ISN 215909.01. WUR library stacks 704B58. Ellenberg, H. (1992) Indicator values plants Central Europe. Scripta Geobotanica, 18, 258 pp. Jamil, T., Ozinga, W.., Kleyer, M. & ter Braak, C.J.F. (2013) Selecting traits explain species–environment relationships: generalized linear mixed model approach. Journal Vegetation Science, 24, 988-1000. doi:10.1111/j.1654-1103.2012.12036.x . Jeliazkov, ., Mijatovic, D., 78 others. (2020) global database metacommunity ecology, integrating species, traits, environment space. Scientific Data, 7. doi:10.1038/s41597-019-0344-7 . Jongman, R.H.G., ter Braak, C.J.F. & van Tongeren, O.F.R. (1987) Data analysis community landscape ecology. Pudoc, Wageningen. ISBN 90-220-0908-4. Jongman, R.H.G., ter Braak, C.J.F. & van Tongeren, O.F.R. (1995) Data analysis community landscape ecology. Cambridge University Press, Cambridge. ISBN 0-521-47574-0. https://edepot.wur.nl/248017. Kleyer, M., 33 others (2008) LEDA Traitbase: database life-history traits Northwest European flora. Journal Ecology, 96, 1266-1274. doi:10.1111/j.1365-2745.2008.01430.x .","code":""},{"path":"/reference/fCWM_SNC.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"Double constrained correspondence analysis (dc-CA) can calculated directly community weighted means (CWMs), trait data CWMs calculated, environmental data weights species sites (abundance totals species sites). Statistical testing species level requires also species niche centroids (SNCs). function fCWM_SNC calculates CWMs SNCs trait environmental data, respectively, using formula interface, allow categorical traits environmental variables. resulting object can set response argument dc_CA give output call dc_CA abundance data response, least sign changes axes.","code":""},{"path":"/reference/fCWM_SNC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"","code":"fCWM_SNC( response = NULL, dataEnv = NULL, dataTraits = NULL, formulaEnv = NULL, formulaTraits = NULL, divideBySiteTotals = TRUE, dc_CA_object = NULL, minimal_output = TRUE, verbose = TRUE )"},{"path":"/reference/fCWM_SNC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"response matrix, data frame abundance data (dimension n x m) list community weighted means (CWMs) fCWM_SNC. See Details analyses starting community weighted means. Rownames response, , carried . dataEnv matrix data frame row predictors, rows corresponding response. (dimension n x p). dataTraits matrix data frame column predictors, rows corresponding columns response. (dimension m x q). formulaEnv formula one-sided formula rows (samples) row predictors dataEnv. two-sided, left hand side formula used. Specify row covariates () adding + Condition(covariate-formula) formulaEnv rda. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataEnv predictor variables. formulaTraits formula one-sided formula columns (species) column predictors dataTraits. two-sided, left hand side formula used. Specify column covariates () adding + Condition(covariate-formula) formulaTraits cca. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataTraits predictor traits. divideBySiteTotals logical; default TRUE closing data dividing rows response total. dc_CA_object optional object earlier run function. Useful formula columns (formulaTraits), dataTraits response used new formula rows. set, data previous run used result first step taken new analysis. minimal_output logical. Default TRUE use return value response call dc_CA. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/fCWM_SNC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"default returns list CWMs, SNCs, weights, formulaTraits list data elements dataEnv dataTraits. minimal_output = FALSE, many statistics given mainly technical recomputed return value used response call dc_CA.","code":""},{"path":"/reference/fCWM_SNC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"argument formulaTraits determines CWMs calculated. CWMs calculated trait data (non-centered, non-standardized). trait covariates, predictor traits adjusted trait covariates weighted regression, overall weighted mean trait added. advantage CWM scale original trait. SNCs calculated analogously environmental data. Empty (zero) rows columns response removed response corresponding rows dataEnv dataTraits. Subsequently, columns missing values removed dataEnv dataTraits. gives error (object 'name_of_variable' found), variables missing entries specified formulaEnv formulaTraits. current implementation, formulaEnv formulaTraits contain variable names , .e. transformations variables formulas gives error ('undefined columns selected') scores function applied.","code":""},{"path":"/reference/fCWM_SNC.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"Kleyer, M., Dray, S., Bello, F., Lepš, J., Pakeman, R.J., Strauss, B., Thuiller, W. & Lavorel, S. (2012) Assessing species community functional responses environmental gradients: multivariate methods? Journal Vegetation Science, 23, 805-821. doi:10.1111/j.1654-1103.2012.01402.x ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/fCWM_SNC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites CWMSNC <- fCWM_SNC(formulaEnv = ~ A1 + Moist + Manure + Use + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Condition(Seedmass) + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) names(CWMSNC) #> [1] \"CWM\" \"SNC\" \"formulaEnv\" \"formulaTraits\" #> [5] \"weights\" \"call\" \"data\" #CWMSNC$SNC <- NULL # would give correct dc-CA but no species-level t-values or test mod <- dc_CA(response = CWMSNC) # formulas and data are in CWMSNC! #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> NULL #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Manure + #> Use + Condition(Mag), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Conditional 0.1794 0.3512 3 #> Constrained 0.1377 0.2695 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.07351 0.03911 0.02064 0.00442 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> MagBF 0.15 1.5969 4.5016 0.1152 0.7224 #> MagHF 0.25 1.9365 2.6715 0.0658 0.5359 #> MagNM 0.30 2.0494 9.5666 0.0046 0.0199 #> A1 4.85 9.4989 1.6967 0.1562 1.5958 #> Moist 2.90 7.8613 1.7658 0.1492 1.4946 #> Manure 1.75 6.4614 9.3847 0.0320 0.1388 #> Use 1.90 3.4351 1.7825 0.1020 1.0172 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0724 -0.1662 #> SLA 24.6468 6.3438 1.1888 -0.4217 -0.9226 #> Height 25.1272 15.6848 1.3033 0.5546 1.1589 #> LDMC 244.5084 70.9729 1.1791 -0.8979 -1.9726 #> Lifespanperennial 0.9607 0.1944 1.0964 0.3589 0.8176 #> #> weighted variance #> traits_explain 0.511 #> conditionE 0.179 #> constraintsTE 0.138 #> attr(,\"meaning\") #> meaning #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" # note that output also gives the environment-constrained inertia, # which is a bonus compare to the usual way to carry out a dcCA. anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(response = CWMSNC) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 4 0.13769 0.22615 1.6073 0.175 #> Residual 22 0.47115 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 4 0.13769 0.41538 2.1316 0.03 * #> Residual 12 0.19379 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(response = CWMSNC) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 4 0.13769 0.22615 1.6073 0.175 #> Residual 22 0.47115 #>"},{"path":"/reference/getPlotdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"getPlotdata extracts data dc_CA object plotting CWMs SNCs single axis.","code":""},{"path":"/reference/getPlotdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"","code":"getPlotdata( x, axis = 1, envfactor = NULL, traitfactor = NULL, newnames = NULL, facet = TRUE, remove_centroids = FALSE )"},{"path":"/reference/getPlotdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"x results dc_CA class dcca. axis axis number get (default 1). envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. facet logical. Default TRUE CWMs SNCs plots separate panels. FALSE, parameter changes position environmental centroid names (left right). remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids.","code":""},{"path":"/reference/getPlotdata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"list three components CWM_SNC data.frame containing plot data trait_env_scores vector scores per trait/environment newNameList vector new names used plot","code":""},{"path":"/reference/getPlotdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) dat <- getPlotdata(out) names(dat) #> [1] \"CWM_SNC\" \"trait_env_scores\" \"newNameList\" names(dat$CWM_SNC) #> [1] \"dcCA1\" \"score\" \"label\" \"CWM-SNC\" #> [5] \"weight\" \"type\" \"points\" \"sizeweight\" #> [9] \"smoothweight\" \"xforsmooth\" \"groups\" \"names\" #> [13] \"centroidnames\" levels(dat$CWM_SNC$groups) #> [1] \"SF\" \"BF\" \"HF\" \"NM\" \"annual\" \"perennial\" plot(out)"},{"path":"/reference/plot.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"plot.dcca plots CWMs SNCs dc-CA axis axis, optional centroids colors groups sites /species available data.","code":""},{"path":"/reference/plot.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"","code":"# S3 method for class 'dcca' plot( x, ..., axis = 1, gradient_description = \"correlation\", envfactor = NULL, traitfactor = NULL, nspecies = 20, species_groups = NULL, widths = c(5, 1, 1), newnames = NULL, facet = TRUE, remove_centroids = FALSE, with_lines = TRUE, verbose = TRUE )"},{"path":"/reference/plot.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"x results dc_CA class dcca. ... unused. axis axis number get (default 1). gradient_description character 2-character vector trait environmental gradient, respectively specifying plot vertical line plots describe dc-CA axis (trait environmental gradients). Default: correlation intra-set correlations sets variables dc-CA axis. values : c(\"weights\", \"tvalues\", \"inter_set_correlation\") regression weights, t-values inter-set correlation, correlation SNCs CWMs traits environmental variables, respectively. \"regression\" alias \"weights\". envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. nspecies integer. Default 20 including vertical species plot nspecies highest contribution. species_groups name variable dataTraits dc_CA. Default NULL grouping. Species groups colored differentially. widths relative widths CWM-SNC plot, correlation/weight plot species plot. (see grid.arrange). Default c(5, 1, 1). newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. facet logical. Default TRUE CWMs SNCs plots separate panels. parameter changes position centroid names (left right environmental centroids). facet = FALSE with_lines = TRUE, line fits ignore groups species sites. remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids. with_lines logical. Default TRUE straight lines groups points. verbose logical. Default TRUE plotting result.","code":""},{"path":"/reference/plot.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"ggplot object","code":""},{"path":"/reference/plot.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"want set new names, look names arguments default, .e. myplot <- plot(x), consult myplot$nameList$newnames order names traits environmental variables. Note covariates list names. Contribution (definition species selection nspecies) defined (CA) total species abundance (possibly, closed) data multiplied square score axis. plot.dcca returns error \"Error grid.Call\", enlarge plotting area use verbose = FALSE assign result.","code":""},{"path":"/reference/plot.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) dat <- getPlotdata(out) names(dat) #> [1] \"CWM_SNC\" \"trait_env_scores\" \"newNameList\" names(dat$CWM_SNC) #> [1] \"dcCA1\" \"score\" \"label\" \"CWM-SNC\" #> [5] \"weight\" \"type\" \"points\" \"sizeweight\" #> [9] \"smoothweight\" \"xforsmooth\" \"groups\" \"names\" #> [13] \"centroidnames\" levels(dat$CWM_SNC$groups) #> [1] \"SF\" \"BF\" \"HF\" \"NM\" \"annual\" \"perennial\" plot(out)"},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"plot_dcCA_CWM_SNC plots CWMs SNCs dc-CA axis axis, optional centroids colors groups sites /species available data.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"","code":"plot_dcCA_CWM_SNC( x, axis = 1, envfactor = NULL, traitfactor = NULL, facet = TRUE, newnames = NULL, remove_centroids = FALSE, with_lines = TRUE, getPlotdata2plotdCCA = NULL )"},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"x results dc_CA class dcca. axis axis number get (default 1). envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. facet logical. Default TRUE CWMs SNCs plots separate panels. parameter changes position centroid names (left right environmental centroids). facet = TRUE with_lines = TRUE, line fits ignore groups species sites. newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids. with_lines logical. Default TRUE straight lines groups points. traitfactor = NA envfactor = NA. Centroids displayed case. getPlotdata2plotdCCA results getPlotdata. Default NULL.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"ggplot object","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"argument getPlotdata2plotdCCA allow modifications data frame resulting getPlotdata. variable names score levels remain untouched. plot_dcCA_CWM_SNC uses variables: dcCAk axis number k \"CWM-SNC\", \"groups\", \"points\", \"sizeweight\" y-axis, coloring, shape size items, respectively. function used plot.dcca.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) plot_dcCA_CWM_SNC(out, facet = FALSE)"},{"path":"/reference/plot_species_scores_bk.html","id":null,"dir":"Reference","previous_headings":"","what":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"plot_species_scores_bk creates vertical line plot ordination scores selection criterion scores plot names.","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"","code":"plot_species_scores_bk( species_scores, ylab = \"scores\", threshold = 7, y_lab_interval = 0.5, speciesname = NULL, scoresname = \"RDA1\", selectname = \"Fratio1\", speciesgroup = NULL, expand = 0.2, verbose = TRUE )"},{"path":"/reference/plot_species_scores_bk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"species_scores species--scores matrix, data frame row names (species names) tibble variable name speciesname containing species names column variable name scoresname containing scores (default: \"RDA1\"), e.g. species scores library vegan. ylab y-axis label. Default: $b_k$. threshold species criterion (specified selectname) higher threshold displayed. Default: 7 (threshold F-ratio testing single regression coefficient p = 0.01 60 df error multiple regression single species onto condition ordination axis). selectname species_scores, threshold divided 14, default 0.5. y_lab_interval interval y-axis ticks. tick effect (0) always included; default: 0.5. speciesname name variable containing species names (default NULL uses row names). scoresname name column variable containing species scores plotted (default \"RDA1\"). selectname name column variable containing criterion selection species displayed. Default: \"Fratio1\"; selectname found species_scores, set scoresname. speciesgroup name factor, levels receive different colors vertical plot. expand amount extension line plot (default 0.2). verbose logical printing number species names total number (default: TRUE).","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"ggplot object","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"absolute value criterion values taken selection, also species scores ordination can serve criterion (e.g. selectname = \"RDA1\"). function copied PRC package https://github.com/CajoterBraak/PRC. function used plot.dcca.","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) env_scores <- scores(mod, display = \"tval\") env_scores <- data.frame(env_scores) env_scores$group <- c(\"quantitative\", \"category\")[c(1, 1, 2, 2, 2, 1, 1)] plot_species_scores_bk( species_scores = env_scores, ylab = \"optimistic t-values\", threshold = 0, y_lab_interval = 1, scoresname = \"dcCA1\", speciesgroup = \"group\", verbose = FALSE )"},{"path":"/reference/predict.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"Prediction traits environment, environment traits response trait environment data. type = \"traits\" newdata = NULL, predict gives fitted mean traits, .e. fitted community weighted means. type = \"env\" newdata = NULL, predict gives fitted mean environment, .e. fitted species niche centroids.","code":""},{"path":"/reference/predict.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"","code":"# S3 method for class 'dcca' predict( object, ..., type = c(\"env\", \"traits\", \"response\", \"reg_env\", \"reg_traits\"), rank = \"full\", newdata = NULL )"},{"path":"/reference/predict.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"object return value dc_CA. ... arguments passed function (currently ignored). type type prediction, c(\"env\", \"traits\", \"response\", \"reg_env\", \"reg_trait\") environmental values, values traits, response (expected abundance), regression coefficients environmental trait predictors. rank rank number axes use. Default \"full\" axes (rank-reduction). newdata Data look variables predict. type = \"reg_env\" \"reg_trait\" newdata ignored. type = \"env\" \"trait\", newdata data frame trait environmental values, respectively, used prediction. omitted, fitted values generated. type = \"response\", newdata list two data frames trait environmental values order, e.g. list(traits = dataTraits, env = dataEnv).","code":""},{"path":"/reference/predict.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"matrix predictions. exact content matrix depends type predictions made.","code":""},{"path":"/reference/predict.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"Variables model newdata set weighted means training data. Predictions thus (weighted) mean quantitative variables included. Predictions -included factors weighted mean (none factor effects included). type = \"response\" non-null newdata, species weights training used; site weights taken equal. Many predicted values may negative, indicating expected absences (0) small expected response values. Regression coefficients obtained type = \"reg_env\" type = \"reg_traits\" standardized traits environmental variables.","code":""},{"path":"/reference/predict.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Condition(Manure), formulaTraits = ~ SLA + Height + LDMC + Condition(Seedmass) + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Condition(Seedmass) + #> Lifespan, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Condition(Manure), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Conditional 0.1297 0.2538 1 #> Constrained 0.1875 0.3669 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.08709 0.06049 0.02234 0.01755 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 1.75 6.4614 9.3847 -0.2575 -1.0000 #> A1 4.85 9.4989 1.6967 -0.1167 -1.0660 #> Moist 2.90 7.8613 1.7658 -0.2097 -1.8779 #> MagBF 0.15 1.5969 4.5016 -0.1050 -0.5889 #> MagHF 0.25 1.9365 2.6715 -0.1489 -1.0841 #> MagNM 0.30 2.0494 9.5666 -0.2628 -1.0109 #> Use 1.90 3.4351 1.7825 -0.0537 -0.4782 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 0.1752 0.4465 #> SLA 24.6468 6.3438 1.1888 0.6785 1.6471 #> Height 25.1272 15.6848 1.3033 -0.5549 -1.2867 #> LDMC 244.5084 70.9729 1.1791 0.5597 1.3644 #> Lifespanperennial 0.9607 0.1944 1.0964 -0.3820 -0.9656 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> conditionE 0.130 #> constraintsTE 0.187 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" # regression coefficients predict(mod, type = \"reg_env\") #> SLA Height LDMC Lifespanannual Lifespanperennial #> Manure -0.23423414 0.2540139 0.32912396 -0.37130684 0.37130684 #> A1 0.05226663 0.1025887 -0.08560552 -0.12390838 0.12390838 #> Moist -0.18017363 0.1836804 0.04051036 -0.02158823 0.02158823 #> MagBF -0.01504873 0.1005833 0.10645047 -0.25809310 0.25809310 #> MagHF -0.05899194 0.1044629 0.03221358 -0.18057689 0.18057689 #> MagNM -0.29468992 0.1739784 0.33095579 -0.39679946 0.39679946 #> Use -0.04563582 -0.1100948 -0.17509044 0.03719925 -0.03719925 predict(mod, type = \"reg_traits\") #> A1 Moist MagSF MagBF MagHF #> Seedmass -0.02240045 -0.04978638 -0.01023869 0.041848273 0.009631558 #> SLA -0.06845546 -0.16774065 -0.02649254 0.146106902 0.034893995 #> Height 0.15457078 0.15961290 0.02806485 -0.073452767 0.041610702 #> LDMC -0.17828444 -0.10419687 0.01403797 0.005732252 -0.079309518 #> Lifespanperennial 0.08878173 0.02537622 -0.05136037 -0.005425793 0.007615053 #> MagNM Use #> Seedmass -0.03147019 0.004500904 #> SLA -0.12032477 -0.090142614 #> Height -0.01014934 0.018558815 #> LDMC 0.05643595 -0.180870869 #> Lifespanperennial 0.04839256 0.080107192 # fit the mean traits at each site (20x6), # that is CWM at each site pred.traits <- predict(mod, type = \"traits\") head(pred.traits) #> SLA Height LDMC Lifespanannual Lifespanperennial #> 1 24.69054 23.04477 262.1525 0.047500047 0.9525000 #> 2 26.58938 22.47821 248.9740 -0.001033559 1.0010336 #> 3 24.27447 25.82005 259.4974 0.028101542 0.9718985 #> 4 24.25886 25.74429 259.7835 0.029235611 0.9707644 #> 5 26.80648 26.21316 241.2643 0.017241993 0.9827580 #> 6 26.11737 22.44992 230.8071 0.049338100 0.9506619 # fit the mean environment for each species (28x8) # that is SNC of each species pred.env <- predict(mod, type = \"env\") head(pred.env) #> A1 Moist MagSF MagBF MagHF #> Achillea millefolium 5.342999 3.326274 0.2987008 0.1012023 0.2658685 #> Agrostis stolonifera 4.529007 2.576826 0.2877323 0.1864249 0.2361958 #> Aira praecox 3.642275 2.771151 0.4244468 0.1056802 0.1759198 #> Alopecurus geniculatus 4.774155 2.531686 0.2733250 0.2228758 0.2796069 #> Anthoxanthum odoratum 3.917107 2.475008 0.3079576 0.1444949 0.1555197 #> Bellis perennis 4.651703 2.424855 0.2610354 0.2306304 0.2703286 #> MagNM Use #> Achillea millefolium 0.3342285 2.102427 #> Agrostis stolonifera 0.2896470 1.794929 #> Aira praecox 0.2939532 1.624523 #> Alopecurus geniculatus 0.2241924 1.874519 #> Anthoxanthum odoratum 0.3920278 1.618153 #> Bellis perennis 0.2380056 1.944774 pred.resp <- predict(mod, type = \"response\") # pred has negative values and dc_CA cannot have negatives in the response # so, modify pred.resp, #whichgives about similar eigenvalues as the original data pred.resp[pred.resp < 0] <- 0 mod3 <- dc_CA(formulaEnv = mod$formulaEnv, formulaTraits = mod$formulaTraits, response = pred.resp, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Condition(Seedmass) + #> Lifespan, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 1.661e-01 1.000e+00 #> Conditional 8.889e-06 5.352e-05 1 #> Constrained 1.641e-01 9.881e-01 4 #> Unconstrained 1.971e-03 1.187e-02 10 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.07673 0.05423 0.01895 0.01419 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.0009360 0.0005522 0.0002421 0.0001346 0.0000649 0.0000307 0.0000100 0.0000003 #> CA9 CA10 #> 0.0000001 0.0000000 #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Condition(Manure), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 1.641e-01 1.000e+00 #> Conditional 9.073e-05 5.529e-04 1 #> Constrained 1.635e-01 9.961e-01 4 #> Unconstrained 5.461e-04 3.328e-03 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.07667 0.05405 0.01874 0.01399 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 2.729e-04 2.527e-04 1.775e-05 2.780e-06 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 1.75 6.4614 9.3847 0.1783 26.9699 #> A1 4.85 9.4989 1.6967 0.0918 32.6413 #> Moist 2.90 7.8613 1.7658 0.1966 68.5625 #> MagBF 0.15 1.5969 4.5016 0.0637 13.9152 #> MagHF 0.25 1.9365 2.6715 0.1152 32.6500 #> MagNM 0.30 2.0494 9.5666 0.1860 27.8637 #> Use 1.90 3.4351 1.7825 0.0741 25.7072 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6554 0.6697 1.0755 -0.1577 -7.8655 #> SLA 24.6051 6.3645 1.1910 -0.6932 -32.8545 #> Height 25.1952 15.7708 1.3041 0.5404 24.4755 #> LDMC 244.6988 71.3268 1.1756 -0.6101 -29.1066 #> Lifespanperennial 0.9584 0.1997 1.0991 0.2877 14.1958 #> #> weighted variance #> total 0.166 #> conditionT 0.000 #> traits_explain 0.164 #> conditionE 0.000 #> constraintsTE 0.163 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" mod3$eigenvalues / mod$eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 #> 0.8803851 0.8934459 0.8390431 0.7971850"},{"path":"/reference/print.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a summary of a dc-CA object. — print.dcca","title":"Print a summary of a dc-CA object. — print.dcca","text":"Print summary dc-CA object.","code":""},{"path":"/reference/print.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a summary of a dc-CA object. — print.dcca","text":"","code":"# S3 method for class 'dcca' print(x, ...)"},{"path":"/reference/print.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a summary of a dc-CA object. — print.dcca","text":"x dc-CA object dc_CA. ... arguments passed function (currently ignored).","code":""},{"path":"/reference/print.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print a summary of a dc-CA object. — print.dcca","text":"return value, results printed console.","code":""},{"path":"/reference/print.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Print a summary of a dc-CA object. — print.dcca","text":"x <- print(x) efficient scores.dcca just print(x) dc_CA called verbose = FALSE).","code":""},{"path":"/reference/print.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print a summary of a dc-CA object. — print.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.091 . #> dcCA2 1 0.10903 0.082419 2.7336 0.496 #> dcCA3 1 0.05934 0.044853 1.4877 0.771 #> dcCA4 1 0.03792 0.028663 0.9507 0.798 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.099 . #> dcCA3 1 0.059336 0.08757 3.5776 0.389 #> dcCA4 1 0.037919 0.05596 2.2863 0.657 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.091 . #> dcCA2 1 0.10903 0.082419 2.7336 0.496 #> dcCA3 1 0.05934 0.044853 1.4877 0.771 #> dcCA4 1 0.03792 0.028663 0.9507 0.798 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/print.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a summary of a wrda object — print.wrda","title":"Print a summary of a wrda object — print.wrda","text":"Print summary wrda object","code":""},{"path":"/reference/print.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a summary of a wrda object — print.wrda","text":"","code":"# S3 method for class 'wrda' print(x, ...)"},{"path":"/reference/print.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a summary of a wrda object — print.wrda","text":"x wrda object wrda ... arguments passed function (currently ignored).","code":""},{"path":"/reference/print.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print a summary of a wrda object — print.wrda","text":"return value, results printed console.","code":""},{"path":"/reference/print.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print a summary of a wrda object — print.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.012 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. vegan scores","code":""},{"path":"/reference/scores.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"function works much like vegan scores function, particular scores.cca, additional results regression coefficients linear combinations traits ('reg_traits', 'lc_traits'). scores CA obey called transition formulas scores CCA dc-CA. differences , CCA, linear combinations environmental variables (constrained site scores) replace usual (unconstrained) site scores, dc-CA, linear combinations traits (constrained species scores) also replace usual (unconstrained) species scores transition formulas.","code":""},{"path":"/reference/scores.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"","code":"# S3 method for class 'dcca' scores( x, ..., choices = 1:2, display = \"all\", scaling = \"sym\", which_cor = \"in model\", tidy = FALSE )"},{"path":"/reference/scores.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"x object class \"dcca\", .e. result dc_CA. ... arguments passed function (currently ignored). choices integer vector axes obtain. Default: dc-CA axes. display character vector, one c(\"\", \"species\", \"sites\", \"sp\", \"wa\", \"lc\", \"bp\", \"cor\", \"ic\", \"reg\", \"tval\", \"cn\", \"lc_traits\", \"reg_traits\", \"tval_traits\", \"cor_traits\", \"ic_traits\", \"bp_traits\", \"cn_traits\"). items scores.cca, except \"cor\" \"ic\", inter-set intra-set correlations, respectively, \"tval\" (-optimistic) t-values regression coefficients. remaining scores analogous scores species traits. scaling numeric (1,2 3) character \"sites\", \"species\" \"symmetric\". Default: \"symmetric\". Either site- (1) species- (2) related scores scaled eigenvalues, set scores unit weighted mean square 3 scaled symmetrically weighted mean squares equal square root eigenvalues. Negative values treated corresponding positive ones abs(scaling). which_cor character list trait environmental variables names (order) data frames inter-set correlations must calculated. Default: character (\"in_model\") traits variables model, including collinear variables levels. tidy Return scores compatible ggplot2: scores single data.frame, score type identified factor variable score, names variable label, species weights (dc_CA variable weight. See scores.cca.","code":""},{"path":"/reference/scores.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"data frame tidy = TRUE. Otherwise, matrix single item asked named list matrices one item asked . following names can included: c(\"sites\", \"constraints_sites\", \"centroids\", \"regression\", \"t_values\", \"correlation\", \"intra_set_correlation\", \"biplot\", \"species\", \"constraints_species\", \"regression_traits\", \"t_values_traits\", \"correlation_traits\", \"intra_set_correlation_traits\", \"biplot_traits\", \"centroids_traits\"). matrix attribute \"meaning\" explaining meaning. tidy = TRUE, resulting data frame attributes \"scaling\" \"meaning\"; latter two columns: (1) name score type (2) meaning, usage interpretation. example meaning scores scaling \"symmetric\" display =\"\": sites CMWs trait axes (constraints species) scaling 'symmetric' optimal biplots , almost , inter-site distances. constraints_sites linear combination environmental predictors covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-site distances. regression mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values t-values coefficients regression CWMs trait composite environmental variables correlation inter set correlation, correlation environmental variables sites scores (CWMs) intra_set_correlation intra set correlation, correlation environmental variables dc-ca axis (constrained sites scores) biplot biplot scores environmental variables display biplot-traits fourth-corner correlations scaling 'symmetric'. centroids environmental category means site scores scaling 'symmetric' optimal biplots , almost , inter-environmental category distances. species SNC environmental axes (constraints sites) scaling 'symmetric' optimal biplots , almost , inter-species distances. constraints_species linear combination traits trait covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-species distances. regression_traits mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values_traits t-values coefficients regression SNCs along dc-CA axis traits correlation_traits inter set correlation, correlation traits species scores (SNCs) intra_set_correlation_traits intra set correlation, correlation traits dc-ca axis (constrained species scores) biplot_traits biplot scores traits display biplot scores fourth-corner correlation scaling 'symmetric'. centroids_traits trait category means species scores scaling 'symmetric' optimal biplots , almost , inter-trait category distances. statements optimality distance interpretations based scaling relative magnitude dc-CA eigenvalues chosen axes.","code":""},{"path":"/reference/scores.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"function modeled scores.cca. t-ratios taken multiple regression unconstrained species (site) scores traits (environmental variables). example which_cor : which_cor = list(traits = \"SLA\", env = c(\"acidity\", \"humidity\")).","code":""},{"path":"/reference/scores.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.100 #> dcCA2 1 0.10903 0.082419 2.7336 0.491 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.820 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.090 . #> dcCA3 1 0.059336 0.08757 3.5776 0.412 #> dcCA4 1 0.037919 0.05596 2.2863 0.665 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.100 #> dcCA2 1 0.10903 0.082419 2.7336 0.491 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.820 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/scores.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"function works much like vegan scores function, particular scores.cca, regression coefficients predictors.","code":""},{"path":"/reference/scores.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"","code":"# S3 method for class 'wrda' scores( x, ..., choices = 1:2, display = \"all\", scaling = \"sym\", which_cor = \"in model\", tidy = FALSE )"},{"path":"/reference/scores.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"x object class \"wrda\", .e. result wrda. ... arguments passed function (currently ignored). choices integer vector axes obtain. Default: wrda axes. display character vector, one c(\"\", \"species\", \"sites\", \"sp\", \"wa\", \"lc\", \"bp\", \"cor\", \"ic\", \"reg\", \"tval\", \"cn\"). items scores.cca, except \"cor\" \"ic\", inter-set intra-set correlations, respectively, \"tval\" (-optimistic) t-values regression coefficients. scaling numeric (1,2 3) character \"sites\", \"species\" \"symmetric\". Default: \"symmetric\". Either site- (1) species- (2) related scores scaled eigenvalues, set scores unit weighted mean square 3 scaled symmetrically weighted mean squares equal square root eigenvalues. Negative values treated corresponding positive ones abs(scaling). which_cor character vector environmental variables names data frames inter-set correlations must calculated. Default: character (\"in_model\") predictors model, including collinear variables levels. tidy Return scores compatible ggplot2: variable score, names variable label. See weights (dc_CA variable weight. See scores.cca.","code":""},{"path":"/reference/scores.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"data frame tidy = TRUE. Otherwise, matrix single item asked named list matrices one item asked . following names can included: c(\"sites\", \"constraints_sites\", \"centroids\", \"regression\", \"t_values\", \"correlation\", \"intra_set_correlation\", \"biplot\", \"species\"). matrix attribute \"meaning\" explaining meaning. tidy = TRUE, resulting data frame attributes \"scaling\" \"meaning\"; latter two columns: (1) name score type (2) meaning, usage interpretation. example meaning scores scaling \"symmetric\" display = \"\": sites CMWs trait axes (constraints species) scaling 'symmetric' optimal biplots , almost , inter-site distances. constraints_sites linear combination environmental predictors covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-site distances. regression mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values t-values coefficients regression CWMs trait composite environmental variables correlation inter set correlation, correlation environmental variables sites scores (CWMs) intra_set_correlation intra set correlation, correlation environmental variables dc-ca axis (constrained sites scores) biplot biplot scores environmental variables display biplot-traits fourth-corner correlations scaling 'symmetric'. centroids environmental category means site scores scaling 'symmetric' optimal biplots , almost , inter-environmental category distances. species SNC environmental axes (constraints sites) scaling 'symmetric' optimal biplots , almost , inter-species distances. statements optimality distance interpretations based scaling relative magnitude dc-CA eigenvalues chosen axes.","code":""},{"path":"/reference/scores.wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"function modeled scores.cca. example which_cor : which_cor = c(\"acidity\", \"humidity\")","code":""},{"path":"/reference/scores.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.01 ** #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs a weighted redundancy analysis — wrda","title":"Performs a weighted redundancy analysis — wrda","text":"wrda formula-based implementation weighted redundancy analysis.","code":""},{"path":"/reference/wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs a weighted redundancy analysis — wrda","text":"","code":"wrda(formula, response, data, weights = rep(1, nrow(data)), verbose = TRUE)"},{"path":"/reference/wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs a weighted redundancy analysis — wrda","text":"formula one two-sided formula rows (samples) row predictors data. left hand side formula ignored specified next argument (response). Specify row covariates () adding + Condition(covariate-formula) formula rda. covariate-formula contain ~ (tilde). response matrix data frame abundance data (dimension n x m). Rownames response, , carried . data matrix data frame row predictors, rows corresponding response (dimension n x p). weights row weights (vector). specified unit weights used. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs a weighted redundancy analysis — wrda","text":"scores dcca object scaling \"sites\" (1): scaling Focus Case distances.","code":""},{"path":"/reference/wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Performs a weighted redundancy analysis — wrda","text":"algorithm modified version published R-code weighted redundancy analysis (ter Braak, 2022). current implementation, formula contain variable names , .e. transformations variables formulas gives error ('undefined columns selected') scores function applied. Compared rda, wrda residual axes, .e. SVD PCA residuals performed.","code":""},{"path":"/reference/wrda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Performs a weighted redundancy analysis — wrda","text":"ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Performs a weighted redundancy analysis — wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.014 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/news/index.html","id":"douconca-121","dir":"Changelog","previous_headings":"","what":"douconca 1.2.1","title":"douconca 1.2.1","text":"Patch release addressing check errors several CRAN build machines.","code":""},{"path":"/news/index.html","id":"douconca-120","dir":"Changelog","previous_headings":"","what":"douconca 1.2.0","title":"douconca 1.2.0","text":"CRAN release: 2024-09-13 Intial CRAN release","code":""},{"path":"/news/index.html","id":"douconca-116","dir":"Changelog","previous_headings":"","what":"douconca 1.1.6","title":"douconca 1.1.6","text":"issue collinear predictors v1.1.5 resolved.","code":""},{"path":"/news/index.html","id":"douconca-115","dir":"Changelog","previous_headings":"","what":"douconca 1.1.5","title":"douconca 1.1.5","text":"package can now general dc-CA, instead vegan-based version equal site weights . users previous version, function dc_CA_vegan replaced general function dc_CA. default gives analysis. specifying argument divideBySiteTotals = FALSE, obtain original dc-CA analysis unequal site weights. plot_dcCA function now method: plot. General dc-CA required weighted redundancy analysis. , new function wrda added, methods print, scores anova. predict function added. dc-CA can computed community-weighted means (CWMs) trait environment data species site weights. See new function fCWM_SNC. interest, example, make dc-CA analysis reproducible abundance data made public, may also allow perform dcCA intra-species trait variation. user needs able compute meaningful CWMs case supply trait data reflect (species-weighted) inter-trait covariance. Several functions updated. particular, corrections anova function.","code":""},{"path":"/news/index.html","id":"douconca-112","dir":"Changelog","previous_headings":"","what":"douconca 1.1.2","title":"douconca 1.1.2","text":"scores.dccav function corrected concerning intra-set correlations traits environmental variables. plotting functions updated avoid ggplot2 warnings color size. fitted straight lines plots use implicit weights (already, help said ).","code":""}] +[{"path":"/articles/douconca.html","id":"the-douconca-package","dir":"Articles","previous_headings":"","what":"The douconca package","title":"douconca","text":"aim douconca package help ecologists unravel trait-environment relationships abundance data table associated multi-trait multi-environment data tables. popular method aim RLQ (Dolédec et al. 1996; Dray et al. 2014), also three-tables method. RLQ available R-package ade4(Dray Dufour 2007; Thioulouse et al. 2018). douconca package provides alternative method, termed double-constrained correspondence analysis (dc-CA), natural extension commonly used method community-weighted means (CWMs) regression (Ter Braak, Šmilauer, Dray 2018; Kleyer et al. 2012). dc-CA based regression analysis ordination (factorial analysis), allows usual forms testing, model building, biplots resulting scores. number recent applications also contain discussion value dc-CA compared RLQ (Peng et al. 2021; Gobbi et al. 2022; Pinho et al. 2021), summarized document ResearchGate. douconca package formula-interface specify dc-CA model, scores, anova, plot predict functions, mostly fairly similar vegan package (Oksanen et al. 2024) douconca based.","code":""},{"path":"/articles/douconca.html","id":"double-constained-correspondence-analysis","dir":"Articles","previous_headings":"","what":"Double constained correspondence analysis","title":"douconca","text":"RLQ, dc-CA seeks ordination (.e. low-dimensional representation ) multi-trait, multi-environment relationships, dc-CA differs RLQ dc-CA based regression traits environmental variables predictors, whereas RLQ based co-variance. dc-CA method thus allows variation-partitioning type model-building familiar users regression analysis, whereas RLQ . dc-CA axis consists two regression models (linear combinations), one traits environmental predictors, fitted values can thought composite trait composite environmental gradient. response variables regressions species niche centroids CWMs composites. circularity typical eigenvalue ordination method. linear combinations maximizes fourth-corner correlation composite trait composite environmental gradient. dc-CA eigenvalues squared fourth-corner correlations, also variances, namely amounts variation abundance data consecutive axes explain (Ter Braak, Šmilauer, Dray 2018). Statistical testing max test (Ter Braak, Cormont, Dray 2012), evaluated extensive simulation (Ter Braak 2019). test combines two permutations tests, one permuting sites permuting species, maximum P-value final P-value. vegan package, permutations specified via permute package (Simpson 2022), allow analysis hierarchical nested data designs (Gobbi et al. 2022). douconca, dc-CA models specified two formulas: formula sites (rows) environmental predictors formula species (columns) trait predictors, may contain factors, quantitative variables transformations thereof, interactions, like (generalized) linear regression model. formulas specify constraints applied site species scores; without constraints dc-CA simply correspondence analysis. double constrained version principal components analysis also exists available Canoco software (Ter Braak Šmilauer 2018), less appeal ecological applications lacks ecological realism, ease interpretation link methods, CWM-regression fourth-corner correlation analysis, proven useful trait-based ecology.","code":""},{"path":"/articles/douconca.html","id":"example-data-and-questions","dir":"Articles","previous_headings":"","what":"Example data and questions","title":"douconca","text":"use dune_trait_env data package illustrate dc-CA. consists abundances 28 plant species 20 meadows (plots, called sites), trait data plant species environmental data sites. five morphological traits (LEDA trait database) four ecological traits (Ellenberg indicator values moisture, acidity, nutrients light). five environmental variables two sets two spatial coordinates, approximately equal. X Y coordinates plot. lot-variables center meadow sample taken. type questions dc-CA able address : many dimenstions needed represent major part trait-environment relations? trait-environment relationship statistically significant? many dimensions statistically significant? importance variable dc-CA axis? trait-structured variation trait sets larger variation? trait sets (morphological versus ecological) closely related environmental variables?","code":"library(douconca) data(\"dune_trait_env\") names(dune_trait_env) #> [1] \"comm\" \"traits\" \"envir\" dim(dune_trait_env$comm[, -1]) ## without the variable \"Sites\" #> [1] 20 28 dim(dune_trait_env$traits) #> [1] 28 11 dim(dune_trait_env$envir) #> [1] 20 10 names(dune_trait_env$traits) #> [1] \"Species\" \"Species_abbr\" \"SLA\" \"Height\" \"LDMC\" #> [6] \"Seedmass\" \"Lifespan\" \"F\" \"R\" \"N\" #> [11] \"L\" names(dune_trait_env$envir) #> [1] \"Sites\" \"A1\" \"Moist\" \"Mag\" \"Use\" \"Manure\" \"X\" \"Y\" #> [9] \"X_lot\" \"Y_lot\""},{"path":"/articles/douconca.html","id":"basic-analysis","dir":"Articles","previous_headings":"Example data and questions","what":"Basic analysis","title":"douconca","text":"next code gives basic dc-CA analysis. response matrix data frame must numerical, columns representing species. first variable (Sites) must therefore deleted. douconca, dc-CA calculated two steps provide useful information . Step 1 dc-CA algorithm summarizes canonical correspondence analysis (CCA) transposed response matrix trait data using formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan. morphological traits formula explain 28.85% total inertia (variance) abundance data Y. inertia (0.6776) called trait-structured variation. Inertia general weighted variance, case thus unweighted sites equal weight analysis, divideBySiteTotals true defaults. Formally, total (unweighted) variance community weighted means orthonormalized traits (traits orthonormalized Step 1). trait-structured variation analyzed Step 2 using redundancy analysis (RDA). Step 2 shows 65.73% variation can explained environmental variables using formulaEnv = ~ A1 + Moist + Use + Manure + Mag. constrained axes RDA also dc-CA eigenvalues: first axis explains 53% trait-environment variance axis dominated moisture SLA Seedmass, judged size regression coefficient (optimistic) t-value axis print model. default plot shows intra-set correlations variables axis, t-values can visualized ","code":"Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" mod <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Use + #> Manure + Mag, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" mod$eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 plot(mod,gradient_description = \"t\")"},{"path":"/articles/douconca.html","id":"statistical-testing","dir":"Articles","previous_headings":"Example data and questions","what":"Statistical testing","title":"douconca","text":"two-ways statistically test model: (1) omnibus test (using five dimensions) obtained anova(mod), giving P-value 0.02 (2) test per dc-CA axis, obtained test per axis, first axis P-values 0.09 0.001 species- site-level, respectively, P-value max test 0.09. little explanation may instructive. species-level test consists testing (weighted) regression species-niche-centroids respect orthonormalized environmental variables traits. site-level test consists testing (case, unweighted) regression community-weighted means orthonormalized traits environmental variables. tests carried permutation, first permuting species trait data, second permuting sites environmental data. new dc-CA carried permuted data set. full description see Details help system.","code":"set.seed(1) anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.087 . #> dcCA2 1 0.10903 0.082419 2.7336 0.476 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.816 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.075 . #> dcCA3 1 0.059336 0.08757 3.5776 0.409 #> dcCA4 1 0.037919 0.05596 2.2863 0.676 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.087 . #> dcCA2 1 0.10903 0.082419 2.7336 0.476 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.816 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1"},{"path":"/articles/douconca.html","id":"fitted-values-and-predictions","dir":"Articles","previous_headings":"Example data and questions","what":"Fitted values and predictions","title":"douconca","text":"three kinds fitted values (predictions new data): fitted traits per site, obtained predict(mod, type = \"traits\" ) fitted environmental values per species, obtained predict(mod, type = \"env\") fitted abundances, obtained predict(mod, type = \"response\" ) fitted traits per site simply fitted community-weighted means fitted environmental values fitted species-niche centroids. Note 10% fitted abundance values negative example. Negative values indicate likely absences low abundance values species specified traits environmental values.","code":""},{"path":"/articles/douconca.html","id":"which-set-of-traits-is-most-closely-related-to-abundance-and-to-the-environment","dir":"Articles","previous_headings":"","what":"Which set of traits is most closely related to abundance and to the environment?","title":"douconca","text":"section, pose question whether set morphological (functional) traits less related species abundance environmental variables set ecological traits. entry traits_explain 0.87, variance abundance data explained traits. can directly compared corresponding entry previous model, 0.678. entry constraintsTE variance abundance data explained traits environmental variables jointly. value second model higher first. closer examination results, second eigenvalue last model even higher first one first model , indeed, first two dc-CA axes significant can seen anova: fourth-corner correlation best linear combination ecological traits best linear combination environmental variables compared 0.49 best linear combination morphological traits. conclusion, ecological traits explain abundance data closer related environmental variables.","code":"mod_e <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ F + R + N + L, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ F + R + N + L, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.8701 0.3704 4 #> Unconstrained 1.4789 0.6296 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.4771 0.3122 0.0580 0.0228 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.27842 0.24457 0.18230 0.16241 0.14740 0.09916 0.09167 0.06649 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Manure + #> Use + Mag, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.8701 1.0000 #> Constrained 0.6331 0.7277 4 #> Unconstrained 0.2369 0.2723 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.3684 0.2452 0.0141 0.0054 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.14787 0.06377 0.01573 0.00954 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 0.1527 1.3122 #> Moist 2.90 7.8613 1.7658 0.4584 3.8618 #> Manure 1.75 6.4614 9.3847 0.0243 0.0888 #> Use 1.90 3.4351 1.7825 0.0886 0.7432 #> MagBF 0.15 1.5969 4.5016 -0.0086 -0.0452 #> MagHF 0.25 1.9365 2.6715 0.0136 0.0930 #> MagNM 0.30 2.0494 9.5666 0.1136 0.4110 #> Avg SDS VIF Regr1 tval1 #> F 6.1126 1.6685 1.1323 0.8158 6.0720 #> R 5.8061 1.1894 1.7564 -0.1812 -1.0830 #> N 5.1674 1.6303 1.7822 -0.1905 -1.1304 #> L 7.3839 0.8774 1.1378 0.3043 2.2594 #> #> weighted variance #> total 2.349 #> traits_explain 0.870 #> constraintsTE 0.633 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod_e, by = \"axis\")$max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~F + R + N + L, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the community-level test: #> Residualized response permutation using vegan::rda #> which performs well in this equi-weight case. #> #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.36835 0.42337 23.3220 0.002 ** #> dcCA2 1 0.24525 0.28188 15.5276 0.017 * #> dcCA3 1 0.01413 0.01624 0.8944 0.996 #> dcCA4 1 0.00541 0.00622 0.3427 1.000 #> Residual 15 0.23691 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 round(sqrt(mod_e$eigenvalues[1]), 2) #> dcCA1 #> 0.61"},{"path":"/articles/douconca.html","id":"do-the-morphological-traits-contribute-after-accounting-for-the-ecological-traits","dir":"Articles","previous_headings":"","what":"Do the morphological traits contribute after accounting for the ecological traits?","title":"douconca","text":"morphological traits carry important additional information species (beyond ecological traits) understanding species occur ? (.e. understanding species-environment relationships). address question, specify ecological traits Condition trait formula perform anova resulting model. jugded test significance axes, morphological traits contribute little.","code":"mod_mGe <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan + Condition(F+R+N+L), response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) anova(mod_mGe, by= \"axis\")$max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan + Condition(F + R + N + L), response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.09333 0.135306 3.4800 0.183 #> dcCA2 1 0.07101 0.102951 2.6479 0.280 #> dcCA3 1 0.03381 0.049017 1.2607 0.837 #> dcCA4 1 0.00629 0.009115 0.2344 1.000 #> dcCA5 1 0.00259 0.003761 0.0967 1.000 #> Residual 18 0.48274"},{"path":[]},{"path":"/articles/douconca.html","id":"introduction","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"Introduction","title":"douconca","text":"CWM regression know suffer serious type error inflation statistical testing (Peres-Neto, Dray, Ter Braak 2017; Lepš De Bello 2023). section shows perform CWM regression single trait using dc-CA max test guard type error inflation. test suffer , sometimes extreme, conservativeness ZS (Zelený & Schaffers) modified test (Ter Braak, Peres-Neto, Dray 2018; Lepš De Bello 2023). also show equivalence site-level test CWM-regression equivalence dc-CA CWM regression coefficients. way, give examples scores fCWM_SNC functions douconca package.","code":""},{"path":"/articles/douconca.html","id":"testing-the-relationship-between-ldmc-and-the-environmental-variables","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"Testing the relationship between LDMC and the environmental variables","title":"douconca","text":"P-values species-level site-level permutation tests 0.396 0.028, respectively, final P-value 0.396. thus evidence trait LDMC related environmental variables model. now show performing CWM-regression lead opposite conclusion. , first calculate CWMs LDMC, using function fCWM_SNC, arguments similar dc_CA function. result, CWMSNC_LDMC, list containing CWMs LDMC, among items. combine (community-weighted) mean LDMC environmental data, apply linear regresion compare model null model using anova. resulting P-value 0.0279, agreement P-value site-level permutation test model. CWM-regression LDMC shows evidence relationship environmental variables whereas fact little evidence shown dc-CA.","code":"mod_LDMC <- dc_CA(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) anova(mod_LDMC) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 1 0.05605 0.042368 1.1503 0.396 #> Residual 26 1.26686 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.056048 0.67074 3.4922 0.028 * #> Residual 12 0.027513 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Manure + Use + Mag, formulaTraits = ~LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 1 0.05605 0.042368 1.1503 0.396 #> Residual 26 1.26686 CWMSNC_LDMC <- fCWM_SNC(formulaEnv = ~ A1 + Moist + Manure + Use + Mag, formulaTraits = ~ LDMC, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$trait, verbose = FALSE) envCWM <- cbind(dune_trait_env$envir, CWMSNC_LDMC$CWM) lmLDMC <- lm(LDMC ~ A1 + Moist + Manure + Use + Mag, data = envCWM) anova(lmLDMC, lm(LDMC ~ 1, data = envCWM)) #> Analysis of Variance Table #> #> Model 1: LDMC ~ A1 + Moist + Manure + Use + Mag #> Model 2: LDMC ~ 1 #> Res.Df RSS Df Sum of Sq F Pr(>F) #> 1 12 2771.8 #> 2 19 8418.3 -7 -5646.5 3.4922 0.0279 * #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1"},{"path":"/articles/douconca.html","id":"the-coefficients-of-a-cwm-regression-are-proportional-to-those-of-dc-ca","dir":"Articles","previous_headings":"One trait: CWM regression without inflated type I error.","what":"The coefficients of a CWM-regression are proportional to those of dc-CA","title":"douconca","text":"introduction said dc-CA extends CWM-regression multiple traits. now show regression coefficients issued dc-CA single trait , scaling constant, identical linear CWM-regression trait. first extract regression coefficients dc-CA model using scores function. second line calculates regression coefficients dividing standardize regression coefficients dc_CA standard deviation environmental variable. result shows two sets coefficients equal constant proportionality, 154.4359. t-values also equal:","code":"(regr_table <- scores(mod_LDMC, display = \"reg\")) #> Avg SDS VIF dcCA1 #> A1 4.85 9.498947 1.696694 -0.16636060 #> Moist 2.90 7.861298 1.765817 -0.02346540 #> Manure 1.75 6.461424 9.384723 0.78784718 #> Use 1.90 3.435113 1.782458 -0.33963301 #> MagBF 0.15 1.596872 4.501582 0.25168168 #> MagHF 0.25 1.936492 2.671474 0.09905591 #> MagNM 0.30 2.049390 9.566575 0.71778929 #> attr(,\"meaning\") #> [1] \"mean, sd, VIF, standardized regression coefficients.\" coefs_LDMC_dcCA <- regr_table[, \"dcCA1\"] / regr_table[, \"SDS\"] range(coef(lmLDMC)[-1] / coefs_LDMC_dcCA) #> [1] 154.4359 154.4359 cbind(summary(lmLDMC)$coefficients[-1, \"t value\", drop = FALSE], scores(mod_LDMC, display = \"tval\")) #> t value dcCA1 #> A1 -1.2978033 -1.2978033 #> Moist -0.1794383 -0.1794383 #> Manure 2.6133127 2.6133127 #> Use -2.5849991 -2.5849991 #> MagBF 1.2053943 1.2053943 #> MagHF 0.6158360 0.6158360 #> MagNM 2.3581903 2.3581903"},{"path":[]},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Cajo J.F ter Braak. Author. Bart-Jan van Rossum. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"ter Braak C, van Rossum B (2024). douconca: Double Constrained Correspondence Analysis Trait-Environment Analysis Ecology. R package version 1.2.1, https://github.com/Biometris/douconca.","code":"@Manual{, title = {douconca: Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology}, author = {Cajo J.F {ter Braak} and Bart-Jan {van Rossum}}, year = {2024}, note = {R package version 1.2.1}, url = {https://github.com/Biometris/douconca}, }"},{"path":"/index.html","id":"douconca","dir":"","previous_headings":"","what":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","title":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","text":"R library douconca analyzes multi-trait multi-environment ecological data double constrained correspondence analysis (ter Braak et al. 2018) using vegan native R code. formula interface trait- (column-) environment- (row-) models, allows assess, example, importance trait interactions shaping ecological communities. Throughout two step algorithm ter Braak et al. (2018) used. algorithm combines extends community- (sample-) species-level analyses, .e. usual community weighted means (CWM)-based regression analysis species-level analysis species-niche centroids (SNC)-based regression analysis. CWM regressions specified environmental formula SNC regressions specified trait formula. dcCA finds environmental trait gradients optimize regressions. first step uses cca (Oksanen et al. 2022) regress transposed abundance data traits (weighted) redundancy analysis regress community-weighted means (CWMs) orthonormalized traits, obtained first step, environmental predictors. sample total abundance data used weights. redundancy analysis carried using rda sites equal weights (division rows total) , general weighted case, using wrda. Division sample total advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted, may give puzzling difference common univariate multivariate analysis. Reference: ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. https://doi.org/10.1007/s10651-017-0395-x","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Double Constrained Correspondence Analysis for Trait-Environment Analysis in Ecology","text":"can install development version douconca like :","code":"install.packages(\"remotes\") remotes::install_github(\"CajoterBraak/douconca\")"},{"path":"/reference/anova.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"anova.dcca performs community- species-level permutation tests dc-CA combines 'max test', takes maximum P-values. function arguments similar (restrictive ) anova.cca.","code":""},{"path":"/reference/anova.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"","code":"# S3 method for class 'dcca' anova(object, ..., permutations = 999, by = c(\"omnibus\", \"axis\"))"},{"path":"/reference/anova.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"object object dc_CA. ... unused. permutations list control values permutations species sites (species first, sites second, traits environment) returned function , number permutations required (default 999, two-vector number species-level test first sites-level second), list two permutation matrices (, species first, sites second) row gives permuted indices. character \"axis\" performs series tests, one axis, eigenvalue axis test statistic. Default: NULL sets test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA. interpretation inertia , species-level, environmentally constrained inertia explained traits (without trait covariates) , community-level, trait-constrained inertia explained environmental predictors (without covariates). default (NULL) computationally quicker avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"list 3 structures anova.cca. elements c(\"species\", \"sites\", \"max\")","code":""},{"path":"/reference/anova.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"general case varying site abundance totals (divideBySiteTotals = FALSE) community-level test species-level test use residualized predictor permutation (ter Braak 2022), ensure anova.dcca robust differences species site total abundance response (ter Braak & te Beest, 2022). community-level test uses anova_sites. species-level test, anova_species used. equal site weights, obtained divide..site.total = TRUE, community-level test obtained applying anova object$RDAonEnv using anova.cca. performs residualized response permutation performs equal residualized predictor permutation equi-weight case. function anova.cca implemented C therefore factor 20 quicker native R-code used anova_sites.","code":""},{"path":"/reference/anova.dcca.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Community- and Species-Level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0160000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/anova.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Permutation Test for weighted redundancy analysis — anova.wrda","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"anova.wrda performs residual predictor permutation weighted redundancy analysis (wRDA), robust differences weights (ter Braak, 2022). arguments function similar anova.cca, restricted.","code":""},{"path":"/reference/anova.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"","code":"# S3 method for class 'wrda' anova(object, ..., permutations = 999, by = c(\"omnibus\", \"axis\"))"},{"path":"/reference/anova.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"object object dc_CA. ... unused. permutations list control values permutations returned function , number permutations required (default 999), permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue RDA model. Default: NULL sets test statistic weighted variance fitted predictors (=sum constrained eigenvalues). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives wrda eigenvalues.","code":""},{"path":"/reference/anova.wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"algorithm based published R-code residual predictor permutation weighted redundancy analysis (ter Braak, 2022), using QR-decomposition instead ad-hoc least-squares functions.","code":""},{"path":"/reference/anova.wrda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Permutation Test for weighted redundancy analysis — anova.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.012 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/anova_sites.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"anova_sites performs community-level permutation test dc-CA site weights vary. test uses residual predictor permutation (ter Braak 2022), robust differences site total abundance response dc_CA (ter Braak & te Beest, 2022). arguments function similar anova.cca, restricted. equal site-totals dc_CA, anova(object$RDAonEnv) much faster.","code":""},{"path":"/reference/anova_sites.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"","code":"anova_sites(object, permutations = 999, by = NULL)"},{"path":"/reference/anova_sites.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"object object dc_CA. permutations list control values permutations returned function , number permutations required (default 999), permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue dc-CA model. Default: NULL sets test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA). trait constrained inertia explained environmental predictors (without covariates), equal environmentally-constrained inertia explained traits (without trait covariates). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova_sites.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives dc-CA eigenvalues.","code":""},{"path":"/reference/anova_sites.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"algorithm analogous anova.wrda. function used anova.dcca.","code":""},{"path":"/reference/anova_sites.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova_sites.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: community-level permutation test in Double Constrained Correspondence Analysis (dc-CA) — anova_sites","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.009 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.002 ** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.009 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.008 ** #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0080000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/anova_species.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"anova_species performs species-level permutation test dc-CA part anova.dcca. test uses residual predictor permutation (ter Braak 2022), robust differences species total abundance response dc_CA (ter Braak & te Beest, 2022). arguments function similar anova.cca, restrictive.","code":""},{"path":"/reference/anova_species.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"","code":"anova_species(object, permutations = 999, by = NULL)"},{"path":"/reference/anova_species.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"object object dc_CA. permutations list control values permutations returned function , number permutations required (default 999) permutation matrix row gives permuted indices. character \"axis\" sets test statistic first eigenvalue dc-CA model. Default: NULL set test statistic inertia (sum double constrained eigenvalues; named constraintsTE inertia element dc_CA). environmentally constrained inertia explained traits (without trait covariates), equal trait-constrained inertia explained environmental predictors (without covariates). default quicker computationally avoids computation svd permuted data sets.","code":""},{"path":"/reference/anova_species.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"list two elements names table eigenvalues. table anova.cca eigenvalues gives dc-CA eigenvalues. output can used scripting forward selection traits, similar forward selection environmental variables demo dune_select.r.","code":""},{"path":"/reference/anova_species.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"anova_species, first step extracts species-niche centroids (SNC) respect dc-CA ordination axes existing dc-CA analysis. second step, applies weighted redundancy analysis SNCs traits predictors. second step thus species-level analysis, final results (eigenvalues/ordination axes) identical analyses steps dc_CA.second step uses R-code analogous anova.wrda.","code":""},{"path":"/reference/anova_species.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"ter Braak, C.J.F. & te Beest, D.E. 2022. Testing environmental effects taxonomic composition canonical correspondence analysis: alternative permutation tests equal. Environmental Ecological Statistics. 29 (4), 849-868. doi:10.1007/s10651-022-00545-4 ter Braak, C.J.F. (2022) Predictor versus response permutation significance testing weighted regression redundancy analysis. Journal statistical computation simulation, 92, 2041-2059. doi:10.1080/00949655.2021.2019256","code":""},{"path":"/reference/anova_species.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: Species-level Permutation Test in Double Constrained Correspondence Analysis (dc-CA) — anova_species","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.021 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 7 0.44542 0.65733 3.2885 0.001 *** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.021 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> a_species <- anova_species(mod) a_species #> $table #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 5 0.44542 0.3367 2.2335 0.016 * #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #> # anova_species can be used for manual forward selection of # trait variables, as done for environmental variables in the demo # dune_FS_dcCA.r, based on the first eigenvalue and its significance # and adding the first axis of the constrained species scores from mod to # the Condition of a new mod. (eig1_and_pval <- c(eig = a_species$eig[1], pval = a_species$table$`Pr(>F)`[1])) #> eig.dcCA1 pval #> 0.2368039 0.0160000 a_species$eig #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 anova_sites(mod) #> $table #> Community-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = TRUE) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 7 0.44542 0.65733 3.2885 0.002 ** #> Residual 12 0.23220 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 dcCA5 #> 0.23680387 0.10903220 0.05933626 0.03791909 0.00232876 #>"},{"path":"/reference/dc_CA.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Double constrained correspondence analysis (dc-CA) analyzing (multi-)trait (multi-)environment ecological data using library vegan native R code. formula interface allows assess, example, importance trait interactions shaping ecological communities. function dc_CA option divide abundance data site site total, giving equal site weights. division advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted (Kleyer et al. 2012).","code":""},{"path":"/reference/dc_CA.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"","code":"dc_CA( formulaEnv = NULL, formulaTraits = NULL, response = NULL, dataEnv = NULL, dataTraits = NULL, divideBySiteTotals = TRUE, dc_CA_object = NULL, verbose = TRUE )"},{"path":"/reference/dc_CA.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"formulaEnv formula one-sided formula rows (samples) row predictors dataEnv. two-sided, left hand side formula used. Specify row covariates () adding + Condition(covariate-formula) formulaEnv rda. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataEnv predictor variables. formulaTraits formula one-sided formula columns (species) column predictors dataTraits. two-sided, left hand side formula used. Specify column covariates () adding + Condition(covariate-formula) formulaTraits cca. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataTraits predictor traits. response matrix, data frame abundance data (dimension n x m) list community weighted means (CWMs) fCWM_SNC. See Details analyses starting community weighted means. Rownames response, , carried . dataEnv matrix data frame row predictors, rows corresponding response. (dimension n x p). dataTraits matrix data frame column predictors, rows corresponding columns response. (dimension m x q). divideBySiteTotals logical; default TRUE closing data dividing rows response total. dc_CA_object optional object earlier run function. Useful formula columns (formulaTraits), dataTraits response used new formula rows. set, data previous run used result first step taken new analysis. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/dc_CA.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"list class dcca; list elements CCAonTraits cca.object cca analysis transpose closed response using formula formulaTraits. formulaTraits argument formulaTraits. formula ~., changed explicit trait names. data list Y, dataEnv dataTraits, removing empty rows columns response closure divideBySiteTotals = TRUE corresponding rows dataEnv dataTraits removed. weights list unit-sum weights row columns. names list c(\"row\", \"columns\"), order. Nobs number sites (rows). CWMs_orthonormal_traits Community weighted means w.r.t. orthonormalized traits. RDAonEnv wrda object cca.object wrda , equal row weights, rda analysis, respectively column scores cca, CWMs orthonormalized traits, using formula formulaEnv. formulaEnv argument formulaEnv. formula ~., changed explicit environmental variable names. eigenvalues dc-CA eigenvalues (rda analysis). c_traits_normed0 mean, sd, VIF (regression) coefficients traits define dc-CA axes terms traits t-ratios missing indicated NAs 'tval1'. inertia one-column matrix four inertias (weighted variances): total: total inertia. conditionT: inertia explained condition formulaTraits present (neglecting row constraints). traits_explain: inertia explained traits (neglecting row predictors condition formulaTraits). maximum row predictors explain dc-CA (sum following two items thus less value). conditionE: trait-constrained inertia explained condition formulaEnv. constraintsTE: trait-constrained inertia explained predictors (without row covariates). verbose TRUE (<- print() invoked) three items. c_traits_normed: mean, sd, VIF (regression) coefficients traits define dc-CA trait axes (composite traits), optimistic t-ratio. c_env_normed: mean, sd, VIF (regression) coefficients environmental variables define dc-CA axes terms environmental variables (composite gradients), optimistic t-ratio. species_axes: list four items species_scores: list names c(\"species_scores_unconstrained\", \"lc_traits_scores\") matrix species niche centroids along dc-CA axes (composite gradients) matrix linear combinations traits. correlation: matrix inter-set correlations traits SNCs. b_se: matrix (unstandardized) regression coefficients traits optimistic standard errors. R2_traits: vector coefficient determination (R2) SNCs traits. square-root thereof called species-trait correlation analogy species-environment correlation CCA. sites_axes: list four items site_scores: list names c(\"site_scores_unconstrained\", \"lc_env_scores\") matrix community weighted means (CWMs) along dc-CA axes (composite gradients) matrix linear combinations environmental variables. correlation: matrix inter-set correlations environmental variables CWMs. b_se: matrix (unstandardized) regression coefficients environmental variables optimistic standard errors. R2_env: vector coefficient determination (R2) CWMs environmental variables. square-root thereof called species-environmental correlation CCA. scores dcca object scaling \"sites\" (1): scaling Focus Case distances .","code":""},{"path":"/reference/dc_CA.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Empty (zero) rows columns response removed response corresponding rows dataEnv dataTraits. Subsequently, columns missing values removed dataEnv dataTraits. gives error ('name_of_variable' found), variables missing entries specified formulaEnv formulaTraits. Computationally, dc-CA can carried single singular value decomposition (ter Braak et al. 2018), computed two steps. first step, transpose response regressed traits (column predictors) using cca formulaTraits. column scores analysis (scaling 1) community weighted means (CWM) orthonormalized traits. regressed environmental (row) predictors using wrda formulaEnv using rda, site weights equal. dc-CA can carried , statisticians call, sufficient statistics method. useful, abundance data available made public paper attempting reproducible research. case, response list first element community weighted means (CWMs) respect traits, trait data, , optionally, elements, functions related dc_CA. minimum list(CWM, weight = list(columns = species_weights)) CWM matrix data.frame, formulaEnv, formulaTraits, dataEnv, dataTraits must specified call dc_CA. function fCWM_SNC example show set response helps create response abundance data non-standard applications dc-CA. Species site weights, set response$weights can set variable weight data frames dataTraits dataEnv, respectively, formulas ~.. statistics scores example dune_dcCA.r, checked results Canoco 5.15 (ter Braak & Šmilauer, 2018).","code":""},{"path":"/reference/dc_CA.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"Kleyer, M., Dray, S., Bello, F., Lepš, J., Pakeman, R.J., Strauss, B., Thuiller, W. & Lavorel, S. (2012) Assessing species community functional responses environmental gradients: multivariate methods? Journal Vegetation Science, 23, 805-821. doi:10.1111/j.1654-1103.2012.01402.x ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2024) vegan: Community Ecology Package. R package version 2.6-6.1. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/dc_CA.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Performs (weighted) double constrained correspondence analysis (dc-CA) — dc_CA","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.106 #> dcCA2 1 0.10903 0.082419 2.7336 0.501 #> dcCA3 1 0.05934 0.044853 1.4877 0.742 #> dcCA4 1 0.03792 0.028663 0.9507 0.806 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.096 . #> dcCA3 1 0.059336 0.08757 3.5776 0.410 #> dcCA4 1 0.037919 0.05596 2.2863 0.654 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.106 #> dcCA2 1 0.10903 0.082419 2.7336 0.501 #> dcCA3 1 0.05934 0.044853 1.4877 0.742 #> dcCA4 1 0.03792 0.028663 0.9507 0.806 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/douconca-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"Double constrained correspondence analysis (dc-CA) analyzing (multi-)trait (multi-)environment ecological data using library vegan native R code. formula interface allows assess, example, importance trait interactions shaping ecological communities. function dc_CA option divide abundance data site site total, giving equal site weights. division advantage multivariate analysis corresponds unweighted (multi-trait) community-level analysis, instead weighted. Throughout two step algorithm ter Braak et al. (2018) used. algorithm combines extends community- (sample-) species-level analyses, .e. (1) usual community weighted means (CWM) regression analysis (2) species-level analysis species-niche centroids (SNC) regression analysis. SNC center realized niche species along environmental variable , case dc-CA, environmental gradient, .e. dc-CA ordination axis. Computationally, dc-CA can carried single singular value decomposition (ter Braak et al. 2018), computed two steps. first step uses canonical correspondence analysis (cca) regress (transposed) abundance data traits second step uses weighed redundancy analysis (wrda , equal site weights, rda) regress CWMs orthonormalized traits, obtained first step, environmental predictors. second step thus community-level analysis. divideBySiteTotals = FALSE, second step uses wrda performs weighted redundancy analysis CWMs environmental variables. Division abundance data site totals advantage resulting analysis (without dimension reduction, .e. retaining dc-CA axes) corresponds series unweighted community-level analyses, instead analyses weighted. Warning: dcCA package built vegan version 2.6-4 uses internal structure vegan cca.object -exported functions f_inertia get_QR source code file functions_using_cca_object_internals.r. main user-functions dc_CA, plot.dcca, scores.dcca, print.dcca anova.dcca.","code":""},{"path":"/reference/douconca-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/douconca-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The package douconca performs double constrained correspondence analysis for trait-environment analysis in ecology — douconca-package","text":"Maintainer: Bart-Jan van Rossum bart-jan.vanrossum@wur.nl (ORCID) Authors: Cajo J.F ter Braak cajo.terbraak@wur.nl (ORCID)","code":""},{"path":"/reference/dune_trait_env.html","id":null,"dir":"Reference","previous_headings":"","what":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","title":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","text":"data dune_trait_env contains three data frames abundance data 28 plant species 20 samples (relevés), trait data (9 traits: 5 morphological 4 ecological (Ellenberg indicator values) environmental data (9 environmental variables, four geographic coordinates). Compared data Jongman et al. (1987, 1995), two moss species lacking, traits plant species geographic coordinates samples added. data following description edited version DataKey Jamil2013_AJ data set CESTES database (Jeliazkov et al. 2020). Dune Meadow Data originate MSc thesis report Batterink & Wijffels (1983). consisted 80 relevés 68 dune meadows (lots) island Terschelling Netherlands. subset data selected Caspar Looman example data set edited book Jongman, ter Braak van Tongeren (1987, 1995). subset consists 20 relevés, 28 species (2 mosses, excluded ) 5 environmental variables. trait data taken LEDA database Jamil et al 2013. spatial coordinates retrieved geo-referencing GIS maps Batterink & Wijffels (1993) Ruut Wegman Cajo ter Braak. X, Y coordinates geo-referencing relevé locations Kaart 3a, 3b 3c; X_lot, Y_lot coordinates Kaart 2a, 2b 2c. Ellenberg indicator values see Ellenberg (1992). data dune_trait_env list elements data frames comm: community data; vegetation data. traits: trait data, taken LEDA database. envir: environmental data, taken Jongman et al. (1987,1995). community data collection done Braun-Blanquet method; data recorded according ordinal scale van der Maarel (1979, Vegetatio, 39, 97-114); see pages XVII-XVIII 18 Jongman, ter Braak & van Tongeren 1995. Nomenclature follows Heukels-Van der Meijden (1983) Flora van Nederland, 20th ed. morphological traits SLA:\t Specific Leaf Area Height:\t Canopy height shoot LDMC: \t Lead dry matter content Seedmass:\tSeed mass Lifespan:\tLife span. Nominal; annual vs. perennial ecological traits (habitat requirements) Ellenberg values F:\t Moisture (ranging [1 12] (low high)) R:\t Soil acidity, ranging [1 9] (acidic alkaline) N: \t Nitrogen requirement, ranging [1 9] (low high) L:\t Light requirement, ranging [1 9] (low high) data frame envir contains environmental variables A1: horizon thickness Moist:\tMoisture content soil (five point scale) Mag: Grassland management type Use:\ttype use (Agricultural grassland use (1) hay production (2) intermediate (3) grazing) Manure:\tQuantity manure applied based N P manuring (N/P class B&W 1983) X:\tlongitude\tgeographical coordinates (m) 2x2 m2 sample (relevé) Y:\tlatitude\tgeographical coordinates (m) 2x2 m2 sample (relevé) X_lot:\tlongitude\tgeographical coordinates (m) lot center Y_lot: latitude\tgeographical coordinates (m) lot center management types standard farming (SF), biological farming (BF), hobby farming (HF), nature conservation management (NM). coordinates Rijksdriehoekscoordinaten meters. https://nl.wikipedia.org/wiki/Rijksdriehoekscoordinaten","code":""},{"path":"/reference/dune_trait_env.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dune meadow data with plant species traits and environmental variables — dune_trait_env","text":"Batterink, M. & Wijffels, G. (1983) Een vergelijkend vegetatiekundig onderzoek naar de typologie en invloeden van het beheer van 1973 tot 1982 de duinweilanden op Terschelling. Landbouwhogeschool. ISN 215909.01. WUR library stacks 704B58. Ellenberg, H. (1992) Indicator values plants Central Europe. Scripta Geobotanica, 18, 258 pp. Jamil, T., Ozinga, W.., Kleyer, M. & ter Braak, C.J.F. (2013) Selecting traits explain species–environment relationships: generalized linear mixed model approach. Journal Vegetation Science, 24, 988-1000. doi:10.1111/j.1654-1103.2012.12036.x . Jeliazkov, ., Mijatovic, D., 78 others. (2020) global database metacommunity ecology, integrating species, traits, environment space. Scientific Data, 7. doi:10.1038/s41597-019-0344-7 . Jongman, R.H.G., ter Braak, C.J.F. & van Tongeren, O.F.R. (1987) Data analysis community landscape ecology. Pudoc, Wageningen. ISBN 90-220-0908-4. Jongman, R.H.G., ter Braak, C.J.F. & van Tongeren, O.F.R. (1995) Data analysis community landscape ecology. Cambridge University Press, Cambridge. ISBN 0-521-47574-0. https://edepot.wur.nl/248017. Kleyer, M., 33 others (2008) LEDA Traitbase: database life-history traits Northwest European flora. Journal Ecology, 96, 1266-1274. doi:10.1111/j.1365-2745.2008.01430.x .","code":""},{"path":"/reference/fCWM_SNC.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"Double constrained correspondence analysis (dc-CA) can calculated directly community weighted means (CWMs), trait data CWMs calculated, environmental data weights species sites (abundance totals species sites). Statistical testing species level requires also species niche centroids (SNCs). function fCWM_SNC calculates CWMs SNCs trait environmental data, respectively, using formula interface, allow categorical traits environmental variables. resulting object can set response argument dc_CA give output call dc_CA abundance data response, least sign changes axes.","code":""},{"path":"/reference/fCWM_SNC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"","code":"fCWM_SNC( response = NULL, dataEnv = NULL, dataTraits = NULL, formulaEnv = NULL, formulaTraits = NULL, divideBySiteTotals = TRUE, dc_CA_object = NULL, minimal_output = TRUE, verbose = TRUE )"},{"path":"/reference/fCWM_SNC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"response matrix, data frame abundance data (dimension n x m) list community weighted means (CWMs) fCWM_SNC. See Details analyses starting community weighted means. Rownames response, , carried . dataEnv matrix data frame row predictors, rows corresponding response. (dimension n x p). dataTraits matrix data frame column predictors, rows corresponding columns response. (dimension m x q). formulaEnv formula one-sided formula rows (samples) row predictors dataEnv. two-sided, left hand side formula used. Specify row covariates () adding + Condition(covariate-formula) formulaEnv rda. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataEnv predictor variables. formulaTraits formula one-sided formula columns (species) column predictors dataTraits. two-sided, left hand side formula used. Specify column covariates () adding + Condition(covariate-formula) formulaTraits cca. covariate-formula contain ~ (tilde). Default: NULL ~., .e. variables dataTraits predictor traits. divideBySiteTotals logical; default TRUE closing data dividing rows response total. dc_CA_object optional object earlier run function. Useful formula columns (formulaTraits), dataTraits response used new formula rows. set, data previous run used result first step taken new analysis. minimal_output logical. Default TRUE use return value response call dc_CA. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/fCWM_SNC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"default returns list CWMs, SNCs, weights, formulaTraits list data elements dataEnv dataTraits. minimal_output = FALSE, many statistics given mainly technical recomputed return value used response call dc_CA.","code":""},{"path":"/reference/fCWM_SNC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"argument formulaTraits determines CWMs calculated. CWMs calculated trait data (non-centered, non-standardized). trait covariates, predictor traits adjusted trait covariates weighted regression, overall weighted mean trait added. advantage CWM scale original trait. SNCs calculated analogously environmental data. Empty (zero) rows columns response removed response corresponding rows dataEnv dataTraits. Subsequently, columns missing values removed dataEnv dataTraits. gives error (object 'name_of_variable' found), variables missing entries specified formulaEnv formulaTraits. current implementation, formulaEnv formulaTraits contain variable names , .e. transformations variables formulas gives error ('undefined columns selected') scores function applied.","code":""},{"path":"/reference/fCWM_SNC.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"Kleyer, M., Dray, S., Bello, F., Lepš, J., Pakeman, R.J., Strauss, B., Thuiller, W. & Lavorel, S. (2012) Assessing species community functional responses environmental gradients: multivariate methods? Journal Vegetation Science, 23, 805-821. doi:10.1111/j.1654-1103.2012.01402.x ter Braak, CJF, Šmilauer P, Dray S. 2018. Algorithms biplots double constrained correspondence analysis. Environmental Ecological Statistics, 25(2), 171-197. doi:10.1007/s10651-017-0395-x ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/fCWM_SNC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate community weighted means and species niche centroids for double constrained correspondence analysis — fCWM_SNC","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites CWMSNC <- fCWM_SNC(formulaEnv = ~ A1 + Moist + Manure + Use + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Condition(Seedmass) + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) names(CWMSNC) #> [1] \"CWM\" \"SNC\" \"formulaEnv\" \"formulaTraits\" #> [5] \"weights\" \"call\" \"data\" #CWMSNC$SNC <- NULL # would give correct dc-CA but no species-level t-values or test mod <- dc_CA(response = CWMSNC) # formulas and data are in CWMSNC! #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> NULL #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Manure + #> Use + Condition(Mag), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Conditional 0.1794 0.3512 3 #> Constrained 0.1377 0.2695 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.07351 0.03911 0.02064 0.00442 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> MagBF 0.15 1.5969 4.5016 0.1152 0.7224 #> MagHF 0.25 1.9365 2.6715 0.0658 0.5359 #> MagNM 0.30 2.0494 9.5666 0.0046 0.0199 #> A1 4.85 9.4989 1.6967 0.1562 1.5958 #> Moist 2.90 7.8613 1.7658 0.1492 1.4946 #> Manure 1.75 6.4614 9.3847 0.0320 0.1388 #> Use 1.90 3.4351 1.7825 0.1020 1.0172 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0724 -0.1662 #> SLA 24.6468 6.3438 1.1888 -0.4217 -0.9226 #> Height 25.1272 15.6848 1.3033 0.5546 1.1589 #> LDMC 244.5084 70.9729 1.1791 -0.8979 -1.9726 #> Lifespanperennial 0.9607 0.1944 1.0964 0.3589 0.8176 #> #> weighted variance #> traits_explain 0.511 #> conditionE 0.179 #> constraintsTE 0.138 #> attr(,\"meaning\") #> meaning #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" # note that output also gives the environment-constrained inertia, # which is a bonus compare to the usual way to carry out a dcCA. anova(mod) #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(response = CWMSNC) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA 4 0.13769 0.22615 1.6073 0.175 #> Residual 22 0.47115 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 4 0.13769 0.41538 2.1316 0.03 * #> Residual 12 0.19379 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(response = CWMSNC) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA 4 0.13769 0.22615 1.6073 0.175 #> Residual 22 0.47115 #>"},{"path":"/reference/getPlotdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"getPlotdata extracts data dc_CA object plotting CWMs SNCs single axis.","code":""},{"path":"/reference/getPlotdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"","code":"getPlotdata( x, axis = 1, envfactor = NULL, traitfactor = NULL, newnames = NULL, facet = TRUE, remove_centroids = FALSE )"},{"path":"/reference/getPlotdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"x results dc_CA class dcca. axis axis number get (default 1). envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. facet logical. Default TRUE CWMs SNCs plots separate panels. FALSE, parameter changes position environmental centroid names (left right). remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids.","code":""},{"path":"/reference/getPlotdata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"list three components CWM_SNC data.frame containing plot data trait_env_scores vector scores per trait/environment newNameList vector new names used plot","code":""},{"path":"/reference/getPlotdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Utility function: extracting data from a dc_CA object for plotting a single axis by your own code or plot.dcca. — getPlotdata","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) dat <- getPlotdata(out) names(dat) #> [1] \"CWM_SNC\" \"trait_env_scores\" \"newNameList\" names(dat$CWM_SNC) #> [1] \"dcCA1\" \"score\" \"label\" \"CWM-SNC\" #> [5] \"weight\" \"type\" \"points\" \"sizeweight\" #> [9] \"smoothweight\" \"xforsmooth\" \"groups\" \"names\" #> [13] \"centroidnames\" levels(dat$CWM_SNC$groups) #> [1] \"SF\" \"BF\" \"HF\" \"NM\" \"annual\" \"perennial\" plot(out)"},{"path":"/reference/plot.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"plot.dcca plots CWMs SNCs dc-CA axis axis, optional centroids colors groups sites /species available data.","code":""},{"path":"/reference/plot.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"","code":"# S3 method for class 'dcca' plot( x, ..., axis = 1, gradient_description = \"correlation\", envfactor = NULL, traitfactor = NULL, nspecies = 20, species_groups = NULL, widths = c(5, 1, 1), newnames = NULL, facet = TRUE, remove_centroids = FALSE, with_lines = TRUE, verbose = TRUE )"},{"path":"/reference/plot.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"x results dc_CA class dcca. ... unused. axis axis number get (default 1). gradient_description character 2-character vector trait environmental gradient, respectively specifying plot vertical line plots describe dc-CA axis (trait environmental gradients). Default: correlation intra-set correlations sets variables dc-CA axis. values : c(\"weights\", \"tvalues\", \"inter_set_correlation\") regression weights, t-values inter-set correlation, correlation SNCs CWMs traits environmental variables, respectively. \"regression\" alias \"weights\". envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. nspecies integer. Default 20 including vertical species plot nspecies highest contribution. species_groups name variable dataTraits dc_CA. Default NULL grouping. Species groups colored differentially. widths relative widths CWM-SNC plot, correlation/weight plot species plot. (see grid.arrange). Default c(5, 1, 1). newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. facet logical. Default TRUE CWMs SNCs plots separate panels. parameter changes position centroid names (left right environmental centroids). facet = FALSE with_lines = TRUE, line fits ignore groups species sites. remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids. with_lines logical. Default TRUE straight lines groups points. verbose logical. Default TRUE plotting result.","code":""},{"path":"/reference/plot.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"ggplot object","code":""},{"path":"/reference/plot.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"want set new names, look names arguments default, .e. myplot <- plot(x), consult myplot$nameList$newnames order names traits environmental variables. Note covariates list names. Contribution (definition species selection nspecies) defined (CA) total species abundance (possibly, closed) data multiplied square score axis. plot.dcca returns error \"Error grid.Call\", enlarge plotting area use verbose = FALSE assign result.","code":""},{"path":"/reference/plot.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot a single dc-CA axis with CWMs, SNCs, trait and environment scores. — plot.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Mag, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) dat <- getPlotdata(out) names(dat) #> [1] \"CWM_SNC\" \"trait_env_scores\" \"newNameList\" names(dat$CWM_SNC) #> [1] \"dcCA1\" \"score\" \"label\" \"CWM-SNC\" #> [5] \"weight\" \"type\" \"points\" \"sizeweight\" #> [9] \"smoothweight\" \"xforsmooth\" \"groups\" \"names\" #> [13] \"centroidnames\" levels(dat$CWM_SNC$groups) #> [1] \"SF\" \"BF\" \"HF\" \"NM\" \"annual\" \"perennial\" plot(out)"},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"plot_dcCA_CWM_SNC plots CWMs SNCs dc-CA axis axis, optional centroids colors groups sites /species available data.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"","code":"plot_dcCA_CWM_SNC( x, axis = 1, envfactor = NULL, traitfactor = NULL, facet = TRUE, newnames = NULL, remove_centroids = FALSE, with_lines = TRUE, getPlotdata2plotdCCA = NULL )"},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"x results dc_CA class dcca. axis axis number get (default 1). envfactor name row factor display color lines CWM plot (default NULL). default extracts factor environmental model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. traitfactor name column factor display color lines SNC plot (default NULL). default extracts factor trait model. set NA, additional coloring lines displayed plot.dcca. parameter sets groups variable CWM_SNC data frame return value/plot. facet logical. Default TRUE CWMs SNCs plots separate panels. parameter changes position centroid names (left right environmental centroids). facet = TRUE with_lines = TRUE, line fits ignore groups species sites. newnames list two elements: names traits environmental variables, default NULL names derived result scores.dcca tidy = TRUE. remove_centroids logical remove centroids plot data (default FALSE). Can two-vector, e.g. c(TRUE, FALSE) remove environmental centroids. with_lines logical. Default TRUE straight lines groups points. traitfactor = NA envfactor = NA. Centroids displayed case. getPlotdata2plotdCCA results getPlotdata. Default NULL.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"ggplot object","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"argument getPlotdata2plotdCCA allow modifications data frame resulting getPlotdata. variable names score levels remain untouched. plot_dcCA_CWM_SNC uses variables: dcCAk axis number k \"CWM-SNC\", \"groups\", \"points\", \"sizeweight\" y-axis, coloring, shape size items, respectively. function used plot.dcca.","code":""},{"path":"/reference/plot_dcCA_CWM_SNC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the CWMs and SNCs of a single dc-CA axis. — plot_dcCA_CWM_SNC","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites # must delete \"Sites\" from response matrix or data frame Y <- dune_trait_env$comm[, -1] # must delete \"Sites\" out <- dc_CA(formulaEnv = ~ A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = Y, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) plot_dcCA_CWM_SNC(out, facet = FALSE)"},{"path":"/reference/plot_species_scores_bk.html","id":null,"dir":"Reference","previous_headings":"","what":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"plot_species_scores_bk creates vertical line plot ordination scores selection criterion scores plot names.","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"","code":"plot_species_scores_bk( species_scores, ylab = \"scores\", threshold = 7, y_lab_interval = 0.5, speciesname = NULL, scoresname = \"RDA1\", selectname = \"Fratio1\", speciesgroup = NULL, expand = 0.2, verbose = TRUE )"},{"path":"/reference/plot_species_scores_bk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"species_scores species--scores matrix, data frame row names (species names) tibble variable name speciesname containing species names column variable name scoresname containing scores (default: \"RDA1\"), e.g. species scores library vegan. ylab y-axis label. Default: $b_k$. threshold species criterion (specified selectname) higher threshold displayed. Default: 7 (threshold F-ratio testing single regression coefficient p = 0.01 60 df error multiple regression single species onto condition ordination axis). selectname species_scores, threshold divided 14, default 0.5. y_lab_interval interval y-axis ticks. tick effect (0) always included; default: 0.5. speciesname name variable containing species names (default NULL uses row names). scoresname name column variable containing species scores plotted (default \"RDA1\"). selectname name column variable containing criterion selection species displayed. Default: \"Fratio1\"; selectname found species_scores, set scoresname. speciesgroup name factor, levels receive different colors vertical plot. expand amount extension line plot (default 0.2). verbose logical printing number species names total number (default: TRUE).","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"ggplot object","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"absolute value criterion values taken selection, also species scores ordination can serve criterion (e.g. selectname = \"RDA1\"). function copied PRC package https://github.com/CajoterBraak/PRC. function used plot.dcca.","code":""},{"path":"/reference/plot_species_scores_bk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Vertical ggplot2 line plot of ordination scores — plot_species_scores_bk","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) env_scores <- scores(mod, display = \"tval\") env_scores <- data.frame(env_scores) env_scores$group <- c(\"quantitative\", \"category\")[c(1, 1, 2, 2, 2, 1, 1)] plot_species_scores_bk( species_scores = env_scores, ylab = \"optimistic t-values\", threshold = 0, y_lab_interval = 1, scoresname = \"dcCA1\", speciesgroup = \"group\", verbose = FALSE )"},{"path":"/reference/predict.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"Prediction traits environment, environment traits response trait environment data. type = \"traits\" newdata = NULL, predict gives fitted mean traits, .e. fitted community weighted means. type = \"env\" newdata = NULL, predict gives fitted mean environment, .e. fitted species niche centroids.","code":""},{"path":"/reference/predict.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"","code":"# S3 method for class 'dcca' predict( object, ..., type = c(\"env\", \"traits\", \"response\", \"reg_env\", \"reg_traits\"), rank = \"full\", newdata = NULL )"},{"path":"/reference/predict.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"object return value dc_CA. ... arguments passed function (currently ignored). type type prediction, c(\"env\", \"traits\", \"response\", \"reg_env\", \"reg_trait\") environmental values, values traits, response (expected abundance), regression coefficients environmental trait predictors. rank rank number axes use. Default \"full\" axes (rank-reduction). newdata Data look variables predict. type = \"reg_env\" \"reg_trait\" newdata ignored. type = \"env\" \"trait\", newdata data frame trait environmental values, respectively, used prediction. omitted, fitted values generated. type = \"response\", newdata list two data frames trait environmental values order, e.g. list(traits = dataTraits, env = dataEnv).","code":""},{"path":"/reference/predict.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"matrix predictions. exact content matrix depends type predictions made.","code":""},{"path":"/reference/predict.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"Variables model newdata set weighted means training data. Predictions thus (weighted) mean quantitative variables included. Predictions -included factors weighted mean (none factor effects included). type = \"response\" non-null newdata, species weights training used; site weights taken equal. Many predicted values may negative, indicating expected absences (0) small expected response values. Regression coefficients obtained type = \"reg_env\" type = \"reg_traits\" standardized traits environmental variables.","code":""},{"path":"/reference/predict.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction for double-constrained correspondence analysis (dc-CA) — predict.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Condition(Manure), formulaTraits = ~ SLA + Height + LDMC + Condition(Seedmass) + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Condition(Seedmass) + #> Lifespan, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Condition(Manure), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Conditional 0.1297 0.2538 1 #> Constrained 0.1875 0.3669 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.08709 0.06049 0.02234 0.01755 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 1.75 6.4614 9.3847 -0.2575 -1.0000 #> A1 4.85 9.4989 1.6967 -0.1167 -1.0660 #> Moist 2.90 7.8613 1.7658 -0.2097 -1.8779 #> MagBF 0.15 1.5969 4.5016 -0.1050 -0.5889 #> MagHF 0.25 1.9365 2.6715 -0.1489 -1.0841 #> MagNM 0.30 2.0494 9.5666 -0.2628 -1.0109 #> Use 1.90 3.4351 1.7825 -0.0537 -0.4782 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 0.1752 0.4465 #> SLA 24.6468 6.3438 1.1888 0.6785 1.6471 #> Height 25.1272 15.6848 1.3033 -0.5549 -1.2867 #> LDMC 244.5084 70.9729 1.1791 0.5597 1.3644 #> Lifespanperennial 0.9607 0.1944 1.0964 -0.3820 -0.9656 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> conditionE 0.130 #> constraintsTE 0.187 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" # regression coefficients predict(mod, type = \"reg_env\") #> SLA Height LDMC Lifespanannual Lifespanperennial #> Manure -0.23423414 0.2540139 0.32912396 -0.37130684 0.37130684 #> A1 0.05226663 0.1025887 -0.08560552 -0.12390838 0.12390838 #> Moist -0.18017363 0.1836804 0.04051036 -0.02158823 0.02158823 #> MagBF -0.01504873 0.1005833 0.10645047 -0.25809310 0.25809310 #> MagHF -0.05899194 0.1044629 0.03221358 -0.18057689 0.18057689 #> MagNM -0.29468992 0.1739784 0.33095579 -0.39679946 0.39679946 #> Use -0.04563582 -0.1100948 -0.17509044 0.03719925 -0.03719925 predict(mod, type = \"reg_traits\") #> A1 Moist MagSF MagBF MagHF #> Seedmass -0.02240045 -0.04978638 -0.01023869 0.041848273 0.009631558 #> SLA -0.06845546 -0.16774065 -0.02649254 0.146106902 0.034893995 #> Height 0.15457078 0.15961290 0.02806485 -0.073452767 0.041610702 #> LDMC -0.17828444 -0.10419687 0.01403797 0.005732252 -0.079309518 #> Lifespanperennial 0.08878173 0.02537622 -0.05136037 -0.005425793 0.007615053 #> MagNM Use #> Seedmass -0.03147019 0.004500904 #> SLA -0.12032477 -0.090142614 #> Height -0.01014934 0.018558815 #> LDMC 0.05643595 -0.180870869 #> Lifespanperennial 0.04839256 0.080107192 # fit the mean traits at each site (20x6), # that is CWM at each site pred.traits <- predict(mod, type = \"traits\") head(pred.traits) #> SLA Height LDMC Lifespanannual Lifespanperennial #> 1 24.69054 23.04477 262.1525 0.047500047 0.9525000 #> 2 26.58938 22.47821 248.9740 -0.001033559 1.0010336 #> 3 24.27447 25.82005 259.4974 0.028101542 0.9718985 #> 4 24.25886 25.74429 259.7835 0.029235611 0.9707644 #> 5 26.80648 26.21316 241.2643 0.017241993 0.9827580 #> 6 26.11737 22.44992 230.8071 0.049338100 0.9506619 # fit the mean environment for each species (28x8) # that is SNC of each species pred.env <- predict(mod, type = \"env\") head(pred.env) #> A1 Moist MagSF MagBF MagHF #> Achillea millefolium 5.342999 3.326274 0.2987008 0.1012023 0.2658685 #> Agrostis stolonifera 4.529007 2.576826 0.2877323 0.1864249 0.2361958 #> Aira praecox 3.642275 2.771151 0.4244468 0.1056802 0.1759198 #> Alopecurus geniculatus 4.774155 2.531686 0.2733250 0.2228758 0.2796069 #> Anthoxanthum odoratum 3.917107 2.475008 0.3079576 0.1444949 0.1555197 #> Bellis perennis 4.651703 2.424855 0.2610354 0.2306304 0.2703286 #> MagNM Use #> Achillea millefolium 0.3342285 2.102427 #> Agrostis stolonifera 0.2896470 1.794929 #> Aira praecox 0.2939532 1.624523 #> Alopecurus geniculatus 0.2241924 1.874519 #> Anthoxanthum odoratum 0.3920278 1.618153 #> Bellis perennis 0.2380056 1.944774 pred.resp <- predict(mod, type = \"response\") # pred has negative values and dc_CA cannot have negatives in the response # so, modify pred.resp, #whichgives about similar eigenvalues as the original data pred.resp[pred.resp < 0] <- 0 mod3 <- dc_CA(formulaEnv = mod$formulaEnv, formulaTraits = mod$formulaTraits, response = pred.resp, dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Condition(Seedmass) + #> Lifespan, data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 1.661e-01 1.000e+00 #> Conditional 8.889e-06 5.352e-05 1 #> Constrained 1.641e-01 9.881e-01 4 #> Unconstrained 1.971e-03 1.187e-02 10 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.07673 0.05423 0.01895 0.01419 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.0009360 0.0005522 0.0002421 0.0001346 0.0000649 0.0000307 0.0000100 0.0000003 #> CA9 CA10 #> 0.0000001 0.0000000 #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Condition(Manure), data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 1.641e-01 1.000e+00 #> Conditional 9.073e-05 5.529e-04 1 #> Constrained 1.635e-01 9.961e-01 4 #> Unconstrained 5.461e-04 3.328e-03 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.07667 0.05405 0.01874 0.01399 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 2.729e-04 2.527e-04 1.775e-05 2.780e-06 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 1.75 6.4614 9.3847 0.1783 26.9699 #> A1 4.85 9.4989 1.6967 0.0918 32.6413 #> Moist 2.90 7.8613 1.7658 0.1966 68.5625 #> MagBF 0.15 1.5969 4.5016 0.0637 13.9152 #> MagHF 0.25 1.9365 2.6715 0.1152 32.6500 #> MagNM 0.30 2.0494 9.5666 0.1860 27.8637 #> Use 1.90 3.4351 1.7825 0.0741 25.7072 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6554 0.6697 1.0755 -0.1577 -7.8655 #> SLA 24.6051 6.3645 1.1910 -0.6932 -32.8545 #> Height 25.1952 15.7708 1.3041 0.5404 24.4755 #> LDMC 244.6988 71.3268 1.1756 -0.6101 -29.1066 #> Lifespanperennial 0.9584 0.1997 1.0991 0.2877 14.1958 #> #> weighted variance #> total 0.166 #> conditionT 0.000 #> traits_explain 0.164 #> conditionE 0.000 #> constraintsTE 0.163 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> conditionE \"trait-constrained inertia explained by the condition in formulaEnv\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" mod3$eigenvalues / mod$eigenvalues #> dcCA1 dcCA2 dcCA3 dcCA4 #> 0.8803851 0.8934459 0.8390431 0.7971850"},{"path":"/reference/print.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a summary of a dc-CA object. — print.dcca","title":"Print a summary of a dc-CA object. — print.dcca","text":"Print summary dc-CA object.","code":""},{"path":"/reference/print.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a summary of a dc-CA object. — print.dcca","text":"","code":"# S3 method for class 'dcca' print(x, ...)"},{"path":"/reference/print.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a summary of a dc-CA object. — print.dcca","text":"x dc-CA object dc_CA. ... arguments passed function (currently ignored).","code":""},{"path":"/reference/print.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print a summary of a dc-CA object. — print.dcca","text":"return value, results printed console.","code":""},{"path":"/reference/print.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Print a summary of a dc-CA object. — print.dcca","text":"x <- print(x) efficient scores.dcca just print(x) dc_CA called verbose = FALSE).","code":""},{"path":"/reference/print.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print a summary of a dc-CA object. — print.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.091 . #> dcCA2 1 0.10903 0.082419 2.7336 0.496 #> dcCA3 1 0.05934 0.044853 1.4877 0.771 #> dcCA4 1 0.03792 0.028663 0.9507 0.798 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.099 . #> dcCA3 1 0.059336 0.08757 3.5776 0.389 #> dcCA4 1 0.037919 0.05596 2.2863 0.657 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.091 . #> dcCA2 1 0.10903 0.082419 2.7336 0.496 #> dcCA3 1 0.05934 0.044853 1.4877 0.771 #> dcCA4 1 0.03792 0.028663 0.9507 0.798 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/print.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a summary of a wrda object — print.wrda","title":"Print a summary of a wrda object — print.wrda","text":"Print summary wrda object","code":""},{"path":"/reference/print.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a summary of a wrda object — print.wrda","text":"","code":"# S3 method for class 'wrda' print(x, ...)"},{"path":"/reference/print.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a summary of a wrda object — print.wrda","text":"x wrda object wrda ... arguments passed function (currently ignored).","code":""},{"path":"/reference/print.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print a summary of a wrda object — print.wrda","text":"return value, results printed console.","code":""},{"path":"/reference/print.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print a summary of a wrda object — print.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.012 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. vegan scores","code":""},{"path":"/reference/scores.dcca.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"function works much like vegan scores function, particular scores.cca, additional results regression coefficients linear combinations traits ('reg_traits', 'lc_traits'). scores CA obey called transition formulas scores CCA dc-CA. differences , CCA, linear combinations environmental variables (constrained site scores) replace usual (unconstrained) site scores, dc-CA, linear combinations traits (constrained species scores) also replace usual (unconstrained) species scores transition formulas.","code":""},{"path":"/reference/scores.dcca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"","code":"# S3 method for class 'dcca' scores( x, ..., choices = 1:2, display = \"all\", scaling = \"sym\", which_cor = \"in model\", tidy = FALSE )"},{"path":"/reference/scores.dcca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"x object class \"dcca\", .e. result dc_CA. ... arguments passed function (currently ignored). choices integer vector axes obtain. Default: dc-CA axes. display character vector, one c(\"\", \"species\", \"sites\", \"sp\", \"wa\", \"lc\", \"bp\", \"cor\", \"ic\", \"reg\", \"tval\", \"cn\", \"lc_traits\", \"reg_traits\", \"tval_traits\", \"cor_traits\", \"ic_traits\", \"bp_traits\", \"cn_traits\"). items scores.cca, except \"cor\" \"ic\", inter-set intra-set correlations, respectively, \"tval\" (-optimistic) t-values regression coefficients. remaining scores analogous scores species traits. scaling numeric (1,2 3) character \"sites\", \"species\" \"symmetric\". Default: \"symmetric\". Either site- (1) species- (2) related scores scaled eigenvalues, set scores unit weighted mean square 3 scaled symmetrically weighted mean squares equal square root eigenvalues. Negative values treated corresponding positive ones abs(scaling). which_cor character list trait environmental variables names (order) data frames inter-set correlations must calculated. Default: character (\"in_model\") traits variables model, including collinear variables levels. tidy Return scores compatible ggplot2: scores single data.frame, score type identified factor variable score, names variable label, species weights (dc_CA variable weight. See scores.cca.","code":""},{"path":"/reference/scores.dcca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"data frame tidy = TRUE. Otherwise, matrix single item asked named list matrices one item asked . following names can included: c(\"sites\", \"constraints_sites\", \"centroids\", \"regression\", \"t_values\", \"correlation\", \"intra_set_correlation\", \"biplot\", \"species\", \"constraints_species\", \"regression_traits\", \"t_values_traits\", \"correlation_traits\", \"intra_set_correlation_traits\", \"biplot_traits\", \"centroids_traits\"). matrix attribute \"meaning\" explaining meaning. tidy = TRUE, resulting data frame attributes \"scaling\" \"meaning\"; latter two columns: (1) name score type (2) meaning, usage interpretation. example meaning scores scaling \"symmetric\" display =\"\": sites CMWs trait axes (constraints species) scaling 'symmetric' optimal biplots , almost , inter-site distances. constraints_sites linear combination environmental predictors covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-site distances. regression mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values t-values coefficients regression CWMs trait composite environmental variables correlation inter set correlation, correlation environmental variables sites scores (CWMs) intra_set_correlation intra set correlation, correlation environmental variables dc-ca axis (constrained sites scores) biplot biplot scores environmental variables display biplot-traits fourth-corner correlations scaling 'symmetric'. centroids environmental category means site scores scaling 'symmetric' optimal biplots , almost , inter-environmental category distances. species SNC environmental axes (constraints sites) scaling 'symmetric' optimal biplots , almost , inter-species distances. constraints_species linear combination traits trait covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-species distances. regression_traits mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values_traits t-values coefficients regression SNCs along dc-CA axis traits correlation_traits inter set correlation, correlation traits species scores (SNCs) intra_set_correlation_traits intra set correlation, correlation traits dc-ca axis (constrained species scores) biplot_traits biplot scores traits display biplot scores fourth-corner correlation scaling 'symmetric'. centroids_traits trait category means species scores scaling 'symmetric' optimal biplots , almost , inter-trait category distances. statements optimality distance interpretations based scaling relative magnitude dc-CA eigenvalues chosen axes.","code":""},{"path":"/reference/scores.dcca.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"function modeled scores.cca. t-ratios taken multiple regression unconstrained species (site) scores traits (environmental variables). example which_cor : which_cor = list(traits = \"SLA\", env = c(\"acidity\", \"humidity\")).","code":""},{"path":"/reference/scores.dcca.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract results of a double constrained correspondence analysis (dc-CA) — scores.dcca","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites mod <- dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Seedmass + Lifespan, data = #> dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.3490 1.0000 #> Constrained 0.6776 0.2885 5 #> Unconstrained 1.6714 0.7115 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 CCA5 #> 0.26839 0.19597 0.12356 0.07003 0.01967 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.6776 1.0000 #> Constrained 0.4454 0.6573 5 #> Unconstrained 0.2322 0.3427 5 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 RDA5 #> 0.23680 0.10903 0.05934 0.03792 0.00233 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 PC5 #> 0.12017 0.05836 0.03455 0.01337 0.00575 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0605 -0.9172 #> Moist 2.90 7.8613 1.7658 0.3250 4.8293 #> MagBF 0.15 1.5969 4.5016 -0.0475 -0.4421 #> MagHF 0.25 1.9365 2.6715 -0.0156 -0.1890 #> MagNM 0.30 2.0494 9.5666 0.1622 1.0352 #> Use 1.90 3.4351 1.7825 0.0219 0.3239 #> Manure 1.75 6.4614 9.3847 -0.1444 -0.9306 #> Avg SDS VIF Regr1 tval1 #> SLA 24.6468 6.3438 1.1888 -0.8196 -3.6933 #> Height 25.1272 15.6848 1.3033 -0.1598 -0.6877 #> LDMC 244.5084 70.9729 1.1791 -0.0562 -0.2542 #> Seedmass 0.6543 0.6688 1.0784 -0.7586 -3.5896 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1006 0.4722 #> #> weighted variance #> total 2.349 #> traits_explain 0.678 #> constraintsTE 0.445 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" anova(mod, by = \"axis\") #> $species #> Species-level permutation test using dc-CA #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Residualized predictor permutation #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.100 #> dcCA2 1 0.10903 0.082419 2.7336 0.491 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.820 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> #> $sites #> Df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.236804 0.34946 14.2776 0.001 *** #> dcCA2 1 0.109032 0.16090 6.5739 0.090 . #> dcCA3 1 0.059336 0.08757 3.5776 0.412 #> dcCA4 1 0.037919 0.05596 2.2863 0.665 #> dcCA5 1 0.002329 0.00344 0.1404 1.000 #> Residual 14 0.232199 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $max #> Max test combining the community- and species- level tests #> Model: dc_CA(formulaEnv = ~A1 + Moist + Mag + Use + Manure, formulaTraits = ~SLA + Height + LDMC + Seedmass + Lifespan, response = dune_trait_env$comm[, -1], dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> #> Taken from the species-level test: #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df ChiSquare R2 F Pr(>F) #> dcCA1 1 0.23680 0.179002 5.9370 0.100 #> dcCA2 1 0.10903 0.082419 2.7336 0.491 #> dcCA3 1 0.05934 0.044853 1.4877 0.760 #> dcCA4 1 0.03792 0.028663 0.9507 0.820 #> dcCA5 1 0.00233 0.001760 0.0584 1.000 #> Residual 22 0.87749 #> # For more demo on testing, see demo dune_test.r mod_scores <- scores(mod) # correlation of axes with a variable that is not in the model scores(mod, display = \"cor\", scaling = \"sym\", which_cor = list(NULL, \"X_lot\")) #> CWM-ax1 CWM-ax2 #> X_lot 0.1425494 0.06695038 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" cat(\"head of unconstrained site scores, with meaning\\n\") #> head of unconstrained site scores, with meaning print(head(mod_scores$sites)) #> dcCA1 dcCA2 #> 1 -1.2640026 0.19395232 #> 2 -0.7328822 -0.24929614 #> 3 -0.8250139 -0.44760064 #> 4 -0.4453407 -0.33741144 #> 5 -0.5783587 0.01524487 #> 6 -0.5722181 0.24340264 mod_scores_tidy <- scores(mod, tidy = TRUE) print(\"names of the tidy scores\") #> [1] \"names of the tidy scores\" print(names(mod_scores_tidy)) #> [1] \"dcCA1\" \"dcCA2\" \"score\" \"label\" \"weight\" cat(\"\\nThe levels of the tidy scores\\n\") #> #> The levels of the tidy scores print(levels(mod_scores_tidy$score)) #> [1] \"biplot\" \"biplot_traits\" #> [3] \"centroids\" \"centroids_traits\" #> [5] \"constraints_sites\" \"constraints_species\" #> [7] \"correlation\" \"correlation_traits\" #> [9] \"factorbiplot\" \"factorbiplot_traits\" #> [11] \"intra_set_correlation\" \"intra_set_correlation_traits\" #> [13] \"regression\" \"regression_traits\" #> [15] \"sites\" \"species\" #> [17] \"t_values\" \"t_values_traits\" cat(\"\\nFor illustration: a dc-CA model with a trait covariate\\n\") #> #> For illustration: a dc-CA model with a trait covariate mod2 <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Manure, formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits) #> Step 1: the CCA ordination of the transposed matrix with trait constraints, #> useful in itself and also yielding CWMs of the orthonormalized traits for step 2. #> Call: cca(formula = tY ~ SLA + Height + LDMC + Lifespan + #> Condition(Seedmass), data = dataTraits) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 2.34899 1.00000 #> Conditional 0.16671 0.07097 1 #> Constrained 0.51091 0.21750 4 #> Unconstrained 1.67137 0.71153 19 #> #> Inertia is scaled Chi-square #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> CCA1 CCA2 CCA3 CCA4 #> 0.21499 0.18622 0.07354 0.03616 #> #> Eigenvalues for unconstrained axes: #> CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 #> 0.4386 0.2396 0.1938 0.1750 0.1429 0.1112 0.0854 0.0601 #> (Showing 8 of 19 unconstrained eigenvalues) #> #> Step 2: the RDA ordination of CWMs of the orthonormalized traits #> of step 1 with environmental constraints: #> Call: rda(formula = out1$CWMs_orthonormal_traits ~ A1 + Moist + Mag + Use + #> Manure, data = out1$data$dataEnv) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 0.5109 1.0000 #> Constrained 0.3171 0.6207 4 #> Unconstrained 0.1938 0.3793 4 #> #> Inertia is variance #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> RDA1 RDA2 RDA3 RDA4 #> 0.16632 0.08100 0.04766 0.02215 #> #> Eigenvalues for unconstrained axes: #> PC1 PC2 PC3 PC4 #> 0.11386 0.04942 0.01888 0.01162 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> A1 4.85 9.4989 1.6967 -0.0920 -1.1424 #> Moist 2.90 7.8613 1.7658 0.1002 1.2204 #> MagBF 0.15 1.5969 4.5016 0.0125 0.0951 #> MagHF 0.25 1.9365 2.6715 0.0405 0.4006 #> MagNM 0.30 2.0494 9.5666 0.3052 1.5969 #> Use 1.90 3.4351 1.7825 0.0927 1.1234 #> Manure 1.75 6.4614 9.3847 -0.1567 -0.8277 #> Avg SDS VIF Regr1 tval1 #> Seedmass 0.6543 0.6688 1.0784 -0.0929 -0.3874 #> SLA 24.6468 6.3438 1.1888 -1.0644 -4.2276 #> Height 25.1272 15.6848 1.3033 -0.5285 -2.0049 #> LDMC 244.5084 70.9729 1.1791 0.0433 0.1728 #> Lifespanperennial 0.9607 0.1944 1.0964 0.1744 0.7211 #> #> weighted variance #> total 2.349 #> conditionT 0.167 #> traits_explain 0.511 #> constraintsTE 0.317 #> attr(,\"meaning\") #> meaning #> total \"total inertia\" #> conditionT \"inertia of the trait condition\" #> traits_explain \"trait-constrained inertia\" #> constraintsTE \"trait-constrained inertia explained by the predictors in formulaEnv\" cat(\"\\nFor illustration: a dc-CA model with both environmental and trait covariates\\n\") #> #> For illustration: a dc-CA model with both environmental and trait covariates mod3 <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), formulaTraits = ~ SLA + Height + LDMC + Lifespan + Condition(Seedmass), response = dune_trait_env$comm[, -1], # must delete \"Sites\" dataEnv = dune_trait_env$envir, dataTraits = dune_trait_env$traits, verbose = FALSE) cat(\"\\nFor illustration: same model but using dc_CA_object = mod2 for speed, \", \"as the trait model and data did not change\\n\") #> #> For illustration: same model but using dc_CA_object = mod2 for speed, as the trait model and data did not change mod3B <- dc_CA(formulaEnv = ~A1 + Moist + Use + Manure + Condition(Mag), dataEnv = dune_trait_env$envir, dc_CA_object = mod2, verbose= FALSE) cat(\"\\ncheck on equality of mod3 (from data) and mod3B (from a dc_CA_object)\\n\", \"the expected difference is in the component 'call'\\n \") #> #> check on equality of mod3 (from data) and mod3B (from a dc_CA_object) #> the expected difference is in the component 'call' #> print(all.equal(mod3, mod3B)) # only the component call differs #> [1] \"Component “call”: target, current do not match when deparsed\""},{"path":"/reference/scores.wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"function works much like vegan scores function, particular scores.cca, regression coefficients predictors.","code":""},{"path":"/reference/scores.wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"","code":"# S3 method for class 'wrda' scores( x, ..., choices = 1:2, display = \"all\", scaling = \"sym\", which_cor = \"in model\", tidy = FALSE )"},{"path":"/reference/scores.wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"x object class \"wrda\", .e. result wrda. ... arguments passed function (currently ignored). choices integer vector axes obtain. Default: wrda axes. display character vector, one c(\"\", \"species\", \"sites\", \"sp\", \"wa\", \"lc\", \"bp\", \"cor\", \"ic\", \"reg\", \"tval\", \"cn\"). items scores.cca, except \"cor\" \"ic\", inter-set intra-set correlations, respectively, \"tval\" (-optimistic) t-values regression coefficients. scaling numeric (1,2 3) character \"sites\", \"species\" \"symmetric\". Default: \"symmetric\". Either site- (1) species- (2) related scores scaled eigenvalues, set scores unit weighted mean square 3 scaled symmetrically weighted mean squares equal square root eigenvalues. Negative values treated corresponding positive ones abs(scaling). which_cor character vector environmental variables names data frames inter-set correlations must calculated. Default: character (\"in_model\") predictors model, including collinear variables levels. tidy Return scores compatible ggplot2: variable score, names variable label. See weights (dc_CA variable weight. See scores.cca.","code":""},{"path":"/reference/scores.wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"data frame tidy = TRUE. Otherwise, matrix single item asked named list matrices one item asked . following names can included: c(\"sites\", \"constraints_sites\", \"centroids\", \"regression\", \"t_values\", \"correlation\", \"intra_set_correlation\", \"biplot\", \"species\"). matrix attribute \"meaning\" explaining meaning. tidy = TRUE, resulting data frame attributes \"scaling\" \"meaning\"; latter two columns: (1) name score type (2) meaning, usage interpretation. example meaning scores scaling \"symmetric\" display = \"\": sites CMWs trait axes (constraints species) scaling 'symmetric' optimal biplots , almost , inter-site distances. constraints_sites linear combination environmental predictors covariates (making ordination axes orthogonal covariates) scaling 'symmetric' optimal biplots , almost , inter-site distances. regression mean, sd, VIF, standardized regression coefficients optimistic t-ratio scaling 'symmetric'. t_values t-values coefficients regression CWMs trait composite environmental variables correlation inter set correlation, correlation environmental variables sites scores (CWMs) intra_set_correlation intra set correlation, correlation environmental variables dc-ca axis (constrained sites scores) biplot biplot scores environmental variables display biplot-traits fourth-corner correlations scaling 'symmetric'. centroids environmental category means site scores scaling 'symmetric' optimal biplots , almost , inter-environmental category distances. species SNC environmental axes (constraints sites) scaling 'symmetric' optimal biplots , almost , inter-species distances. statements optimality distance interpretations based scaling relative magnitude dc-CA eigenvalues chosen axes.","code":""},{"path":"/reference/scores.wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"function modeled scores.cca. example which_cor : which_cor = c(\"acidity\", \"humidity\")","code":""},{"path":"/reference/scores.wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract results of a weighted redundancy analysis (wrda) — scores.wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.01 ** #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/reference/wrda.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs a weighted redundancy analysis — wrda","title":"Performs a weighted redundancy analysis — wrda","text":"wrda formula-based implementation weighted redundancy analysis.","code":""},{"path":"/reference/wrda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs a weighted redundancy analysis — wrda","text":"","code":"wrda(formula, response, data, weights = rep(1, nrow(data)), verbose = TRUE)"},{"path":"/reference/wrda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs a weighted redundancy analysis — wrda","text":"formula one two-sided formula rows (samples) row predictors data. left hand side formula ignored specified next argument (response). Specify row covariates () adding + Condition(covariate-formula) formula rda. covariate-formula contain ~ (tilde). response matrix data frame abundance data (dimension n x m). Rownames response, , carried . data matrix data frame row predictors, rows corresponding response (dimension n x p). weights row weights (vector). specified unit weights used. verbose logical printing simple summary (default: TRUE)","code":""},{"path":"/reference/wrda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs a weighted redundancy analysis — wrda","text":"scores dcca object scaling \"sites\" (1): scaling Focus Case distances.","code":""},{"path":"/reference/wrda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Performs a weighted redundancy analysis — wrda","text":"algorithm modified version published R-code weighted redundancy analysis (ter Braak, 2022). current implementation, formula contain variable names , .e. transformations variables formulas gives error ('undefined columns selected') scores function applied. Compared rda, wrda residual axes, .e. SVD PCA residuals performed.","code":""},{"path":"/reference/wrda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Performs a weighted redundancy analysis — wrda","text":"ter Braak C.J.F. P. Šmilauer (2018). Canoco reference manual user's guide: software ordination (version 5.1x). Microcomputer Power, Ithaca, USA, 536 pp. Oksanen, J., et al. (2022) vegan: Community Ecology Package. R package version 2.6-4. https://CRAN.R-project.org/package=vegan.","code":""},{"path":[]},{"path":"/reference/wrda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Performs a weighted redundancy analysis — wrda","text":"","code":"data(\"dune_trait_env\") # rownames are carried forward in results rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites response <- dune_trait_env$comm[, -1] # must delete \"Sites\" w <- rep(1, 20) w[1:10] <- 8 w[17:20] <- 0.5 object <- wrda(formula = ~ A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) object # Proportions equal to those Canoco 5.15 #> Call: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response #> = response, data = dune_trait_env$envir, weights = w) #> #> -- Model Summary -- #> #> Inertia Proportion Rank #> Total 65.7007 1.0000 #> Conditional 7.3839 0.1124 2 #> Constrained 36.4952 0.5555 6 #> Unconstrained 21.8217 0.3321 0 #> #> Inertia is #> #> -- Note -- #> #> The model is overfitted with no unconstrained (residual) component. #> #> -- Eigenvalues -- #> #> Eigenvalues for constrained axes: #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.133 8.233 4.047 3.155 2.238 0.689 #> #> mean, sd, VIF and canonical coefficients with their optimistic [!] t-values: #> Avg SDS VIF Regr1 tval1 #> Manure 2.4659 1.2056 10.5656 -0.2010 -0.1344 #> A1 4.1466 1.3786 1.4841 0.1013 0.1807 #> Moist 2.1761 1.4762 1.4883 -4.1077 -7.3195 #> MagBF 0.1932 0.3948 6.8216 0.7873 0.6553 #> MagHF 0.4545 0.4979 5.8054 1.8392 1.6594 #> MagNM 0.0455 0.2083 4.8878 0.1327 0.1304 #> Use 1.9205 0.7107 2.6787 0.2101 0.2791 #> mod_scores <- scores(object, display = \"all\") scores(object, which_cor = c(\"A1\", \"X_lot\"), display = \"cor\") #> CWM-ax1 CWM-ax2 #> A1 -0.2365172 -0.3510007 #> X_lot -0.4987793 0.4250562 #> attr(,\"meaning\") #> [1] \"inter set correlation, correlation between environmental variables and the sites scores (CWMs)\" anova(object) #> $table #> Permutation test for weighted reduncancy analysis #> Model: wrda(formula = ~A1 + Moist + Mag + Use + Condition(Manure), response = response, data = dune_trait_env$envir, weights = w) #> Residualized predictor permutation #> Permutation: free #> Number of permutations: 999 #> #> df Variance R2 F Pr(>F) #> wRDA 6 36.495 0.62581 3.3449 0.014 * #> Residual 12 21.822 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> $eig #> wRDA1 wRDA2 wRDA3 wRDA4 wRDA5 wRDA6 #> 18.1328543 8.2332883 4.0467247 3.1546579 2.2383295 0.6893052 #>"},{"path":"/news/index.html","id":"douconca-121","dir":"Changelog","previous_headings":"","what":"douconca 1.2.1","title":"douconca 1.2.1","text":"CRAN release: 2024-09-25 Patch release addressing check errors several CRAN build machines.","code":""},{"path":"/news/index.html","id":"douconca-120","dir":"Changelog","previous_headings":"","what":"douconca 1.2.0","title":"douconca 1.2.0","text":"CRAN release: 2024-09-13 Intial CRAN release","code":""},{"path":"/news/index.html","id":"douconca-116","dir":"Changelog","previous_headings":"","what":"douconca 1.1.6","title":"douconca 1.1.6","text":"issue collinear predictors v1.1.5 resolved.","code":""},{"path":"/news/index.html","id":"douconca-115","dir":"Changelog","previous_headings":"","what":"douconca 1.1.5","title":"douconca 1.1.5","text":"package can now general dc-CA, instead vegan-based version equal site weights . users previous version, function dc_CA_vegan replaced general function dc_CA. default gives analysis. specifying argument divideBySiteTotals = FALSE, obtain original dc-CA analysis unequal site weights. plot_dcCA function now method: plot. General dc-CA required weighted redundancy analysis. , new function wrda added, methods print, scores anova. predict function added. dc-CA can computed community-weighted means (CWMs) trait environment data species site weights. See new function fCWM_SNC. interest, example, make dc-CA analysis reproducible abundance data made public, may also allow perform dcCA intra-species trait variation. user needs able compute meaningful CWMs case supply trait data reflect (species-weighted) inter-trait covariance. Several functions updated. particular, corrections anova function.","code":""},{"path":"/news/index.html","id":"douconca-112","dir":"Changelog","previous_headings":"","what":"douconca 1.1.2","title":"douconca 1.1.2","text":"scores.dccav function corrected concerning intra-set correlations traits environmental variables. plotting functions updated avoid ggplot2 warnings color size. fitted straight lines plots use implicit weights (already, help said ).","code":""}]