Response: We can use Prop.table() that computes proportions from a contingency table. Margin.table() is used for a contingency table in array form, compute the sum of table entries for a given index. Addmargins() – puts arbitrary margins on multidimensional tables or arrays For a given table one can specify which of the classifying factors to expand by one or more levels to hold margins to be calculated. One may for example form sums and means over the first dimension and medians over the second. The resulting table will then have two extra levels for the first dimension and one extra level for the second. The default is to sum over all margins in the table. Other possibilities may give results that depend on the order in which the margins are computed. This is flagged in the printed output from the function.