View source: R/bothsidesmodel.lrt.R
bothsidesmodel.lrt | R Documentation |
\beta
are zero.Tests the null hypothesis that an arbitrary subset of the \beta _{ij}
's
is zero, using the likelihood ratio test as in Section 9.4. The null and
alternative are specified by pattern matrices P_0
and P_A
,
respectively. If the P_A
is omitted, then the alternative will be
taken to be the unrestricted model.
bothsidesmodel.lrt(
x,
y,
z,
pattern0,
patternA = matrix(1, nrow = ncol(x), ncol = ncol(z))
)
x |
An |
y |
The |
z |
A |
pattern0 |
An |
patternA |
An optional |
A list with the following components:
The likelihood ratio statistic in (9.44).
The degrees of freedom in the test.
The p
-value for the test.
bothsidesmodel.chisquare
, bothsidesmodel.df
,
bothsidesmodel.hotelling
, bothsidesmodel
,
and bothsidesmodel.mle
.
# Load data
data(caffeine)
# Matrices
x <- cbind(
rep(1, 28),
c(rep(-1, 9), rep(0, 10), rep(1, 9)),
c(rep(1, 9), rep(-1.8, 10), rep(1, 9))
)
y <- caffeine[, -1]
z <- cbind(c(1, 1), c(1, -1))
pattern <- cbind(c(rep(1, 3)), 1)
# Fit model
bsm <- bothsidesmodel.lrt(x, y, z, pattern)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.