linear_nonlinear_fits: A function to fit a linear and non-linear GAM model to one's...

View source: R/linear_nonlinear_fits.R

linear_nonlinear_fitsR Documentation

A function to fit a linear and non-linear GAM model to one's data and return some useful summary statistics

Description

This function fits a GAM glm in a linear and non-linear framework and tests if the glm GAM with a smooth independent is a better fit to the data.

Usage

linear_nonlinear_fits(
  wdata,
  dependent,
  independent,
  covariables = NA,
  rnt_dependent = TRUE,
  bam = FALSE,
  nthread_count = 1
)

Arguments

wdata

a data frame of data with appropriate column names

dependent

a string that matches a column name in wdata that you would like to define as the dependent or response variable in your analysis

independent

a string that matches a column name in wdata that you would like to define as the independent or primary explanatory variable of interest in your analysis

covariables

a string or character vector that matches column names in wdata that you would like to define as additional covariate in your model. Set as NA, if you have no covariates and thus would like to run a univariate analysis.

rnt_dependent

TRUE or FALSE, would you like to rank normal transform your dependent variable prior to fitting the data? Default value is TRUE. Uses the rntransform() function in this package to rank normal transform.

bam

if you would like to run the GAM with bam(), for very large data sets, then set bam = TRUE. Default is bam = FALSE and gam() is used.

nthread_count

number of compute threads to use in your bam().

Examples

linear_nonlinear_fits()

hughesevoanth/moosefun documentation built on Aug. 22, 2022, 7:04 a.m.