Displaying 1 result from an estimated 1 matches for "range_aux".
2009 Mar 15
2
Testing for Inequality à la "select case"
...rmined, the values in x are multiplied by the
percentages applying to the range in the 3rd column.
If the result is less than the fourth column, then the latter is used.
For values of x falling in the last interval, 250,000 must be used.
My best attempt at it in R:
MyRange <- function(x){
range_aux = ifelse(x<=20000, 1,
ifelse(x<=100000, 2,
ifelse(x<=250000, 3,
ifelse(x<=700000, 4,
ifelse(x<=1000000, 5,6)))))
percent = c(0.65, 0.4, 0.3, 0.25, 0.2, 0)
minimum = c(0, 14000, 40000, 75000, 175000, 250000)
pmax(x...