Description Usage Arguments Value See Also Examples
View source: R/carrot_functions.R
Function which prints the highest predictive power, predictive accuracy of the empirical prediction (value of emp
computed by cross_val
for logistic regression), outputs the regression objects corresponding to the highest average predictive power and the indices of the variables included into regressions with the best predictive power.
In the case of linear regression it outputs the best regressions with respect to both absolute and relative errors
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
vari 
set of predictors 
outi 
array of outcomes 
crv 
number of crossvalidations 
cutoff 
cutoff value for mode 
part 
for each crossvalidation partitions the dataset into training and test set in a proportion 
mode 

cmode 

predm 

objfun 

parallel 
TRUE if using parallel toolbox, FALSE if not. Defaults to FALSE 
cores 
number of cores to use in case of parallel=TRUE 
minx 
minimum number of predictors to be included in a regression, defaults to 1 
maxx 
maximum number of predictors to be included in a regression, defaults to maximum feasible number according to one in ten rule 
nr 
a subset of the dataset, such that 
maxw 
maximum weight of predictors to be included in a regression, defaults to maximum weight according to one in ten rule 
st 
a subset of predictors to be always included into a predictive model,defaults to empty set 
rule 
an Events per Variable (EPV) rule, defaults to 10 
corr 
maximum correlation between a pair of predictors in a model 
Prints the highest predictive power provided by a regression, predictive accuracy of the empirical prediction (value of emp
computed by cross_val
for logistic regression).
ind 
Indices of the predictors included into regressions with the best predictive power written in a list. For 
regr 
List of regression objects providing the best predictions. For 
regr_a 
List of regression objects providing the best predictions with respect to absolute error.For 
regr_r 
List of regression objects providing the best predictions with respect to relative error.For 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  #creating variables for linear regression mode
variables_lin<matrix(c(rnorm(56,0,1),rnorm(56,1,2)),ncol=2)
#creating outcomes for linear regression mode
outcomes_lin<rnorm(56,2,1)
#running the function
regr_whole(variables_lin,outcomes_lin,20,mode='linear',parallel=TRUE,cores=2)
#creating variables for binary mode
vari<matrix(c(1:100,seq(1,300,3)),ncol=2)
#creating outcomes for binary mode
out<rbinom(100,1,0.3)
#running the function
regr_whole(vari,out,20,cutoff=0.5,part=10,mode='binary',parallel=TRUE,cores=2)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.