compute_max_length {CARRoT} | R Documentation |
Function which computes the maximum number of regressions with fixed number of variables based on the rule of thumb
compute_max_length(vari_col,k,c,we,minx,maxx,st)
vari_col |
number of predictors |
k |
maximum weight of the predictors |
c |
array of all indices of the predictors |
we |
array of weights of the predictors. Continuous or categorical numerical variable with more then 5 categories has weight 1, otherwise it has weight |
minx |
minimum number of predictors, 1 by default |
maxx |
maximum number of predictors, total number of variables by default |
st |
a subset of predictors to be always included into a predictive model |
Integer correponding to maximum number of regressions of the same size
Peduzzi P, Concato J, Kemper E, Holford TR, Feinstein AR (1996). “A simulation study of the number of events per variable in logistic regression analysis.” Journal of Clinical Epidemiology, 49(12), 1373–1379. ISSN 0895-4356, doi: 10.1016/S0895-4356(96)00236-3, https://doi.org/10.1016/S0895-4356(96)00236-3.
Rhemtulla M, Brosseau-Liard PÉ, Savalei V (2012). “When can categorical variables be treated as continuous? A comparison of robust continuous and categorical SEM estimation methods under suboptimal conditions.” Psychological Methods, 17(3), 354–373. doi: 10.1037/a0029315.
Function uses combn
compute_max_length(4,40,1:4,c(1,1,2,1))