do_reg: do_reg

View source: R/do_reg.R

do_regR Documentation

do_reg

Description

Fits a linear model using the log-transformed contaminant values as the outcome and year as the indpendent variable.

Usage

do_reg(data, y, alpha, rob, b.pow, n.pow, power)

Arguments

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!

Details

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.

Value

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.

Author(s)

Erik Lampa


NRM-MOC/MoCiS documentation built on March 27, 2023, 7:35 p.m.