Description Usage Arguments Details Value
Function to calculate linear regressions between time series in Y as function of time series in X.
1 2 |
mdfrX |
- melted dataframe with independent (X) time series |
mdfrY |
- melted dataframe with dependent (Y) time series |
yvars |
- vector of dependent variables to process (or NULL for all) |
xlab |
- label associated with independent variables |
ylab |
- label associated with dependent variables |
nrows |
- number of rows for LR plots |
coord_fixed |
- flag to use equal x/y unit dimensions in LR plots |
labelByGroup |
- flag to use "group" column to organize linear regression analysis |
verbose |
- flag to print messages |
none.
list with named elements 'res', 'summary' and 'plot':
res - a list with sublists by unique X with elements
lms - list with linear model (lm) results by Y for X
summary - dataframe with summaries of linear model results
plots - list of ggplot2 objects (p1=standardized time series, p2=fits to lm's)
summary - a dataframe summarizing all LR results. Columns are
ygroup - dependent variable group label
y - dependent variable label
xgroup - independent variable group label
x - independent variable label
n - number of valid data points
rho - Pearson's correlation coefficient
rsq - R-squared for linear fit
p - P-value (uncorrected for multiple comparisons)
plot - a ggplot object.
data - dataframe with data involved in linear models
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.