https://github.com/cran/cutpointr
Raw File
Tip revision: d461e559d4a76b7fcbd728470ca12cce56d3ffab authored by Christian Thiele on 19 June 2020, 11:00:06 UTC
version 1.0.32
Tip revision: d461e55
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