Learn R Programming

GeneticsPed (version 1.34.0)

model.matrix.Pedigree: Model matrix for individuals with and without records

Description

model.matrix for pedigree creates design matrix ($Z$) for individuals with and without records. Used mainly for educational purposes.

Usage

"model.matrix"(object, y, id, left=TRUE, names=TRUE, ...)

Arguments

object
Pedigree
names
logical, should returned matrix have row/colnames; this can be used to get leaner matrix
y
numeric, vector of (phenotypic) records
id
vector of subjects for y
left
logical, bind columns of individuals without records to left (left=TRUE) or right (left=FALSE) side of $Z$
...
arguments passed to model.matrix

Value

$n * q$ dimension, where $n$ is number of records in y and $q$ is number of subjects in the pedigree

See Also

Pedigree, relationshipAdditive, inverseAdditive and model.matrix

Examples

Run this code
  data(Mrode3.1)
  (x <- Pedigree(x=Mrode3.1, subject="calf", ascendant=c("sire", "dam"),
                 ascendantSex=c("Male", "Female"), sex="sex"))
  model.matrix(object=x, y=x$pwg, id=x$calf)

Run the code above in your browser using DataLab