R/piecefunc.R

Defines functions piecefunc

Documented in piecefunc

#' Piecewise Function
#'
#' @param x a value for x
#' @param coef the coefficients of the regression items
#'
#' @return piecewise regression
#' @export
#'
#' @examples
piecefunc <- function(x,coef){
	coef[1]+coef[2]*(x)+coef[3]*(x-18)*(x-18>0)
}
cbain1/MATH4753BAIN documentation built on April 23, 2021, 8:31 a.m.