bothsidesmodel function

Calculate the least squares estimates

Calculate the least squares estimates

This function fits the model using least squares. It takes an optional pattern matrix P as in (6.51), which specifies which βij\beta _{ij}'s are zero.

bothsidesmodel(x, y, z = diag(qq), pattern = matrix(1, nrow = p, ncol = l))

Arguments

  • x: An NxPN x P design matrix.
  • y: The NxQN x Q matrix of observations.
  • z: A QxLQ x L design matrix
  • pattern: An optional NxPN x P matrix of 0's and 1's indicating which elements of β\beta are allowed to be nonzero.

Returns

A list with the following components:

  • Beta: The least-squares estimate of β\beta.
  • SE: The PxLP x L matrix with the ijijth element being the standard error of β^ij\hat{\beta}_ij.
  • T: The PxLP x L matrix with the ijijth element being the tt-statistic based on β^ij\hat{\beta}_{ij}.
  • Covbeta: The estimated covariance matrix of the β^ij\hat{\beta}_{ij}'s.
  • df: A pp-dimensional vector of the degrees of freedom for the tt-statistics, where the jjth component contains the degrees of freedom for the jjth column of β^\hat{\beta}.
  • Sigmaz: The QxQQ x Q matrix Σ^z\hat{\Sigma}_z.
  • Cx: The QxQQ x Q residual sum of squares and crossproducts matrix.

Examples

# Mouth Size Example from 6.4.1 data(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.

  • Maintainer: James Balamuta
  • License: MIT + file LICENSE
  • Last published: 2020-10-31