Curriculum
Course: Basic Quantitative Analysis with R and E...
Login
Text lesson

Unit 2.2: How to Calculate Proportions

 

After you have learned how to calculate frequencies and create a cross-tabulation in the previous lesson, you will now learn how to calculate proportions both in R and Pivot Table. Please use the following codes to study along with the video lesson. Please note that the codes need to be adjusted according to the file name and variable name you have.

Code 1: prop.table(table(filename$variablename, filename$variablename), 1)

Code 2: prop.table(table(filename$variablename, filename$variablename), 2)

Download the Excel file here: data for r

 

Layer 1
Login Categories