Test the residual variance of the rotated model against one
Source:R/specification.R
specification_test.RdAfter the rotation the estimation errors of the adjusted means have unit
variance, so the residual variance of the rotated model without a marker
has the target value one when the relationship matrix accounts for all
genetic covariance among the accessions. The test uses the increase in the
REML deviance when the residual variance is fixed at one, with the genetic
variance re-optimised. The one-sided test, the one the paper recommends,
takes the increase as zero when the estimate is at or below one and refers
it to 2.71, the 0.90 quantile of the chi-squared distribution on one degree
of freedom, which gives a one-sided test at the 5\
variance above one then indicates genetic covariance not represented by the
relationship matrix (see independent_effect()). The two-sided test, which
also detects a residual variance below one, refers the increase to 3.84.
Both can be read from the profile-likelihood intervals returned: the
one-sided test rejects when the 90\
test when the 95\
cut-offs as the tests, 2.71 and 3.84. The test presumes that the first
stage is correctly specified: a first stage that understates the estimation
error of the means also raises the residual variance.
Value
an object of class specification_test: the residual variance
estimate (residual), the genetic variance with the residual estimated
(genetic) and fixed at one (genetic_at_one), the increase in deviance
(increase), the one-sided statistic (statistic, the increase or zero),
the critical values (crit_one_sided 2.71, crit_two_sided 3.84), the
decisions (reject_one_sided, reject_two_sided), p-values (p_one_sided,
from the equal mixture of a point mass at zero and chi-squared on one
degree of freedom; p_two_sided, chi-squared on one degree of freedom),
the 90\
interval_95, each with lower, upper, bounded), profile (a data
frame of the increase in the REML deviance over a grid of values of the
residual variance, drawn by plot()), n, p and the boundary status
of the free fit.
Examples
ex <- rotationGWAS:::toy_trial(n = 120, n_markers = 80, seed = 2)
r <- rotation(ex$means, ex$Omega, ex$relationship, ex$covariates)
specification_test(r)
#> Residual variance of the rotated model without a marker: 1.051 (target one; genetic variance 3.789, or 3.827 with the residual fixed at one)
#> Increase in the REML deviance when the residual variance is fixed at one: 0.06039
#> One-sided test (residual above one): statistic 0.06039 against 2.71, not rejected (p = 0.403)
#> Two-sided test: increase 0.06039 against 3.84, not rejected (p = 0.806)
#> Profile-likelihood intervals for the residual variance: 90% [0.7638, 1.488], 95% [0.7211, 1.595]