Learn R Programming

sommer (version 4.5.27)

fitted.mmes: fitted form a LMM fitted with mmes

Description

fitted method for class "mmes".

Usage

# S3 method for mmes
fitted(object, type=c("response", "link"), ...)

Value

For Gaussian fits, fitted values of the form y.hat = Xb + Zu. For non-Gaussian PQL fits, response-scale conditional means by default, or Xb + Zu with

type="link". Single-family native Laplace ordinal fits default to a labelled observation-by-category probability matrix.

type="response" and "probabilities" are equivalent;

type="link" returns the latent predictor, and type="mean"

returns the expected numeric category code, which depends on category coding and is not itself a category probability. Single-family native Laplace multinomial fits return observation-by-category probabilities on the response scale by default;

type="link" returns the \(K-1\) logits against the selected reference category.

Arguments

object

an object of class "mmes"

type

For a non-Gaussian PQL fit, return fitted means on the response scale (default) or linear predictors on the link scale.

...

Further arguments to be passed to the mmes function

Author

Giovanny Covarrubias

See Also

fitted, mmes

Examples

Run this code
# data(DT_cpdata, package="enhancer")
# DT <- DT_cpdata
# GT <- GT_cpdata
# MP <- MP_cpdata
# #### create the variance-covariance matrix
# A <- A.mat(GT) # additive relationship matrix
# #### look at the data and fit the model
# head(DT)
# mix1 <- mmes(Yield~1,
#               random=~vsm(ism(id),Gu=A)
#                       + Rowf + Colf + spl2Dc(Row,Col),
#               rcov=~units,
#               data=DT)
# 
# ff=fitted(mix1)
# 
# colfunc <- colorRampPalette(c("steelblue4","springgreen","yellow"))
# lattice::wireframe(`u:Row.fitted`~Row*Col, data=ff$dataWithFitted,  
#           aspect=c(61/87,0.4), drape=TRUE,# col.regions = colfunc,
#           light.source=c(10,0,10))
# lattice::levelplot(`u:Row.fitted`~Row*Col, data=ff$dataWithFitted, col.regions = colfunc)

Run the code above in your browser using DataLab