Module 9: Tabulating Tabular Data in R

 Hi everyone! 

This week's assignment focuses on using R to make tables from data frames. We also explore adding sum totals for both rows and columns in our contingency tables and creating proportion tables.

1.
Generate simple table in R that consists of four rows: Country, age, salary and purchased.

2. Generate contingency table also know as r x c table (Chapter 7, p.135) using mtcars dataset.

>assignment9 <table(mtcars$gear, mtcars$cyl, dnn=c("fill out here")

2.1 Add the addmargins() function to report on the sum totals of the rows and columns of assignment9 table
>addmargins(assignment9)


2.2 Add prop.tables() function, and report on the proportional weight of each value in a assignment9 table


2.3 Add margin = 1 to the argument under prop.table() function, and report on the row proportions found in assignment9 table.


-Ramya's POV

Comments

Popular posts from this blog

Module 10: Varying Multivariate Regression

Final Project: Serially looking at your Cereal Choices

Module 12: Timely Time Series