View source: R/slopesBioTIME.R
| getLinearRegressions | R Documentation |
Fits linear regression models to getAlphaMetrics or
getBetaMetrics outputs
getLinearRegressions(x, pThreshold = 0.05)
x |
( |
pThreshold |
( |
The function getLinearRegression fits simple linear
regression models (see lm for details) for a given
output ('data') of either getAlphaMetrics or
getBetaMetrics function. The typical model has the form
metric ~ year. Note that assemblages with less than 3 time points
and/or single species time series are removed.
Returns a single long data.frame with results of linear
regressions (slope, p-value, significance, intercept) for each
assemblageID.
x <- gridding(BTsubset_meta, BTsubset_data) |>
resampling(measure = "BIOMASS", verbose = FALSE, resamps = 2)
alpham <- getAlphaMetrics(x, "BIOMASS")
getLinearRegressions(x = alpham, pThreshold = 0.01) |> head(10)
betam <- getBetaMetrics(x = x, "BIOMASS")
getLinearRegressions(x = betam) |> head(10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.