I have the following data
pt_id <- c(1,1,1,1,1,2,2,2,3,3,3,3,3,4,4,4,4) Tobacco <- c("once","twice","never", NA, NA, NA, N