https://github.com/cran/cutpointr
Raw File
Tip revision: 4408233eb8624dea85ecf18e86d50c296165c3f2 authored by Christian Thiele on 13 April 2022, 17:12:29 UTC
version 1.1.2
Tip revision: 4408233
cutpoint_knots.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/optimize_metric.R
\name{cutpoint_knots}
\alias{cutpoint_knots}
\title{Calculate number of knots to use in spline smoothing}
\usage{
cutpoint_knots(data, x)
}
\arguments{
\item{data}{A data frame}

\item{x}{(character) The name of the predictor variable}
}
\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 \code{stats::.nknots_smspl} but uses the number of unique cutpoints
in the data as n.
}
\examples{
cutpoint_knots(suicide, "dsi")
}
back to top