This function fits the model using least squares. It takes an optional pattern matrix P as in (6.51), which specifies which βij's are zero.
bothsidesmodel(x, y, z = diag(qq), pattern = matrix(1, nrow = p, ncol = l))
Arguments
x: An NxP design matrix.
y: The NxQ matrix of observations.
z: A QxL design matrix
pattern: An optional NxP matrix of 0's and 1's indicating which elements of β are allowed to be nonzero.
Returns
A list with the following components:
Beta: The least-squares estimate of β.
SE: The PxL matrix with the ijth element being the standard error of β^ij.
T: The PxL matrix with the ijth element being the t-statistic based on β^ij.
Covbeta: The estimated covariance matrix of the β^ij's.
df: A p-dimensional vector of the degrees of freedom for the t-statistics, where the jth component contains the degrees of freedom for the jth column of β^.
Sigmaz: The QxQ matrix Σ^z.
Cx: The QxQ residual sum of squares and crossproducts matrix.
Examples
# Mouth Size Example from 6.4.1data(mouths)x <- cbind(1, mouths[,5])y <- mouths[,1:4]z <- cbind(c(1,1,1,1), c(-3,-1,1,3), c(1,-1,-1,1), c(-1,3,-3,1))bothsidesmodel(x, y, z)
See Also
bothsidesmodel.chisquare, bothsidesmodel.df, bothsidesmodel.hotelling, bothsidesmodel.lrt, and bothsidesmodel.mle.