@christinelly, your example has additional categories for marital and genhlth, so you will get a different result because these categories are sampled randomly for the purposes of generating some example data. If you use the same example as apreshill did you should get the same result (just make sure you re-run the set.seed(1234) command, too).
Defining set.seed just allows random samples to be recreated when you re-run the code. If you left it out you would get a different sample data set each time you ran the code. You can use any other integer to get a different sample.
As only you have the original data, LVG77 generated an example data set earlier in the thread to illustrate working code. In your earlier example you change the categories, so got a different result.
Thank you for your help, it is now clear to me why set.seed is used for.
My question is not answered. My code is not running with the suggested code. Or is the code supposed to be used just for sample statistics and not for original data?