View source: R/ordinal_cohens_kappa.R
ordinal_cohens_kappa | R Documentation |
ordinal_cohens_kappa
computes the estimated ordinal Cohen's kappa
of an ordinal time series
ordinal_cohens_kappa(series, states, distance = "Block", lag = 1)
series |
An OTS. |
states |
A numerical vector containing the corresponding states. |
distance |
A function defining the underlying distance between states. The Hamming, block and Euclidean distances are already implemented by means of the arguments "Hamming", "Block" (default) and "Euclidean". Otherwise, a function taking as input two states must be provided. |
lag |
The considered lag. |
Given an OTS of length T with range \mathcal{S}=\{s_0, s_1, s_2, …, s_n\} (s_0 < s_1 < s_2 < … < s_n), \overline{X}_t=\{\overline{X}_1,…, \overline{X}_T\}, the function computes the estimated ordinal Cohen's kappa given by \widehat{κ}_d(l)=\frac{\widehat{disp}_d(X_t)-\widehat{E}[d(X_t, X_{t-l})]}{{\widehat{disp}}_d(X_t)}, where \widehat{disp}_{d}(X_t)=\frac{T}{T-1}∑_{i,j=0}^nd\big(s_i, s_j\big)\widehat{p}_i\widehat{p}_j is the DIVC estimate of the dispersion, with d(\cdot, \cdot) being a distance between ordinal states and \widehat{p}_k being the standard estimate of the marginal probability for state s_k, and \widehat{E}[d(X_t, X_{t-l})]=\frac{1}{T-l} ∑_{t=l+1}^T d(\overline{X}_t, \overline{X}_{t-l}).
The estimated ordinal Cohen's kappa.
Ángel López-Oriona, José A. Vilar
weiss2019distanceotsfeatures
estimated_ock <- ordinal_cohens_kappa(series = AustrianWages$data[[100]], states = 0 : 5) # Computing the estimated ordinal Cohen's kappa # for one series in dataset AustrianWages using the block distance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.