bothsidesmodel: Calculate the least squares estimates

Description Usage Arguments Value See Also Examples

View source: R/bothsidesmodel.R

Description

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.

Usage

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

Arguments

x

An N x P design matrix.

y

The N x Q matrix of observations.

z

A Q x L design matrix

pattern

An optional N x P matrix of 0's and 1's indicating which elements of β are allowed to be nonzero.

Value

A list with the following components:

Beta

The least-squares estimate of β.

SE

The P x L matrix with the ijth element being the standard error of \hat{β}_ij.

T

The P x L matrix with the ijth element being the t-statistic based on \hat{β}_{ij}.

Covbeta

The estimated covariance matrix of the \hat{β}_{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 \hat{β}.

Sigmaz

The Q x Q matrix \hat{Σ}_z.

Cx

The Q x Q residual sum of squares and crossproducts matrix.

See Also

bothsidesmodel.chisquare, bothsidesmodel.df, bothsidesmodel.hotelling, bothsidesmodel.lrt, and bothsidesmodel.mle.

Examples

1
2
3
4
5
6
# 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)

msos documentation built on Oct. 31, 2020, 9:07 a.m.