The function checks whether interval-censored data with two repeated measurements meet the normality assumption for subjects' residuals. This is a prerequisite for the random effects model used in ICC calculation.
ntest.res(r1, r2, predefined.classes=FALSE, classes, c.limits, optim.method=1, bins=10)An object of class "ntestRes". The object is a list with the components:
value of chi-squared statistic corresponding to the first residual; statistic in the output of chisq.test
p-value of test corresponding to the first residual; p.value in the output of chisq.test
value of chi-squared statistic corresponding to the second residual; statistic in the output of chisq.test
p-value of test corresponding to the second residual; p.value in the output of chisq.test
number of degrees of freedom for chi-squared distribution (the same for both residuals); parameter in the output of chisq.test
character string with value ,,residuals''
mean of the expected normal distribution for subjects' residuals; equal to 0
variance of the expected normal distribution for subjects' residuals; equal to maximum likelihood estimate for \(0.5 \sigma^2\) from intervalICC
number of categories in chi-square test
argument passed to intervalICC; see documentation for that function.
argument passed to intervalICC; see documentation for that function.
argument passed to intervalICC; see documentation for that function.
argument passed to intervalICC; see documentation for that function.
argument passed to intervalICC; see documentation for that function.
argument passed to intervalICC; see documentation for that function.
number of categories in chi-square test; see details below (default is 10).
Jelena Kovacic jkovacic@imi.hr
For ICC estimation the random effects data model $$Y_{ij} = \mu + b_i + e_{ij},$$ is used, where \(b_i\) and \(e_{ij}\) are normally distributed with means 0 and variances \(\sigma^2_b\) and \(\sigma^2\), respectively. This function assesses the assumption that the subjects' "residuals" \(Y_{i1} - 0.5 (Y_{i1}+Y_{i2})\) and \(Y_{i2} - 0.5 (Y_{i1}+Y_{i2})\) are normally distributed with mean 0 and variance \(0.5 \sigma^2\), as is expected under the specified model.
To test normality, chi-square goodness-of-fit test with bins subsequent data categories is used (call to chisq.test from package stats).
The categories (bins) are determined using the equidistant quantiles of expected normal distribution, with corresponding maximum likelihood
parameters. Maximum likelihood estimates for parameters \(\mu\), \(\sigma^2_b\) and \(\sigma^2\) are obtained by calling the function intervalICC.
The probability corresponding to each bin is 1/bins (expected relative frequencies; this corresponds to p = rep(1/bins,bins) in chisq.test function).
Since residuals are interval-censored and censoring intervals overlap, the observed relative frequencies are calculated in the following way. If one of the original intervals representing subjects residual spans multiple bins, each bin receives a share of votes from the original interval. This share is calculated using the
expected normal density function and it is proportional to the probability of data falling within the intersection of the original interval and bin.
Residuals for the first time point (\(Y_{i1} - 0.5 (Y_{i1}+Y_{i2})\)) and residuals for the second (\(Y_{i2} - 0.5 (Y_{i1}+Y_{i2})\)) are tested separately; therefore two test results in the output are given.
Kovacic J, Varnai VM. Intraclass correlation coefficient for grouped data. Epidemiology 2014;25(5):769--770.
summary.ntestRes, intervalICC, chisq.test
# Example with 6 predefined classes (grouped data)
classes <- 1:6
class.limits <- cbind(classes-0.5,classes+0.5)
r1 <- sample(classes,30,replace=TRUE)
r2 <- sample(classes,30,replace=TRUE)
ntest.res(r1,r2,predefined.classes=TRUE,classes,class.limits,bins=10)
Run the code above in your browser using DataLab