Thursday, November 4, 2021

Data Analytics Using Tableau: Finding Relationships Among Variables

 

Data Analytics Using Tableau: Finding Relationships Among Variables 

This is my Business Analytics Lecture on Finding Relationships among Variables. The Excel Data can be downloaded at https://github.com/alcadelina/smoking-drinking.git . The objective is to show if there is a Relationship Between Smoking and Drinking. Listing the habits of 8761 adults, the categories have been coded as:

N---- Non      O--- Occasional      H-- Heavy      S--- Smoker      D--- Drinker

The Objective is to use Tableau Crosstabs and Percentages of Row and Column totals. The output should be similar below:


Step 1. Upload the Excel data to Tableau Desktop.



Step 2. Drag"Smoking" to the Column pill and "Drinking" to the Rows pill. Drag #Data (Count) to the "Text" in the Marks Card. Label it Percentages of Row Totals. In the "CNT(Data)" click "Compute" Using "Table (Across). 



Step 3. Duplicate the Percentages of Row Totals and rename it Percentages of Column Totals. In the "CNT(Data)" click "Compute" Using "Table (Down).


Step 4. We will now create a Bar Chart. Drag "Drinking" and "Smoking" in the Columns pill and "Data (Count)" in the Rows pill. Press "Ctrl" and drag "Data (Count)" to "Label" in the Marks Card. Drag "Smoking" in the "Color" of the Marks Card. In the Rows Pill click the arrow button of the CNT (Data) and click "Compute" using "Smoking". Make necessary "Axis Line" for the Columns. Label your Bar Graph as "Percentages of Row Totals"


 


Step 5. Duplicate the "Percentages of Row Totals" and rename it as "Percentages of Column Totals". Switch the position of the "Drinking" and "Smoking" in the "Columns" pill. 



In the Rows Pill click the arrow button of the CNT (Data) and click "Compute" using "Drinking". Make necessary "Axis Line" for the Columns. 

Step 6. Create a Dashboard. Choose "Automatic" in the Size, make it "Tiled", click "Show Dashboard Title" and type "Finding Relationships Between Smoking and Drinking". Drag all your sheets in the Dashboard. Experiment on "Vertical" and "Horizontal" in the Objects Card. In the "Layout" add Border and Padding. Explore. 





Arnel Lopez Cadeliña, MBA, REA, CFA (Investment Foundation Certificate)

No comments:

Post a Comment