getThetaVars: Get variances and degrees of freedom of model parameters

View source: R/squeezePars.R

getThetaVarsR Documentation

Get variances and degrees of freedom of model parameters

Description

This function extracts the estimated variances of specified random effects and shrunken fixed effects as well as their associated degrees of freedom (based on the trace of the Hat matrix). It also always returns the residual variance and the residual degrees of freedom.

Usage

getThetaVars(protLM, par_names, printProgress = FALSE, shiny = FALSE,
  message = NULL)

Arguments

protLM

A protLM object of which residual variances and/or model parameters need to be returned.

par_names

Character vector indicating of which model parameters the variance needs to be returned. When squeezing random effects, provide their names. Fixed effects are present in shrinkage groups, e.g. ridgeGroup.1. If you want to return their variance as well, provide the names of the shrinkage groups that need to be squeezed. If par_names=NULL, NA will be returned in the thetas and df_thetas slots of the output.

printProgress

A logical indicating whether the R should print a message before performing each preprocessing step. Defaults to FALSE.

shiny

A logical indicating whether this function is being used by a Shiny app. Setting this to TRUE only works when using this function in a Shiny app and allows for dynamic progress bars. Defaults to FALSE.

message

Only used when printProgress=TRUE and shiny=TRUE. A single-element character vector: the message to be displayed to the user during the extracting of the variances and degrees of freedom, or NULL to hide the current message (if any).

Value

A named list with 4 slots. The first slot thetas contains a matrix with in each column the estimated variances for an effect specified in the par_names argument, each row corresponds to a different accession in the protLM object. The second slot df_thetas contains a matrix of similar structure to thetas but containing the degrees of freedom corresponding to the estimated variances. The third slot vars contains a vector of residual variances for each accession and the fourth slot df_vars contains a vector of residual degrees of freedom.

References

....

Examples

....

statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.