non_linear_test: Test if a non-linear model is a better fit to the data than a...

View source: R/non_linear_test.R

non_linear_testR Documentation

Test if a non-linear model is a better fit to the data than a linear model

Description

This function performs a linear and non-linear GAM and tests the two to determine if the non-linear model is a better fit to the data.

Usage

non_linear_test(
  wdata,
  outcome = NA,
  exposure = NA,
  linear_covariates = NA,
  smooth_covariates = NA,
  rnt_outcome = FALSE,
  weights_variable = NA,
  outlier_method = "iqr",
  outlier_cutoff = 5,
  messages = FALSE
)

Arguments

wdata

a data frame passed to function containing necessary data for analysis

outcome

a single string character of the column name for the outcome or dependent or response variable

exposure

a single string character of the column name for the exposure or independent or explanatory variable

linear_covariates

a vector of string(s) that are also column names used to define variables that will be set as parametric (linear) covariates.

smooth_covariates

a vector of string(s) that are also column names used to define variables that will be set as non-linear (smooth, s()) covariates.

rnt_outcome

binary TRUE or FALSE if the dependent or response variable should be rank normal transformed.

weights_variable

a single string character of the column name for a weights variable

outlier_method

a single string character of "iqr" or "sd" to determine if outlier should be determined by means and sd or medians and iqr.

outlier_cutoff

a single numeric value to define a cutoff value for how many iqr or sd units outlier values

messages

should a progress message be printed to screen - binary TRUE or FALSE

Value

returns a vector of summary statistics

Examples

non_linear_test()

hughesevoanth/glsmr documentation built on May 14, 2023, 3:41 p.m.