Learn R Programming

mogavs (version 1.1.0)

mogavsToLinear: Transform a mogavs model into a linear model.

Description

Takes in a mogavs model and a number of variables, and transforms that into linear model as in lm.

Usage

mogavsToLinear(bestModel, y_ind, data, …)

Arguments

bestModel

A binary vector, representing the variables in one model for a given number of variables.

y_ind

Column number for the y values in data.

data

The used data set.

Additional arguments.

Value

lm

A linear model of class lm.

%% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ...

See Also

getBestModel,getBestModelVars

Examples

Run this code
# NOT RUN {
data(sampleData)
mod<-mogavs(y~.,sampleData,maxGenerations=20)

#get the best model with 15 variables
bm<-getBestModel(mod,15,method=NULL)

#transform best model into a linear model
mogavsToLinear(bm,1,sampleData)
# }

Run the code above in your browser using DataLab