Description Usage Arguments Details Value Note Examples
Calculates a Williams' type test statistic for a constrained linear mixed effects model.
1 2 3 | w.stat(theta, cov.theta, B, A, ...)
w.stat.ind(theta, cov.theta, B, A, ...)
|
theta |
estimated coefficients. |
cov.theta |
covariance matrix of the (unconstrained) coefficients. |
B |
matrix to obtain the global contrast. |
A |
matrix of linear constraints. |
... |
additional arguments, to enable custom test statistic functions. |
See create.constraints
for an example of A
. Argument B
is similar, but defines the global contrast for a Williams' type test statistic. This is the largest hypothesized difference in the constrained coefficients. So for an increasing simple order, the test statistic is the difference between the two extreme coefficients, theta_1 and theta_p1, divided by the standard error (unconstrained). For an umbrella order order, two contrasts are considered, theta_1 to theta_s, and theta_p1 to theta_s, each divided by the appropriate unconstrained standard error. A general way to express this statistic is:
W = max theta_{B[i,2]} - theta_{B[i,1]} / sqrt( VAR( theta_{B[i,2]} - theta_{B[i,1]} ) )
where the numerator is the difference in the constrained estimates, and the standard error in the denominator is based on the covariance matrix of the unconstrained estimates.
The function w.stat.ind
does the same, but uses the A
matrix which defines all of the individual constraints, and returns a test statistic for each constraints instead of taking the maximum.
Output is a numeric value.
See lrt.stat
for information on creating custom test statistics.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.