discretizeAge {TCPMOR} | R Documentation |
Discretize the age variable according to the two cut-off points
Description
Discretize the age variable according to the two cut-off points
Usage
discretizeAge(data, cutoffs)
Arguments
data |
Data frame with column: age |
cutoffs |
The cut-off points of the age range |
Value
A modified data frame with a new column: age_p
Examples
# Generate simulated data dataC
dataC <- createData(200)
# Fit the semi-parametric model
spm.fit <- fitSemiParamModel(dataC)
# Find two cut-off points
dataC <- findCutoffs(spm.fit, dataC)
# Calculate the two cut-off points after limiting sensitivity se and specificity sp
result <- calculateCutoffs(dataC)
cutoffs <- result$cutoffs
dataC2 <- result$filteredData
# Discretize age variable based on the two cutoffs
dataC2 <- discretizeAge(dataC2, cutoffs)
[Package TCPMOR version 1.0 Index]