RSquare: RSquare

Description Usage Arguments Value Author(s) Examples

View source: R/lsmeans.r

Description

It returns the R-square of a fitted model. If the model is a mixed effects model this function will return a named lists of R-squares. The R2_0 for the fixed part and the R2_1, R2_2,... for the random parts. The R-squares will increase with the each nested random effect.

Usage

1
RSquare(myModel)

Arguments

myModel

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

Value

A named list of variable length containing R_squares. At least it has one element R2_0, which is the R-square of the fixed part of the model, then for each random effect an R-square is added with names R2_1,R2_2,...

Author(s)

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

Examples

1
2
3
4
5
6
7
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)
RSquare(myModel)

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