Skip to content

cut ()

3 messages · Muhuri, Pradip (SAMHSA/CBHSQ), Neal H. Walfield, David L Carlson

#
At Mon, 31 Dec 2012 22:25:25 +0000,
Muhuri, Pradip (SAMHSA/CBHSQ) wrote:
The problem is likely due to comparisons of floating point numbers.
Try moving your lower and upper bounds out a tiny bit.  When I add

  c(-1e-8, 0, 0, 0, 0, 1e8)

to the result of quantile, I don't get any NAs.

Neal
#
A misplaced right parenthesis caused the problem:

p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile
(p1_st_data$obt_mrj_p, (0:5/5), include.lowest=TRUE)) 

Should be

p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile
(p1_st_data$obt_mrj_p, (0:5/5)), include.lowest=TRUE)

---------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352