statgenSTA (version 1.0.2)

extract: Extract statistics from Fitted Models

Description

This function extracts and calculates various results for fitted models such as BLUEs, BLUPs, unit errors and heritabilities. Note that most results can only be calculated if a model is fitted with genotype as fixed or random. This is indicated in the list below with "F" and "R"

Usage

extract(
  STA,
  trials = names(STA),
  traits = NULL,
  what = "all",
  keep = NULL,
  restoreColNames = FALSE
)

Arguments

STA

An object of class STA.

trials

A character vector of trials for which the statistics should be computed. If not supplied, statistics are computed for all trials that have been modeled.

traits

A character vector of traits for which the statistics should be computed. If not supplied, statistics are computed for all traits that have been modeled.

what

A character vector indicating which statistics should be computed. Most statistics are available for all models, some only for models fitted using a certain engine. If this is the case, this is indicated in the list with options in details. If what = "all", all available statistics are computed.

keep

A character vector of column(s) in the object of class TD used for modeling. These columns will be kept as output when computing fitted values, residuals, standardized residuals and rMeans. Columns can also be kept when computing (se)BLUEs and (se)BLUPs but only if the column to keep contains unique values for the modeled variables, i.e. a column repId with several different values per genotype cannot be kept.

restoreColNames

Should the original column names be restored in the output of the extracted data?

Value

A list with, per trial for which statistics have been extracted, a list of those statistics.

Details

Possible options for what are:

F - BLUEs

Best Lineair Unbiased Estimators.

F - seBLUES

Standard errors of the BLUEs.

R - BLUPs

Best Lineair Unbiased Predictors.

R - seBLUPs

Standard errors of the BLUPs.

F - ue

Unit errors - only for lme4 and asreml.

R - heritability

Heritability.

F - varCompF

Variance components for model with genotype as fixed component.

R - varCompR

Variance components for model with genotype as random component.

R - varGen

Genetic variance component(s).

R - varErr

Residual variance component(s) - only for lme4 and asreml.

R - varSpat

Spatial variance components - only for SpATS.

F - fitted

Fitted values for the model with genotype as fixed component.

F - residF

Residuals for the model with genotype as fixed component.

F - stdResF

Standardized residuals for the model with genotype as fixed component

R - rMeans

Fitted values for the model with genotype as random component.

R - ranEf

Random genetic effects.

F - residR

Residuals for the model with genotype as random component.

F - stdResR

Standardized residuals for the model with genotype as random component

F - wald

Results of the wald test - only for lme4 and asreml.

F - CV

Coefficient of variation - only for lme4 and asreml.

F - rDfF

Residual degrees of freedom for the model with genotype as fixed component.

R - rDfR

Residual degrees of freedom for the model with genotype as random component.

R - effDim

Effective dimensions - only for SpATS.

R - ratEffDim

Ratio's of the effective dimensions - only for SpATS.

F - sed

Standard error of difference - only for asreml.

F - lsd

Least significant difference - only for asreml.

all

All available statistics.

See Also

fitTD

Examples

Run this code
# NOT RUN {
## Fit model using SpATS.
myModel <- fitTD(TD = TDHeat05, design = "res.rowcol", traits = "yield")

## Extract all available statistics from the fitted model.
extr <- extract(myModel)

## Extract only the BLUEs from the fitted model.
BLUEs <- extract(myModel, what = "BLUEs")

## Extract only the BLUEs from the fitted model and keep trial as variable in
## the output.
BLUEs2 <- extract(myModel, what = "BLUEs", keep = "trial")

# }

Run the code above in your browser using DataCamp Workspace