ss_mats: Compute sum-of-squares matrices from half-sib design data

View source: R/ss_mats.r View source: R/ss_halfsib.R

ss_matsR Documentation

Compute sum-of-squares matrices from half-sib design data

Description

Given a dataframe of half-sib responses y[ijk], computes the following matrices: These matrices are given by

M[A] = (JK)/(I-1) * Σ (mu[i] - mu)(mu[i] - mu)'

M[B] = K/(I(J-1)) * Σ (mu[ij] - mu[i]) (mu[ij] - mu[i])'

M[E] = 1/(IJ(K-1) * Σ (mu[ijk] - mu[ij]) (mu[ijk] - mu[ij])',

and satisfy

E(M[E]) = E, E(M[B]) = E + K B, E(M[A]) = E + K B + JK A,

Usage

ss_mats(df)

Arguments

df

Half-sib data frame with column names trait, value, sire, dam, individual

Details

where A, B, E are the population covariance matrices of the sires, dams and individuals respectively.

Value

A list with the following entries:

  • m_ind, m_dam, m_sire: The matrices S_E, S_B and S_A respectively

  • q: The dimensionality of the responses

  • I, J, K: The number of sires, dams per sire and individuals per dam


damian-t-p/halfsibdesign documentation built on March 14, 2023, 4:55 a.m.