fit_linear_model: Fit Linear model to 'klassets_xy' object

View source: R/xy.R

fit_linear_modelR Documentation

Fit Linear model to klassets_xy object

Description

Fit Linear model to klassets_xy object

Usage

fit_linear_model(df, order = 1, stepwise = FALSE, verbose = FALSE)

Arguments

df

A object from sim_response_xy.

order

Order of predictive variable x.

stepwise

A logical value to indicate to perform stepwise.

verbose

A logical value to indicate to show the trace of the stepwise procedure.

Examples


df <- sim_xy()

df

dflm <- fit_linear_model(df)

dflm

plot(dflm)

df <- sim_xy(n = 1000, x_dist = runif)
df <- dplyr::mutate(df, y = y + 2*sin(5 * x))
plot(df)

plot(fit_linear_model(df))

plot(fit_linear_model(df, order = 5, stepwise = TRUE, verbose = TRUE))


jbkunst/klassets documentation built on Dec. 7, 2022, 9:18 p.m.