allmodels: Linear Models with all possible combinations of all variables

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/allmodels.R

Description

The function generates Linear Models (LM) with all possible combinations of all variables included in the full model. Each model is a GLM of family gaussian with the response variable modeled by one or more independent variables (Y= a+X1b1+e, Y= a+X1b1+X2b2+e, and so on).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
allmodels(
  response,
  variables,
  subset,
  type = "AICc",
  only_intercept = FALSE,
  importance = TRUE,
  ...
)

## S3 method for class 'allmodels'
print(x, n = 10, ...)

## S3 method for class 'allmodels'
summary(object, ...)

Arguments

response

A data frame containing the response variable.

variables

A data frame containing all the independent variables for the models.

subset

Maximum number of independent variables to be considered in each model.

type

Information criterion to be used "AIC","BIC","AICc","qAIC" and "qAICc" (Default type = "AICc").

only_intercept

Logical argument (TRUE or FALSE) to specify if a model containing only the intercept should be included (Default only_intercept = FALSE).

importance

Logical argument (TRUE or FALSE) to specify if the relative importance of variables should be calculated. (Default importance = TRUE).

...

Other parameters for the respective functions. In allmodels function the parameters are for the glm function.

x

An object of class allmodels.

n

Number of model for print.

object

An object of class allmodels.

Value

Envir_class

The class of each variable.

N_models

The number of models.

IC

A data frame containing the information criterion, the number of parameters, difference in IC from minimum - IC model and the weights IC. The same that function ICtab.

Models

A list with all models. Each model is the class glm.

ImpValues

Relative importance of each variable.

Note

If the model with only the intercept is include, this will be the last model.

Author(s)

Vanderlei Julio Debastiani <vanderleidebastiani@yahoo.com.br>

See Also

glm ICtab

Examples

1
2
3
4
5
6
7
8
#require(vegan)
#data(mite)
#data(mite.pcnm)
#response<-rowSums(mite)
#Res<-allmodels(response,mite.pcnm,subset=3)
#Res
#summary(Res)
#Res$Models$Model_1157

vanderleidebastiani/daee documentation built on Jan. 22, 2021, 2:41 p.m.