desc.stat {BivRegBLS} | R Documentation |
Descriptive statistics in method comparison studies
Description
Calculate several descriptive statistics in method comparison studies per device (X and Y) and per type of samples.
Usage
desc.stat(data = NULL, xcol = 1, ycol = 2, IDcol = NULL)
Arguments
data |
a data set (data frame or matrix). |
xcol |
a numeric vector to specify the X column(s) or a character vector with the column names. |
ycol |
a numeric vector to specify the Y column(s) or a character vector with the column names. |
IDcol |
a numeric or character variable to specify the column with the different IDs or type of samples. |
Details
If IDcol
is null (as by default), the descriptive statistics are calculated for X and Y. Otherwise, the descriptive statistics are calculated for X and Y for each type of sample (each ID) (with a maximum of 30 different IDs). This information is also used to differentiate the observations on a raw plot when the function raw.plot
is used. In presence of missing values on X or Y and non-replicates, the rows with missing values are removed. In presence of replicates, the rows with missing values are removed if all Xi or all Yi are missing.
The results (Xij
, Yik
, Xi
, Yi
, nxi
, nyi
, variances_x
, variances_y
) are reordered according to the increasing values of Xi (the X mean values).
Value
A list including the following elements:
Xij |
a table with the (replicated) X measurements (replicates are in columns). |
Yik |
a table with the (replicated) Y measurements (replicates are in columns). |
Xi |
a vector with the means of the X measurements. |
Yi |
a vector with the means of the Y measurements. |
IDs |
a vector with the different IDs. |
nxi |
a vector with the number of X replicates per sample (patient). |
nyi |
a vector with the number of Y replicates per sample (patient). |
variances_x |
a vector with the variances calculated on the X replicates per sample (patient). |
variances_y |
a vector with the variances calculated on the Y replicates per sample (patient). |
Order.Xi |
a vector with the order of the means of the X replicates. |
statistics |
a table with different descriptive statistics per type of sample (rows): the number of sample (patient), the number of replicates in X and Y, the degrees of freedom of the measurement error variances in X and Y, the mean, the sum of squares (Sxx and Syy), the cross-product (Sxy), the variance, minimum, 1st quartile, median, 3rd quartile, maximum for X and Y, and the Pearson correlation coefficient and its square. |
Author(s)
Bernard G FRANCQ
References
Francq BG, Govaerts BB. How to regress and predict in a Bland-Altman plot? Review and contribution based on tolerance intervals and correlated-errors-in-variables models. Statistics in Medicine, 2016; 35:2328-2358.
Francq BG. Errors-in-variables regressions to assess equivalence in method comparison studies. Ph.D. Thesis, Universite Catholique de Louvain, Institute of Statistics, Biostatistics and Actuarial science, Louvain-la-Neuve, Belgium, 2013.
See Also
Examples
library(BivRegBLS)
data(Aromatics)
res=desc.stat(data=Aromatics,xcol=3,ycol=4,IDcol=2)