Performs k-fold CV for a model of class `mogavs`

via the cvTools package.

1 |

`mogavs` |
A model of class |

`nvar` |
The number of variables for which you want to run k-fold CV. |

`data` |
Used data set. |

`y_ind` |
The column number for the y-variable in the dataset. |

`K` |
Number of folds in the cross-validation, default K=10. |

`R` |
Number of repeats for the CV, default R=1. |

`order` |
Logical, whether the result should be sorted by the column |

Perform k-fold cross-validation for all the linear models with `nvar`

number of variables, which have been tried during the course of the genetic algorithm.

A data frame with the following columns:

`archInd` |
The row index of the linear model in the |

`formula` |
The formula of the linear model as a character string. |

`CVerror` |
The root mean square error of the model. |

`CVse` |
The standard error of the model across the |

Tommi Pajala <tommi.pajala@aalto.fi>

`mogavsToLinear`

1 2 3 | ```
data(sampleData)
mod<-mogavs(y~.,data=sampleData,maxGenerations=20)
cv.mogavs(mod,nvar=3,data=sampleData,y_ind=1,K=10,R=1,order=FALSE)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.