Learn R Programming

asremlPlus (version 2.0-2)

setvarianceterms.asreml: allows the seting of constraints and initial values for terms in the random and rcov arguments of an asreml call, with the resulting call being evaluated.

Description

Takes an unevaluated call and evaluates the call after setting the constraints and initial values for the terms specified in terms. The elements of terms are matched with those generated by asreml and used, for example, in the varcomp component of a summary.asreml object. These names generally include descriptive suffices. To match an element of terms that includes such a suffix, set ignore.suffices to FALSE so that a literal match between the element and the assigned names is sought.

Usage

setvarianceterms.asreml(call, terms, ignore.suffices = TRUE, 
                        constraints = "P", initial.values = NA, ...)

Arguments

call
an unevaluated call to asreml. One way to create such a call is to use the call function with its name argument set to "asreml". Another is to
terms
a character vector specifying the terms that are to have constraints and/or initial values specified.
ignore.suffices
a logical vector specifying whether the suffices of the asreml-assigned names of the variance terms (i.e. the information to the right of an "!", other than "R!") is to be ignored in
constraints
a character vector specifying the constraints to be applied to the terms specified in terms. This vector must be of length one or the same length as terms. If it i
initial.values
a character vector specifying the initial values for the terms specified in terms. This vector must be of length one or the same length as terms. If it is of leng
...
additional arguments to be added to the call, or arguments in the call with changed values.

Value

  • An asreml object.

References

Butler, D. G., et al. (2010). Analysis of Mixed Models for {S} language environments: {ASReml-R} reference manual. Brisbane, DPI Publications.

See Also

update.asreml

Examples

Run this code
m1.call <- call("asreml", 
                   fixed = Height ~ (Block + Irrig)*csDay.num,
                   random= ~ spl(csDay.num)/(Irrig+Block)
                             + dev(csDay.num)
                             + str(~Block:Plot/csDay.num, ~us(2):id(20)) 
                             + Block:Plot:spl(csDay.num),
                   data=quote(dat)) ##use quote to stop evaluation of dat here 
   terms <- c("Block:Plot+Block:Plot:csDay.num!us(2).2:1", "R!variance")
   m1.asreml <- setvarianceterms.asreml(m1.call, terms, 
                                        constraints=c("U","P"), 
                                        initial=c(NA,3), 
                                        ignore.suffices=c(FALSE,TRUE))
   summary(m1.asreml)

Run the code above in your browser using DataLab