The std.train
Standardization (min_max_scale, zScore etc.) can be
estimated from the training data and applied to any dataset with the same
variables.
std.train(data, standardize = NULL)
A numeric
data.frame of standardized biomarkers
a numeric
data frame of biomarkers
a character
string indicating the name of the
standardization method. The default option is no standardization applied.
Available options are:
Z-score (zScore)
: This method scales the data to have a mean
of 0 and a standard deviation of 1. It subtracts the mean and divides by the standard
deviation for each feature. Mathematically,
$$ Z-score = \frac{x - (\overline x)}{sd(x)}$$
where \(x\) is the value of a marker, \(\overline{x}\) is the mean of the marker and \(sd(x)\) is the standard deviation of the marker.
T-score (tScore)
: T-score is commonly used
in data analysis to transform raw scores into a standardized form.
The standard formula for converting a raw score \(x\) into a T-score is:
$$T-score = \Biggl(\frac{x - (\overline x)}{sd(x)}\times 10 \Biggl) +50$$
where \(x\) is the value of a marker, \(\overline{x}\) is the mean of the marker
and \(sd(x)\) is the standard deviation of the marker.
min_max_scale (min_max_scale)
: This method transforms data to
a specific scale, between 0 and 1. The formula for this method is:
$$min_max_scale = \frac{x - min(x)}{max(x) - min(x)}$$
scale_mean_to_one (scale_mean_to_one)
: This method scales
the arithmetic mean to 1. The formula for this method is:
$$scale_mean_to_one = \frac{x}{\overline{x}}$$
where \(x\) is the value of a marker and \(\overline{x}\) is the mean of the marker.
scale_sd_to_one (scale_sd_to_one)
: This method, which allows for
comparison of individual data points in relation to the overall spread of
the data, scales the standard deviation to 1. The formula for this method is:
$$scale_sd_to_one = \frac{x}{sd(x)}$$
where \(x\) is the value of a marker and \(sd(x)\) is the standard deviation of the marker.
Serra Ilayda Yerlitas, Serra Bersan Gengec, Necla Kochan, Gozde Erturk Zararsiz, Selcuk Korkmaz, Gokmen Zararsiz
# call data
data(laparotomy)
# define the function parameters
markers <- laparotomy[, -1]
markers2 <- std.train(markers, "deviance")
Run the code above in your browser using DataLab