cutpoint_knots: Calculate number of knots to use in spline smoothing

View source: R/optimize_metric.R

cutpoint_knotsR Documentation

Calculate number of knots to use in spline smoothing

Description

This function calculates the number of knots when using smoothing splines for smoothing a function of metric values per cutpoint value. The function for calculating the number of knots is equal to stats::.nknots_smspl but uses the number of unique cutpoints in the data as n.

Usage

cutpoint_knots(data, x)

Arguments

data

A data frame

x

(character) The name of the predictor variable

Examples

cutpoint_knots(suicide, "dsi")

cutpointr documentation built on April 14, 2022, 1:06 a.m.