Package 'cutoff'

Title: Seek the Significant Cutoff Value
Description: Seek the significant cutoff value for a continuous variable, which will be transformed into a classification, for linear regression, logistic regression, logrank analysis and cox regression. First of all, all combinations will be gotten by combn() function. Then n.per argument, abbreviated of total number percentage, will be used to remove the combination of smaller data group. In logistic, Cox regression and logrank analysis, we will also use p.per argument, patient percentage, to filter the lower proportion of patients in each group. Finally, p value in regression results will be used to get the significant combinations and output relevant parameters. In this package, there is no limit to the number of cutoff points, which can be 1, 2, 3 or more. Missing values will be deleted by na.omit() function before analysis.
Authors: Jing Zhang [aut, cre], Zhi Jin [aut]
Maintainer: Jing Zhang <[email protected]>
License: GPL-3
Version: 1.1
Built: 2025-03-03 04:03:27 UTC
Source: https://github.com/yikeshu0611/cutoff

Help Index


Significant Cutoff Value for Cox Regression

Description

Significant Cutoff Value for Cox Regression

Usage

cox(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05,
  strict = TRUE, include = "low", round = 2)

Arguments

data

data

time

name for time variable

y

name for y, must be coded as 1 and 0. The outcome must be 1

x

name for x

cut.numb

number of cutoff points

n.per

the least percentage of the smaller group comprised in all patients

y.per

the least percentage of the smaller outcome patients comprised in each group

p.cut

cutoff of p value, default is 0.05

strict

logical. TRUE means significant differences for each group combination were considered. FALSE means considering for any combination

include

direction of cutoff point. Any left letter of lower or upper

round

digital. Default is 2

Value

a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.

Examples

cox(data=mtcars,
    time = 'disp', y='am', x='wt',
    cut.numb=2,
    n.per=0.25,
    y.per=0.10)

cox(data=mtcars,
    time = 'disp', y='am', x='wt',
    cut.numb=2,
    n.per=0.25,
    y.per=0.10,
    p.cut=0.05,
    strict=TRUE,
    include='low',
    round=2)

Cut Continuous Vector to Classification

Description

Cut Continuous Vector to Classification

Usage

cutit(x, cut_points, include = "low", labels = FALSE)

Arguments

x

numeric vector

cut_points

cuting points value

include

The direction of cutoff point. Any left letter of lower or upper

labels

logical. False is defaulted. TRUE means set range as factor.

Value

numeric vector or factor

Examples

cutit(mtcars$disp,c(150,190))
cutit(mtcars$disp,c(150,190),labels = TRUE)

Whether the Data Is Arranged from Small to Large

Description

Whether the Data Is Arranged from Small to Large

Usage

judge_123(x)

Arguments

x

numeric vector

Value

logical

Examples

judge_123(c(1,2,3,4,5))
judge_123(c(1,3,2))

Whether the Data Is Arranged from Large to Small

Description

Whether the Data Is Arranged from Large to Small

Usage

judge_321(x)

Arguments

x

numeric vector

Value

logical

Examples

judge_321(c(5,4,3,2,1))
judge_321(c(3,1,2))

Significant Cutoff Value for Linear Regression

Description

Significant Cutoff Value for Linear Regression

Usage

linear(data, y, x, cut.numb, n.per, p.cut = 0.05, strict = TRUE,
  include = "low", round = 2)

Arguments

data

data

y

name for y

x

name for x

cut.numb

number of cutoff points

n.per

the least percentage of the smaller group comprised in all patients

p.cut

cutoff of p value, default is 0.05

strict

logical. TRUE means significant differences for each group combination were considered. FALSE means considering for any combination

include

direction of cutoff point. Any left letter of lower or upper

round

digital. Default is 2

Value

a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.

Examples

linear(data=mtcars,y='qsec',x='disp',
       cut.numb=2,
       n.per=0.25)

linear(data=mtcars,y='qsec',x='disp',
       cut.numb=2,
       n.per=0.25,
       p.cut=0.05,
       strict=TRUE,
       include='low',
       round=2)
linear(data=mtcars,y='qsec',x='disp',
       cut.numb=2,
       n.per=0.25,
       p.cut=0.05,
       strict=FALSE,
       include='low',
       round=2)

Significant Cutoff Value for Logistic Regression

Description

Significant Cutoff Value for Logistic Regression

Usage

logit(data, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE,
  include = "low", round = 2)

Arguments

data

data

y

name for y, must be coded as 1 and 0. The outcome must be 1

x

name for x

cut.numb

number of cutoff points

n.per

the least percentage of the smaller group comprised in all patients

y.per

the least percentage of the smaller outcome patients comprised in each group

p.cut

cutoff of p value, default is 0.05

strict

logical. TRUE means significant differences for each group combination were considered. FALSE means considering for any combination

include

direction of cutoff point. Any left letter of lower or upper

round

digital. Default is 2

Value

a dataframe contains cutoff points value, subject numbers in each group, dumb variable, or of regression and p value.

Examples

logit(data=mtcars,
      y='am',
      x='disp',
      cut.numb=1,
      n.per=0.25,
      y.per=0.25)
 logit(data=mtcars,
       y='am',
       x='disp',
       cut.numb=1,
       n.per=0.25,
       y.per=0.20,
       p.cut=0.05,
       strict=TRUE,
       include='low',
       round=2)

Significant Cutoff Value for Logrank Analysis

Description

Significant Cutoff Value for Logrank Analysis

Usage

logrank(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05,
  strict = TRUE, include = "low", round = 2)

Arguments

data

data

time

name for time variable

y

name for y, must be coded as 1 and 0. The outcome must be 1

x

name for x

cut.numb

number of cutoff points

n.per

the least percentage of the smaller group comprised in all patients

y.per

the least percentage of the smaller outcome patients comprised in each group

p.cut

cutoff of p value, default is 0.05

strict

logical. TRUE means significant differences for each group combination were considered. FALSE means considering for any combination

include

direction of cutoff point. Any left letter of lower or upper

round

digital. Default is 2

Value

a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.

Examples

logrank(data=mtcars,
        time = 'disp',y='am', x='wt',
        cut.numb=2,
        n.per=0.25,
        y.per=0.10)

logrank(data=mtcars,
        time = 'disp',y='am', x='wt',
        cut.numb=2,
        n.per=0.25,
        y.per=0.10,
        p.cut=0.05,
        strict=TRUE,
        include='low',
        round=2)

Return x Between a and b

Description

Return x Between a and b

Usage

x_ab(x, a, b, include = "l")

Arguments

x

numeric vector

a

one number

b

one number

include

The direction of a and b. Any left letter of lower or upper

Value

values of x between a and b

Examples

x_ab(mtcars$disp,150,190)