plantTrialLmmFitCompSel: Model fit, comparison and selection

plantTrialLmmFitCompSelR Documentation

Model fit, comparison and selection

Description

For a plant field trial, fit by maximum likelihood (ML) a global linear (mixed) model with all the specified terms, then fit by ML various sub-models and compare them (AICc) or test each term (F-test for fixed effects and likelihood ratio test for random variables), finally select the best model and, if there are random variables, re-fit it using restricted maximum likelihood (ReML).

Usage

plantTrialLmmFitCompSel(
  glob.form,
  dat,
  part.comp.sel = "fixed",
  alpha.fixed = 0.05,
  alpha.random = 0.1,
  ctl = NULL,
  saved.file = NULL,
  nb.cores = 1,
  cl = NULL,
  verbose = 1
)

Arguments

glob.form

character containing the formula for the global model

dat

data frame with all the columns required by glob.form; if the response contains an inline function (e.g., log or sqrt), the untransformed response may still be required

part.comp.sel

part(s) of the model (fixed and/or random); if only "fixed", the lm/lme4 and MuMIn packages will be used, otherwise the lmerTest package will be used

alpha.fixed

for lmerTest, threshold on p values of fixed effects below which they are kept

alpha.random

for lmerTest, threshold on p values of random effects below which they are kept

ctl

if NULL, will be the output of lmerControl with default arguments

saved.file

name of the file in which to save all model fits or from which to load all model fits (for MuMIn); for lmerTest, only the fit of the global model will be saved

nb.cores

number of cores; ignored with lmerTest

cl

an object of class "cluster"; if NULL, will be created automaticall based on nb.cores; ignored with lmerTest

verbose

verbosity level (0/1)

Value

list


timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.