Closed ybkamaleri closed 2 years ago
Code can be implemented in kodebook or column Extra eg.
kodebook
Extra
AgeCat(5) to categorise age to 5 years interval or AgeCat(1, 18, 50, 70) to categorise to specific interval
AgeCat(5)
AgeCat(1, 18, 50, 70)
With AgeCat(5) can use cut() eg.
cut()
cut(age, breaks = c(seq(min(age), max(age), by = 5), Inf), right = FALSE)
And use fcase() for specified categories.
fcase()
Code can be implemented in
kodebook
or columnExtra
eg.AgeCat(5)
to categorise age to 5 years interval orAgeCat(1, 18, 50, 70)
to categorise to specific interval