This function will test the hypothesis that, given a set of two residuals (new vs. old), the new ones are better than the old ones as measured with non-parametric tests.
Four p-values are provided: one for the binomial sign test, one for the paired Wilcoxon rank-sum test, one for the paired t-test, and one for the F
-test.
The proportion of subjects that improved their residuals, the proportion that worsen their residuals, and the net residual improvement (NeRI) will be returned.
improvedResiduals(oldResiduals,
newResiduals,
testType = c("Binomial", "Wilcox", "tStudent", "Ftest"))
A vector with the residuals of the original model
A vector with the residuals of the new model
Type of non-parametric test to be evaluated: Binomial test ("Binomial"), Wilcoxon rank-sum test ("Wilcox"), Student's t-test ("tStudent"), or F-test ("Ftest")
Proportion of subjects that improved their residuals to the total number of subjects
Proportion of subjects that worsen their residuals to the total number of subjects
The net residual improvement (p1
-p2
)
The one tail p-value of the test specified in testType
The p-value associated with a significant improvement in residuals
The single sided p-value of the Wilcoxon rank-sum test comparing the absolute values of the new and old residuals
The single sided p-value of the paired t-test comparing the absolute values of the new and old residuals
The single sided p-value of the F-test comparing the residual variances of the new and old residuals
This function will test the hypothesis that the new residuals are "better" than the old residuals. To test this hypothesis, four types of tests are performed:
The paired t-test, which compares the absolute value of the residuals
The paired Wilcoxon rank-sum test, which compares the absolute value of residuals
The binomial sign test, which evaluates whether the number of subjects with improved residuals is greater than the number of subjects with worsened residuals
The F-test, which is the standard test for evaluating whether the residual variance is "better" in the new residuals.
The proportions of subjects that improved and worsen their residuals are returned, and so is the NeRI.