Category Archives: economics

Upcoming MATLAB Training at Duke

MATLAB is an integrated technical computing environment that combines numeric computation, advanced graphics and visualization, and a high-level programming language.  Duke’s license agreement offers MATLAB licenses to faculty and staff for work or personal computers, as well as students through on-campus use.  The Duke Office of Information Technology (OIT) maintains instructions on installing MATLAB at Duke.  MATLAB is used by many communities at Duke, including Engineering, Econometrics, Medical Sciences, Computational Biology, and Business.

On Tuesday, June 18, OIT in partnership with Duke University Libraries will host a one-day course on MATLAB that focuses on using this software for Data Processing and Visualization.  The course will cover importing data, organizing data, and visualizing data in a hands-on format (detailed outline).  Seats are limited to 20; please register soon to reserve your spot.

MATLAB for Data Processing and Visualization
(outline)
Laura Proctor, Academic Training Engineer at MathWorks
Tuesday, June 18
8:30 a.m. to 4:30 p.m. (lunch break from 12:00 p.m. to 1:00 p.m., lunch not provided)
Library Computer Classroom, Bostock 023
Registration (seats limited to 20)

The course assumes some existing familiarity with MATLAB.  New potential MATLAB users may want to attend an overview seminar on the software that will be held on Thursday, May 30.  This overview will not be hands on, but it will include live demonstrations and examples of both MATLAB and Simulink, an environment for multi-domain simulation and model-based design.

Introduction to Data Analysis and Visualization with MATLAB & Simulink
(details and registration)
Mehernaz Savai, Applications Engineer at MathWorks
Thursday, May 30
1:00 p.m. to 4:00 p.m.
FCIEMAS Building, Schiciano Auditorium – side A

If you would like to begin learning to use MATLAB, MathWorks offers a self-directed MATLAB Fundamentals course, and the Duke library collection also includes several introductory MATLAB texts, such as MATLAB Primer and MATLAB: A Practical Approach.

Bloomberg Has Arrived

No, it’s not Michael Bloomberg, New York City’s mayor, but the financial data service that he founded back in 1981.

The Data & GIS Services Department of Perkins Library is pleased to announce the installation of three Bloomberg Terminals in the Data/GIS Computer Cluster (Perkins Room 226). The terminals are made possible with the generous assistance of the Duke Financial Economics Center in the Duke Department of Economics.

In the past, West Campus users would need to travel to the Ford Library at the Fuqua School of Business.  This new arrangement allows them to access the Bloomberg service whenever Perkins Library is open.  The service is available only to Duke students, faculty, and staff.

Data and NewsBloomberg Monitors

Bloomberg Professional is an online service providing current and historical financial data on individual equities, stock market indices, fixed-income securities, currencies, commodities, futures, and foreign exchange for both international and domestic markets.

It also provides news on worldwide financial markets and industries as well as economic data for the countries of the world.  Additionally, it provides company profiles, company financial statements and filings, analysts’ forecasts, and audio and video interviews and presentations by key players in business and finance (the Bloomberg Forum).

The Bloomberg Excel Add-in is a tool that delivers Bloomberg data directly into an Excel spreadsheet for custom analysis and calculations.

Bloomberg keyboard

Hardware

The dual monitors at each workstation provide plenty of real estate, enabling multiple windows for your research.

The Bloomberg keyboard is customized and color-coded to allow users to access quickly and easily the information contained in the Bloomberg system and to perform specific functions.

  • The red keys are used to login or logout of the system.
  • The yellow keys represent market sectors.
  • Green keys are action keys, to request the system to do something.

Often when using Bloomberg, your command might look something like this:
[TICKER] < MARKET > [FUNCTION CODE] < GO >

The system also allows standard mouse-clicking on the screens to activate many functions.

Bloomberg Certification

You may wish to become Bloomberg Certified, which requires the successful completion of several online Bloomberg Essential courses: 4 core courses plus 1 market sector found under the BESS command.  Complete these at your own pace, but you only have two chances to pass the test.  Certification will provide documentation that you’ve gained comprehensive knowledge of the Bloomberg Professional service.

Limitations

Bloomberg for Education doesn’t have the full functionality of the commercial version of Bloomberg Professional.  For instance, there is a lag in stock quotes and data that makes it incompatible for real-time analysis or trading, it has more limited downloading capabilities, and of course there’s no online trading.

Login

You need to create your own personal login when you first access the system and will need to be near a cell phone to complete registration.  You will get either a phone call or a text message with a validation code.

Once your personal login is validated and you open the Bloomberg Service, you can open Excel and then install the Excel Add-in (move mouse to lower edge of screen to activate Windows Start button, choose All Programs … Bloomberg … Install Excel Add-in).  Then close and reopen Excel to display the Bloomberg tab for added functionality.

Cheat Sheet to log in to Bloomberg at the Library

Assistance

For help, please contact staff in the Library’s Data & GIS Services Dept.  To tide us over while we gather further documentation, besides the green Help key on the Bloomberg keyboard, the EASY command, and the CHEAT command, please take a look at some of the following help guides that have been compiled at other libraries. (Be aware that some of the instructions regarding access and logging in are specific to these other institutions.)

Time Series Visualizations in ArcGIS – An Introduction

Introduction

ArcGIS 10 makes it easy to manage and visualize time-series data to identify trends and create compelling visualizations.  Creating a visualization of time-series data requires only a few additional steps beyond those needed to produce any map.

Step 1: Data Formatting

Time-series data contains records, each of which is specific to both an individual and to a single point in time.  The following example uses employment data for the textile industry in North Carolina from 2000 through 2009.

In this example, “fips” corresponds to each county’s unique FIPS code, “industry” corresponds to the textile industry’s unique NAICS code representation, “t” denotes the year.  Establishments, employment, and annual pay, our data items, are stored in the fields “est”, “emp”, and “pay_ann”.  All missing values were coded ‘-1’.

Tip: Make sure each record has a value.  Records without values will not be drawn in ArcGIS.

Tip: Do not name the time field “year,” as it is a reserved name in ArcGIS.

We suggest based on experience that the storage of data in a Microsoft Access database provides the greatest degree of reliability.

Step 2: Add Data to Map in ArcGIS

Once the data is formatted, join the data to a geographic layer.  For help in finding a geographic layer, please consult the Perkins Data and GIS Services Department.

Tip: When joining layers, it is good practice to Verify the join selection before approving.  The program will inform you of any errors.

Step 3: Enabling Time

Once the data are joined to a layer, enter the layer properties by right-clicking the layer name in the Table of Contents pane.

Navigate to the Time tab and check the box.  ArcGIS will want to know which field contains time information, as well as the format.  If the join was successful, you will see the fields that represent the data joined to the geographic layer.  In this example, the time field is labeled “t”.

You must also specify the date/time format.  Available time formats are listed to the right.

Finally, you will have to enable time on the data table as well.  To do this, right-click the data table in the Table of Contents pane.  Follow the same steps as presented for the geographic layer.

Step 4: Enable Time Display

Now that ArcGIS understands the data structure, you may enable time visualization.  The “Tools” toolbar, which contains the most commonly used tools, contains the button highlighted below, “Open Time Slider Window”.  Select this button.

The time slider window (left) will appear.  The slider spans the time range of the data, identifies what point in this range is currently displayed on the map, and allows for access to a variety of playback and recording options.  To access these options, click the options button.

This button is the equivalent of “Play.”  It will display the data from the first time point to the last.

Buttons with both arrows and vertical lines are one-step increments.  This particular button moves forward one time increment, the other one moves back.

This button exports the display to video.  This is the final step.

Step 5: Configure Options and Visual Display

Before you export to video, you will want to configure the appearance of the map.  This example will focus on new options that come with time series data.

First, select “Options” in the Time Slider toolbar.  Under the “Time Display” tab, you can alter the format of the displayed date to conform to your data.  In this example, I selected 2011 (yyyy) because we are using annual data.

Second, under the “Playback” tab, you can specify a length of time for playback.  This example contains 10 years of data.  If I specify 5 seconds playback, each data year will be displayed for one-half second.  If I specify 10 second, each year will be visible for 1 second.

Third, I will display the year in order to make clear to the viewer the time point that is visible.  To do this, I will go to “Insert” “Dynamic Text” “Data Frame Time.”

Tip: Alternatively, you can insert the data frame time into the title or other display object by including the following in the text of the object: <dyn type=”dataFrame” name=”Layers” property=”time” emptyStr=”[off]”/>

After some trial and error, I successfully integrated the time currently visible into the title.  The image to the left shows its appearance.

Step 6: Export to Video

Once the appearance of the map is satisfactory, you can export the map to video or to sequential images.  Click the “Export to Video” button on the time slider window.

Tip: maximize the ArcGIS window, switch to Layout View, zoom the layout to 100%, and clear any toolbars that may obstruct the layout view to improve video appearance.

First, you will be asked for a file or folder location and the export format.  Videos are exported as AVI files, while sequential images are exported to a folder either as bitmaps or JPEGS.

Second, if you exported to video, you will be asked to select a codec, which essentially encodes and compresses the outputted video.  The codec selection depends on the individual machine, and some codecs work with ArcGIS better than others.

Finally, you may have to produce a video several times before it comes out as expected.  Be sure to watch for missing time points, as this frequently happens.  Fixing the video length to a specific play duration per time point (one-half second or one second) helps you watch for these missing time points.

The following example is a 5-second video that displays employment in the textiles industry in North Carolina from 2000 through 2009.  Note that declining employment is signified by colors that change from dark to light.

Where There’s Smoke …

A team of Duke undergraduates participating in the Global Health Capstone course was awarded the “Outstanding Capstone Research Project” for their examination of state and congressional district characteristics that might influence the outcome of legislative efforts to raise cigarette excise taxes in North Carolina, South Carolina, and Mississippi.  Sarah Chapin and Gregory Morrison used GIS mapping tools in the Library’s Data & GIS Services Department to illuminate the relationships between county demographics and state legislators’ votes for or against cigarette tax hikes. Brian Clement, Alexa Monroy, and Katherine Roemer were other members of the research group.  Congratulations!

Regional Focus
The recent cigarette excise tax increases Mississippi (2009), North Carolina (2009), and South Carolina (2010) served as case studies from which to draw components of successful strategies to develop a regional legislative toolkit for those wishing to increase cigarette excise taxes in the Southeast.  In all of these states, the tax increase was controversial. The Southeast in general is tax averse, which presents a systemic challenge to those who advocate raising taxes on cigarettes.

Senate Votes & Poverty by CountyThe researchers examined state characteristics which might influence the outcome of efforts to raise excise taxes, such as coalitions for and against proposed increases, the facts each side brought to bear and the nature of the discourse mobilized by different groups, the economic impact in each state of both smoking and the proposed excise taxes, and local political realities. The students restricted the area of interest to the Southeast because this region has a shared history and, consequently, similar challenges when it comes to race, poverty, and rural populations. They are also, broadly speaking, politically similar and have had a similar experience with both tobacco use and government regulation.

This multi-disciplinary analysis provides a reference point for state legislators or interest groups wishing to pass cigarette tax increases.  The deliverable provided a model of past voting trends, suggestions for framing political dimensions of the issue, and strategies to overcome opposition in state legislatures.

Comparing Legislative Districts and County Data
Senate Votes & Party AffiliationThe bulk of the research involved mapping the political landscape surrounding cigarette tax legislation.  In doing so, researchers looked at voting records, interest group politics, campaigns, and state ideology. Broadly, the research entailed charting the electoral geography by overlaying state house and senate districts with county-level data.  Districts were coded based on voting history, party affiliation, smoking rates, and constituent demographics.  State legislature websites were used to find representatives’ voting histories, allowing the researchers to match legislators by county when constructing a GIS dataset.  County party affiliations are available through the state board of elections.  Finally, county demographics came from the 2010 Census data.

Senate Votes & Percent Black by County

Overcoming Ideology
Besides using GIS mapping to illustrate these relationships, the researchers analyzed the involvement of major interest groups, specifically, lobbying expenditures and campaign contributions to map the involvement of both pro- and anti-tobacco interest groups.  Additionally, they examined the impact of state ideology on the framing of political dimensions, looking at editorials, opinion pieces, newspapers, and committee markups, as well as interviews (both previous interviews and ones they conducted) with state legislators and interest groups.  Overcoming state ideology, both political and social, is a major factor in passing cigarette excise tax legislation, especially in a region with such dominant tobacco influence.

Again, the purpose of the research is not merely to understand the political landscapes surrounding the passage of cigarette tax bills, but to apply these findings to the creation of a legislative toolbox for representatives or interests groups concerned with pushing similar legislation.

SimplyMap! – Census and business data made easier

Online mapping and data access has become even easier with the launch of SimplyMap 2.0.  A long time favorite of Economics and Public Policy courses (and faculty) at Duke, this program provides a straight forward interface for web-based mapping and data extraction application that lets users create thematic maps and reports using US census, business, and marketing data.

Screenshot
SimplyMap 2.0 map interface

Version 2.0 includes improvements designed to make it easier to find and analyze data and create professional looking GIS-style thematic maps.

Significant changes include:

  • A new multi-tab interface to allow you to easily switch between your projects
  • Interactive wizards to guide you through making maps and reports
  • Can choose to automatically select the geographic unit displayed on a map based on the zoom level
  • Easier searching and browsing to choose data variables
  • Assign keyword tags to organize your maps and reports
  • Share your work with other users of SimplyMap (send a URL that lets them open a copy of your map or report)
  • Data filters (greater than, less than, etc.) can now be applied to both maps and reports
  • More export options: Data: Excel, DBF, CSV;  Maps: GIF, PDF, Shapefiles (boundaries only, no attributes)
  • Faster performance

Give SimplyMap 2.0 a try and let us know what you think.  Support is always available in Perkins Data and GIS.

Policy Paradox: Mapping Residential Restrictions

Do residential restrictions placed on convicted sex offenders serve to protect the public?  Duke Economics Ph.D. candidate Songman Kang, has been using the analytical capabilities of geographic information software to help determine the extent to which the restrictions affect residential locations of sex offenders: computing the area covered by a restriction and determining which offenders had to relocate due to a restriction.

According to Kang, the residential restrictions are designed to reduce recidivism among sex offenders and prevent their presence near places where children regularly congregate.  Neither of these claims has been found consistent with empirical evidence though, and it is unclear whether the restrictions have been successful in reducing the rates of repeat sex offenses.  On the other hand, the restrictions severely limit residential location choices, and may force offenders to relocate away from employment opportunities and supportive networks of family and friends.  As a result of the deteriorated economic conditions, the offenders who had to relocate may become more likely to commit non-sex offenses.

The following maps illustrate some of the restricted zones in Miami and in the Triangle area of North Carolina studied by Mr. Kang.

Figure 1: Residential Restricted Zones in Miami

Figure 2: Triangle Restricted Residences