https://github.com/cran/cutpointr
Raw File
Tip revision: bbfd8290a255cf1d55a1eed28f5501736e754842 authored by Christian Thiele on 14 April 2020, 07:50:10 UTC
version 1.0.2
Tip revision: bbfd829
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