Learn R Programming

CARRoT (version 3.0.2)

compute_max_weight: 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)

Value

returns an integer value of maximum allowed weight multiplied by 10

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

References

ref1CARRoT

Examples

Run this code
#continuous outcomes

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

#binary outcomes

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

Run the code above in your browser using DataLab