RA MODEL VISUALIZATION WITH MICROSOFT EXCEL 2013 AND GEPHI

Similar documents
Excel for Data Cleaning and Management

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

Advanced Excel 10/20/2011 1

PortfolioCenter Export Wizard in Practice: Evaluating IRA Account Holder Ages and Calculating Required Minimum Distribution (RMD) Amounts

The first thing to do is choose if you are creating a mail merge for printing or an merge for distribution over .

Microsoft Access 2010 handout

Overview What is a PivotTable? Benefits

Excel 2003 Tutorial I

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

Search help. More on Office.com: images templates. Here are some basic tasks that you can do in Microsoft Excel 2010.

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

To reuse a template that you ve recently used, click Recent Templates, click the template that you want, and then click Create.

EXPORTING THE SCHOOL ROSTER INTO AN EXCEL SPREADSHEET

Mail Merge. Course Description. Objectives: Design a Main Document. Design a Data Source. Directories. Merge the Main Document with the Data

Using Excel as a Management Reporting Tool with your Minotaur Data. Exercise 1 Customer Item Profitability Reporting Tool for Management

Excel 2010: Create your first spreadsheet

Exploratory Facebook Social Network Analysis

Excel 2007 Basic knowledge

INTRODUCTION TO EXCEL

Merging Labels, Letters, and Envelopes Word 2013

Monthly Payroll to Finance Reconciliation Report: Access and Instructions

Basic Microsoft Excel 2007

Result Entry by Spreadsheet User Guide

Task Force on Technology / EXCEL

Introduction to Microsoft Access 2010

A Quick Tour of F9 1

A Tutorial on dynamic networks. By Clement Levallois, Erasmus University Rotterdam

Introduction to Microsoft Access 2003

Gephi Tutorial Quick Start

Microsoft Office Access 2007 Basics

Getting Started with Excel Table of Contents

Advanced Microsoft Excel 2013

Introduction to Microsoft Access 2013

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

Detail Report Excel Guide for High Schools

Access I Tables, Queries, Forms, Reports. Lourdes Day, Technology Specialist, FDLRS Sunrise

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

Microsoft Access 2010 Overview of Basics

Introduction to Microsoft Excel 1 Part I

Creating and Using Databases with Microsoft Access

DATA VISUALIZATION WITH TABLEAU PUBLIC. (Data for this tutorial at

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Instructions for Creating an Outlook Distribution List from an Excel File

Computer Training Centre University College Cork. Excel 2013 Pivot Tables

EXCEL PIVOT TABLE David Geffen School of Medicine, UCLA Dean s Office Oct 2002

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

MICROSOFT ACCESS STEP BY STEP GUIDE

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

MicroStrategy Desktop

How to Excel with CUFS Part 2 Excel 2010

Create Mailing Labels from an Electronic File

Introduction to Microsoft Access 2007

Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.

Advanced Presentation Features and Animation

Mail Merge: Create Mailing Labels Using Excel Data and Filtering the Contents in the Data

Creating an Excel Spreadsheet for Mail Merge. Excel Spreadsheet Mail Merge. 1 of 9 Design & Print Offline: Mail Merge

To create a histogram, you must organize the data in two columns on the worksheet. These columns must contain the following data:

SENDING S WITH MAIL MERGE

Intro to Excel spreadsheets

Business Objects. Report Writing - CMS Net and CCS Claims

EXCEL EXERCISE #8: Consolidating and Linking Spreadsheets

Creating and Managing Online Surveys LEVEL 2

Microsoft Excel 2010 Tutorial

Learning Services IT Guide. Access 2013

MICROSOFT ACCESS 2007 BOOK 2

The Microsoft Access 2007 Screen

Microsoft Office. Mail Merge in Microsoft Word

To launch the Microsoft Excel program, locate the Microsoft Excel icon, and double click.

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

Mail Merge Microsoft Word and Excel Queries Scott Kern Senior Consultant

Importing TSM Data into Microsoft Excel using Microsoft Query

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

EXCEL FINANCIAL USES

Advanced Excel Charts : Tables : Pivots : Macros

for Sage 100 ERP Business Insights Overview Document

Microsoft Access Rollup Procedure for Microsoft Office Click on Blank Database and name it something appropriate.

WHAT S NEW IN MS EXCEL 2013

NATIONAL STUDENT CLEARINGHOUSE RESEARCH CENTER

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

Avery Wizard: Using the wizard with Microsoft Word. This is a simple step-by-step guide showing how to use the Avery wizard in word

How To Create A Report In Excel

Microsoft Excel 2013: Using a Data Entry Form

UCINET Quick Start Guide

Radius Maps and Notification Mailing Lists

ECDL. European Computer Driving Licence. Spreadsheet Software BCS ITQ Level 2. Syllabus Version 5.0

Tommy B. Harrington 104 Azalea Drive Greenville, NC

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

ITS Training Class Charts and PivotTables Using Excel 2007

Virtual Communities Operations Manual

Using Excel for Analyzing Survey Questionnaires Jennifer Leahy

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Excel Project Creating a Stock Portfolio Simulation

Creating and Editing Workbooks. STUDENT LEARNING OUTCOMES (SLOs) After completing this chapter, you will be able to:

Creating a Gradebook in Excel

Personal Portfolios on Blackboard

Excel Database Management Microsoft Excel 2003

MS Excel Template Building and Mapping for Neat 5

Here is a Trial Balance sample, generated and exported into an Excel spreadsheet, by an accounting software*

Q&As: Microsoft Excel 2013: Chapter 2

Transcription:

RA MODEL VISUALIZATION WITH MICROSOFT EXCEL 2013 AND GEPHI Prepared for Prof. Martin Zwick December 9, 2014 by Teresa D. Schmidt (tds@pdx.edu)

1. DOWNLOADING AND INSTALLING USER DEFINED SPLIT FUNCTION FOR MICROSOFT EXCEL 2013 We will install a user defined function (UDF) that will allow us to automatically turn an RA association into a list of its constituent variables. This UDF finds each variable name by its start with a capital letter. Code for this function was found at http://www.mrexcel.com, and has been prepared as a fil named SplitAa.xlam. To install the UDF, download the SplitAa.xlam file to your Microsoft folder for Add-Ins. 1. Right click on the downloadable file SplitAa.xlam, and choose Save link as 2. Type in the file path C:\Users\...\AppData\Roaming\Microsoft\Addins, substituting the with your username (e.g., tds, zwick) 3. Click Save to save the SplitAa.xlam file to this location 4. Next, open Microsoft Excel (and select a Blank Workbook for Office 2013). 5. Click on File Options Add-Ins 6. You should see Splitaa listed under the Inactive Addins 7. Click on Go to Manage Excel Add-ins 8. Check the box next to Splitaa and click OK (as shown below) If Splitaa is missing, or if you don t have the SplitAa.xlam file, see Appendix A (p. 9). GEPHI Gephi is a free network visualization software that has a relatively friendly user interface. Gephi can be downloaded from http://gephi.github.io/users/download/. Download and install this software with standard settings. 1

2. CREATING AN EDGE LIST TURNING AN RA MODEL INTO AN EDGE LIST RA models produced by OCCAM (http://dmit.sysc.pdx.edu) can be visualized as a graph. Let s take the example model AaBb:AaCc:AaDd:DdEe:EeFfGg. This indicates associations between variables Aa and Bb, between Aa and Cc, and so on. Variables in each association can be said to be connected, but most graph visualization programs cannot interpret RA associations as connections. So we will use Microsoft Excel to transform this RA model into a list of graph edges. 1. Open Excel, and create a new Blank Workbook 2. Copy and paste your model (e.g., AaBb:AaCc:AaDd:DdEe:EeFfGg) into cell A1 of the workbook, as shown below. 3. Click on the Data tab, and choose Text to Columns 4. The file type should be Delimited by default, so click Next 5. Under Delimiters, check the box next to Other and enter a colon ( : ) 6. Then click Finish 2

The Excel Workbook should now have all of the associations spread out over a row. We will now transpose them so that they are listed along one column. 1. Highlight the cells with associations in them, and right click to copy (or Ctrl+C) 2. Now select the A2 cell as the starting point for the transposed list 3. Right click on cell A2 and select the transpose button ( ). Or, you can click Paste Special and then from the Paste Special Window you can check the box next to Transpose and click OK 4. Associations should now be listed in column A, starting with Cell A2. You can delete the associations in the first row. 5. Next, select cell B2, and use the SplitAa UDF on cell A2: =SplitAa(A2). Hit enter. 6. Cell B2 should now show the variables from A2 with a hyphen between them 7. With B2 still selected, double click the fill handle (highlighted above) or click and drag the SplitAa function down column B through the list of associations 8. Once all associations are hyphenated, we can use Text to Columns to break them up. So highlight the hyphenated cells (starting with B2), and right click to copy 9. Select the cell C2 and right click to paste values only ( ), or choose Values Only from the Paste Special window 10. With the hyphenated associations in column C highlighted, click on Text to Columns under the Data tab. This time use a hyphen as a delimiter. 3

REPRESENTING HYPEREDGES AS PAIRWISE If all associations in an RA model are pairwise, columns C and D can be used as an edge list. Rename Columns C and D as Source and Target and delete columns A and B. (Skip to step 3 on p.6.) However, if some associations contain more than two variables, like EeFfGg, some additional steps are needed to create an edge list that can be recognized by most standard visualization software. 1. First, empty columns A and B by deleting cell contents 2. In cell B2, enter the formula =COUNTA(C2:XFD2) 3. Drag this formula down the length of column B, to count the variables in each association 4. With cell B2 selected sort the associations by their size a. Under the home tab, click on Sort & Filter, then Sort Smallest to Largest 5. Then, starting in A2, number the associations. a. You can fill in the first few numbers and then double click or click and drag to autofill 6. Create a second sheet in the Excel workbook a. Click on the sign, on the bottom of the Excel window, towards the left 7. Copy all of the top rows with associations of two variables 8. Paste them into the second worksheet (Values Only), leaving the top row blank 4

9. In the first row of the second worksheet, copy and paste the following to each cell: A1: =MAX(Sheet1!B:B) B1: =COUNTIF(Sheet1!B:B, "=2")+2 C1: Source D1: Target 10. Then, in the first empty cell of Column A, paste the following formula: =OFFSET(INDIRECT(ADDRESS($B$1,2,1, 1, "Sheet1")), INT((ROW()- Sheet2!$B$1)/Sheet2!$A$1),-1) &"-"& INDIRECT("Sheet1!R" & INT((ROW()- Sheet2!$B$1)/Sheet2!$A$1)+Sheet2!$B$1 & "C" & COLUMN()+(MOD((ROW()- Sheet2!$B$1),Sheet2!$A$1))+2,FALSE) 11. This formula should produce a number, a hyphen, and then a variable name. 12. Click and drag this formula down until only hyphens appear (shown at left). 13. Copy the new associations and paste only their values ( ) in column C (shown at center). 14. Use Text to Columns (under the Data tab) and split the new associations a. You can hit Finish right away; Excel will still have hyphen ( - ) listed as a delimiter 15. There may be blank cells in column D, but you can sort them to the bottom a. In the Home tab, click Sort & Filter, then A to Z 16. Now create a third sheet in the workbook 17. Copy the list of edges from columns C and D to the first two columns in the third sheet 18. Save this file as an excel file (e.g., Project.xlsx) 5

3. RA MODEL VISUALIZATION WITH GEPHI CREATING AN EDGE FILE WITH EXCEL Visualization with Gephi requires an Edge file and a Node file in csv format. The Edge file can be easily created from sheet 3. Copy and paste all sheet 3 cells into a new workbook and make sure the columns are labeled Source and Target. If desired, add columns for Weight, Type (Directed or Undirected) and Label and fill in values for each edge. Save the file in csv format (e.g., Edges.csv). CREATING A NODE FILE WITH EXCEL A node file will list the RA variables, including their abbreviated (ID) and full names (Label), and their type. It is possible to create a node file from another source, such as the data file submitted to OCCAM. However, when doing this, some steps are needed to ensure the spelling of the node IDs match the IDs that are listed in the RA model. Gephi is sensitive to cases and extra spaces (e.g., Aa ) when it matches node data with edge data. 1. Create a new workbook and open the RA data file (e.g., Project.txt) 2. A Text Import Wizard should appear a. Make sure Delimited file type is selected and click Next b. Check the boxes for Comma and Space as Delimiters and click Finish 3. Delete columns A, C, D, F, and all those after F 4. Delete all but one of the top rows and delete all rows pertaining to the data 5. When only variable information remains, capitalize the IDs in column B a. In cell C2, type =PROPER(B2), then click and drag this formula down column C b. Copy the capitalized IDs and paste only their values ( ) in column D 6

6. Cut or copy the capitalized IDs from column D and insert them to the left of column A 7. Delete contents of cells in columns C and D 8. Enter headings for columns A ( ID ), B ( Label ), C ( Type ), and D ( Size ) 9. All hyperedges from the edge list should be added to the node list, as shown above a. To get a list of hyperedges find the edge list and sort column A alphabetically a. Under the Data tab, click Sort & Filter, then Sort A to Z b. Hyperedge numbers will sort to the top c. Copy and paste them to the bottom of the node list and leave the labels blank 10. In column C, assign Hyperedge to numeric IDs and Variable to alphabetic IDs 11. In column D, assign 0 to numeric IDs and 1 to alphabetic IDs 12. Save this file as a csv file (e.g., Nodes.csv). IMPORTING EDGE AND NODE FILES TO GEPHI Open Gephi and select New Project. Click on the Data Laboratory Tab as shown below. In the Data Laboratory Tab, we will import both the Edges file and the Nodes file. 1. If the Data Table does not appear, click on Window and then Data Table. 2. Click on the Import Spreadsheet button 7

3. With Nodes Table selected, use the browse for the node file and click Next 4. The next window will show a list of Import settings a. The Type variable should be defined as a String variable already b. The Size variable should be changed to a Float variable c. Check the box at the bottom to Force nodes to be created as new ones and click Finish 5. Click the Import Spreadsheet button again 6. With Edges Table selected, use the browse for the node file and click Next a. If you have labels and weights, they should be String and Float variables, respectively. b. It doesn t matter whether the box is checked for Create missing nodes. Click Finish 8

CUSTOMIZING RA MODEL VISUALIZATIONS We can generate an initial network visualization from Gephi s Overview Tab 1. In the Layout window, click on the ---Choose a layout button, and choose Force Atlas. 2. Click the run button and a networks should appear in the Graph window. 3. If the network is crunched it can be expanded in the Force Atlas window as shown below: a. Increase the repulsion strength (to 10,000) b. Decrease the attraction strength (to 1) c. Click the run button again to update d. Click the stop button when the nodes stop moving 9

Colors can be added to the network through the Partition window 1. Click the refresh button 2. Choose Type from the drop down menu 3. Colors will be randomly assigned for Hyperedge nodes and for Variable nodes 4. Click the Apply button to update 5. To change the colors, click on one and drag your cursor through the color palette (shown at right) 6. Click the Apply button to update Hyperedge nodes can be made (nearly) invisible through the Ranking window 1. Click on the Size/Weight button 2. Choose Size from the drop down menu (There s no refresh button in the Ranking window, so if Size doesn t appear at first, try toggling between Nodes and Edges in the Ranking window.) 3. Reduce the Min size to 0.5 (zero is not allowed) 4. Increase the Max size to 10 or more 5. Click the Apply button to update 10

If your network includes isolate variables, who are not connected to anyone, you can hide them. 1. In the Filters window, double click on Topology 2. Within Topology, double click on Degree Range 3. In the Degree Range settings, click and drag the lower handle to the right so that the lower range is set to 1 (and not 0) 4. Click the filter button to update To show variable labels, click the button for Show Node Labels at the bottom of the Graph window 1. Adjust the font size by clicking the Font Button or by dragging the text size handle 2. Drag mode should be enabled ( ) by default, so you can also click and drag nodes to optimize the network layout 11

At this point screenshot image of the network can be captured with the camera button If higher quality images are desired, they can be created under the Preview tab. Here are some recommended customizations: 1. Under Nodes, change the opacity to 60% 2. Under Node Labels, check the box for Show Labels 3. Under Edges, uncheck the box for Curved 4. Under Edge Arrows, change the size to 0.0 5. Click on the Refresh button To create a high quality image, click on File Export and SVG/PDF/PNG file... 1. In the Export window, click the Options button 2. Add one- or two-inch margins on all sides 3. Click OK and then Save 12

APPENDIX A: CREATING SPLITAA FUNCTION To create the SplitAa user defined function from scratch, open an excel file and select a blank workbook. You will need to use the Developer Tab, so if you don t see it 1. Click on File Options Customize Ribbon 2. Check the box for Developer and click OK Then, under the Developer Tab, click on Visual Basic 13

In the Visual Basic window, click on Insert Module. 1. In the Module window, enter the text Function SplitAa(s As String) As String With CreateObject("vbscript.regexp").Pattern = "([a-z])([a-z])".global = True SplitAa =.Replace(s, "$1-$2") End With End Function 2. Then click on File Save Book1 3. Change the File type to *.xlam (shown at right) 4. Change the File name to SplitAa 5. The file location should automatically go to C:\Users\...\AppData\Roaming\Microsoft\Addins 6. Click Save and close the Visual Basic window Back in the Excel window, click on File Options Add-Ins 1. Click on the Go button next to Manage Excel Add-Ins 2. Then check the box next to Splitaa, (as shown on page 1), and click OK. 14