Learn R Programming

SOP (version 1.0-1)

rae: Defining random effects in SOP formula

Description

Auxiliary function used to define random effects terms in a sop model formula.

Usage

rae(x)

Value

The function is interpreted in the formula of a sop model and creates the right framework for fitting the random effect. List containing the following elements:

x

name of the covariate involved.

Arguments

x

the x-variable (factor) that defines the random effects term.

Details

The functions is designed to represent random effects in SOP formulae.

See Also

f, ad, sop

Examples

Run this code
library(SOP)
require(SpATS)
## An example of use of SOP package for the analysis of field trials experiments.
## Taken from the SpATS package.
data(wheatdata)

# Create factor variable for row and columns
wheatdata$R <- as.factor(wheatdata$row)
wheatdata$C <- as.factor(wheatdata$col)

# package SOP
m0 <- sop(formula = yield ~ colcode + rowcode + 
  f(col, row, nseg = c(10, 10)) + 
  rae(geno) + rae(R) + rae(C), data = wheatdata)
summary(m0)
plot(m0, col = topo.colors(100))

Run the code above in your browser using DataLab