Module 9 Assignment
In this assignment, I was given a data frame to generate a simple table in R that consisted of four columns: Country, age, salary, and Purchased. I had to generate a contingency table (rx C table) using the mtcars dataset. Question 1: I used the given data frame called "assignment_data" to format each data into its own line. So, by using the data.frame() function and manually entering the values for each variable. I placed each variable in their own lines so that it is easier to read but it also automatically placed them in separate columns for the table. After defining the data frame, I displayed it by typing "assignment_data", which printed the table showing all ten observations and their corresponding values for each variable. Question 2: I generated a contingency table that represents the relationship between two variables in the mtcars dataset. I chose gear and cylinders to be my two variables. The value of cylinder makes up the columns, and the value of gear...