# NOT RUN {
## use infert data
data(infert)
codebook(infert)
## create a new variable induced2 with 0 and 1+2
infert.new <- generate(infert, induced2, as.numeric(induced == 0))
tab(infert.new, induced2)
## create a new variable with values the same as education
infert.new <- generate(infert, edu, education)
tab(infert.new, edu)
# }
Run the code above in your browser using DataLab