search for: ageassign

Displaying 1 result from an estimated 1 matches for "ageassign".

Did you mean: aassign
2009 Apr 22
4
Problem with "apply"
...ds[150:250,] and mds[10000:10100,]. However, with mds[200:300,], mds[250:350,] and mds[1000:1100,], only ages with 3 digits are correctly assigned - all ages <100 are returned as NA. I'm using R v 2.8.1 on Windows XP. Cheers, Alan Cohen Centre for Global Health Research, Toronto,ON > ageassign <- function(x){ + y <- NA + if (x[11] %in% c(0:4)) {y <- "0-4"} + else if (x[11] %in% c(5:14)) {y <- "5-14" } + else if (x[11] %in% c(15:29)) {y <- "15-29" } + else if (x[11] %in% c(30:69)) {y <- "30-69"} + else if (x[11] %in% c(...