CalculateMmatrix: CalculateMmatrix

Description Usage Arguments Value Author(s) Examples

View source: R/lsmeans.r

Description

Calculates a matrix needed for other routines in the lsmeans package. This function is computationally demanding and there is no need to call it more than once for a given model.

Usage

1
CalculateMmatrix(myModel, myData)

Arguments

myModel

An object of class lm, gls, mle, glm, mer, lmerMod or glmerMod

myData

A data frame included in the data argument of the call to the lm, gls, mle, glm, lmer and glmer functions.

Value

An object of class matrix. This matrix is required as an argument of the following function of the lsmeans package:

CalculateMatrixofMeansAndStandardErrors() MeanAndVariance() MeansComparison()

Author(s)

Julio A. Di Rienzo <email: dirienzo@agro.unc.edu.ar>

Examples

1
2
3
4
5
6
library(nlme)
library(lme4)
library(lsmeans)
Oats[,"nitro"]=as.factor(Oats[,"nitro"])
myModel<-lme(yield~1+Variety+nitro+Variety:nitro,random =~1|Block/Variety,,method="REML",data=Oats)
Mmatrix=CalculateMmatrix(myModel,Oats)

lsmeans documentation built on May 2, 2019, 6:15 p.m.