problem-4.1

problem-4.1  The tables can be made using table(). Different tables are produced for each level of the last variable specified. For example, to answer the first question we have:
> attach(samhda)
> table(amt.smoke, marijuana, gender)
, , gender = 1

         marijuana
amt.smoke 1   2   9
       1   13   3   0
       2    3   0   0
       3    5   0   0
       4    5   1   0
       5    2   5   0
       6   11  13   0
       7   25  38   1
       98   6 148   0
       99   4   4   2

...
> detach(samhda)
    
By looking at the help page for samhda to see how the variables are coded, we can see that a marijuana value of 2 is "not smoking", and an amt.smoke value of 7 is "no smoking in the last 30 days," whereas 1 indicates "smoking every day." The table for males (gender equal 1) shows that in this data set marijuana smokers are much more likely to be among the heavier cigarette smokers.