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 |
Significant Cutoff Value for Cox Regression
cox(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
cox(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
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 |
a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.
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)
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
cutit(x, cut_points, include = "low", labels = FALSE)
cutit(x, cut_points, include = "low", labels = FALSE)
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. |
numeric vector or factor
cutit(mtcars$disp,c(150,190)) cutit(mtcars$disp,c(150,190),labels = TRUE)
cutit(mtcars$disp,c(150,190)) cutit(mtcars$disp,c(150,190),labels = TRUE)
Whether the Data Is Arranged from Small to Large
judge_123(x)
judge_123(x)
x |
numeric vector |
logical
judge_123(c(1,2,3,4,5)) judge_123(c(1,3,2))
judge_123(c(1,2,3,4,5)) judge_123(c(1,3,2))
Whether the Data Is Arranged from Large to Small
judge_321(x)
judge_321(x)
x |
numeric vector |
logical
judge_321(c(5,4,3,2,1)) judge_321(c(3,1,2))
judge_321(c(5,4,3,2,1)) judge_321(c(3,1,2))
Significant Cutoff Value for Linear Regression
linear(data, y, x, cut.numb, n.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
linear(data, y, x, cut.numb, n.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
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 |
a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.
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)
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
logit(data, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
logit(data, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
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 |
a dataframe contains cutoff points value, subject numbers in each group, dumb variable, or of regression and p value.
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)
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
logrank(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
logrank(data, time, y, x, cut.numb, n.per, y.per, p.cut = 0.05, strict = TRUE, include = "low", round = 2)
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 |
a dataframe contains cutoff points value, subject numbers in each group, dumb variable, beta of regression and p value.
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)
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
x_ab(x, a, b, include = "l")
x_ab(x, a, b, include = "l")
x |
numeric vector |
a |
one number |
b |
one number |
include |
The direction of a and b. Any left letter of lower or upper |
values of x between a and b
x_ab(mtcars$disp,150,190)
x_ab(mtcars$disp,150,190)