Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Install the reshape2 package and access the tips data. The dataset features 244

ID: 3583189 • Letter: I

Question

Install the reshape2 package and access the tips data. The dataset features 244 customer dining experiences along with seven different measured variables. The description of the variables are as follows: total_bill: Final price of the meal Produce a one-way frequency distribution of the days when the customers had gone to the restaurant. Produce a two-way frequency distribution of the two variables day and time. Produce a three-way relative frequency distribution of the gender of the customer and whether they were at a smoking table by day on which they dined.

Explanation / Answer

1) days=table(tablename$day);

class(days);

f1=as.data.frame(days);

2) An altrnate and easy way of doing this is to use library(plyr).

library(plyr)

f2=count(tablename, c('day','time'));

3) the three way frequency will be.

library(plyr)

f3=count(tablename, c('gender','table'));