do_reg | R Documentation |
Fits a linear model using the log-transformed contaminant values as the outcome and year as the indpendent variable.
do_reg(data, y, alpha, rob, b.pow, n.pow, power)
data |
A data frame. |
y |
The outcome variable. |
alpha |
Significance lavel for the power calculations. |
rob |
Set to true to perform a robust linear model fit. Very experimental! |
Options include a robust linear model fit using lmrob
from the
robustbase
package although all power calculations are based on
the ordinary least squares fit. The fit is returned and all methods
available for an lm
or roblm
fit can be used.
A list containing the slope esimate and confidence interval expressed as percentage per year, the coefficient of variation around the regression line, three estimates of power, the coefficient of determination, a p-value for the null hypothesis that the slope is 0, the estimated concentration of the contaminant and its confidence interval for the last year in the series, the fitted line, the years present in the data and the linear model object.
Erik Lampa
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.