compute_max_weight {CARRoT}R Documentation

Maximum feasible weight of the predictors

Description

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.

Usage

compute_max_weight(outi,mode)

Arguments

outi

set of outcomes

mode

indicates the mode: 'linear' (linear regression), 'binary' (logistic regression), 'multin' (multinomial regression)

Details

For continuous outcomes it equals sample size divided by 10, for multinomial it equals the size of the smallest category divided by 10

Value

returns an integer value of maximum allowed weight multiplied by 10

References

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.

Examples

#continuous outcomes

compute_max_weight(runif(100,0,1),'linear')

#binary outcomes

compute_max_weight(rbinom(100,1,0.4),'binary')

[Package CARRoT version 2.5.2 Index]