linear_model: Linear model for trend analysis

View source: R/trends.R

linear_modelR Documentation

Linear model for trend analysis

Description

Performs a linear model for

Usage

linear_model(x, y = NULL, conf_level = 0.95)

Arguments

x

numeric vector

y

optional time variable, converted to numeric. If its not provided it will be assumed that all values in X are sequential, regularly measured, and there are no gaps in the measurements.

conf_level

numeric. Level of confidence to be used to calculate the confidence intervals

Value

a tidy data frame with the model results

Examples

x <- runif(100) * 1:100
linear_model(x)
# If measurements were for example taken daily
linear_model(x, y = Sys.Date() + (1:100))

StatisticsNZ/er.helpers documentation built on Oct. 2, 2023, 7:24 a.m.