compute_max_weight {CARRoT} | R Documentation |
Function which computes maximal weight (multiplied by the corresponding EPV rule) of a regression according to the rule of thumb applied to the outcome variable. Weight of a regression equals the sum of weights of its predictors.
compute_max_weight(outi,mode)
outi |
set of outcomes |
mode |
indicates the mode: 'linear' (linear regression), 'binary' (logistic regression), 'multin' (multinomial regression) |
For continuous outcomes it equals sample size divided by 10, for multinomial it equals the size of the smallest category divided by 10
returns an integer value of maximum allowed weight multiplied by 10
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, http://dx.doi.org/10.1016/S0895-4356(96)00236-3.
#continuous outcomes
compute_max_weight(runif(100,0,1),'linear')
#binary outcomes
compute_max_weight(rbinom(100,1,0.4),'binary')