linear_model: Linear model for trend analysis

Description Usage Arguments Value Examples

View source: R/trends.R

Description

Performs a linear model for

Usage

1
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

1
2
3
4
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 Feb. 27, 2021, 4:14 p.m.