calc.kw | R Documentation |
This function calculate the nearest neighbor kernel weights using uniform kernel weights.
calc.kw(X, x0, span = 0.1, h = NULL, type = "uniform")
X |
the vector of biomarker values from other subjects used to calculate the weights around the center x0. |
x0 |
a scalar as the center around which the kernel weights are calculated. |
span |
a numeric value of the proportion of neighbour observations used, default is 0.1. |
h |
a numeric value of the bandwidth of kernel weights, defualt is NULL. If not specified, the function used the value of |
type |
a character value of the type of kernel function used to calculate kernel weights. Default is "uniform" kernel. Other options are "Epanichnekov" and "normal".
It will only be used when the bandwidth |
Return a vector of kernel weights for each element in X. It has the same length as X.
X must be the vector of ALL risk score values in the data; it cannot be any other vector of arbitrary length.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.