Showing posts with label STATA. Show all posts
Showing posts with label STATA. Show all posts

Wednesday, March 26, 2008

An Ode to Hypothesis Testing

I call upon Stata
To help with the data.
Now what do I type
To get this thing right?

I punch in the numbers
And check the commands;
The computer screen freezes
And ignores my demands.

The room grows dark,
My head starts to spin;
The nightmare continues
As I start all over again!

See the entire poem by Donna Windish

Friday, March 21, 2008

Statistics Books at IMF-WorldBank

Among the top 20 titles at the World Bank-IMF, include the following three statistics books;

An Introduction to Modern Econometrics Using Stata
Christopher F. Baum

Introductory Econometrics: A Modern Approach
Jeffrey Wooldridge

A Handbook of Statistical Analyses Using Stata
Sophia Rabe-Hesketh and Brian Everitt


Other authors in the top twenty include Mankiw, Rodrik, Krugman, Paul Collier, Easterly, Greenspan, and Richard Bookstaber.

Advice to E-Views; You need to do a little bit more marketing.

Wednesday, March 12, 2008

Fun with STATA

From Heavy Lifting- On Congressional Salaries

With the outlier thrown out, the monthly increases in per-capita income is slightly larger than monthly increases in Congressional salaries, which is also reflected in the annualized increases. Congress is increasing their wages at a slower annual growth rate than that of per-capita income, which explains why the relative salary level has been falling so much over time.

I think I want to interpret this as a good thing. The fact that Congress increases their wages is often held to be a bit odoriferous, but the reality is that Congress has not stolen as much as they might have. I assume Congress increases their wages as much as they feasibly can politically, that is, the electorate hold the Congressional pay raises in check by the threat of voting the "thieves" out.

An interesting dissertation would be estimating the elasticity of candidate supply - looking at the change in actual candidates for Congress (those running in primaries) after a change in nominal and real salaries.

Saturday, January 12, 2008

Panel Data Analysis

An little explainer on panel regression at Columbia Stats Blog

My reply (beyond that it's funny to see a reference to an economics paper by someone named "Dollar") is that it's a good idea to model panel data using three error terms, at the unit, time, and unit*time levels. You can (and should) also have predictors at all three levels, as appropriate. Also I'm not a fan of the overloaded term "fixed effects," but that's another story


Related;
A Primer for Panel Data Analysis

14.32 Econometrics (MIT OpenCourseWare)

Macro Aid Effectiveness Research: A Guide for the Perplexed

Through the Looking-Glass, and What OLS Found There: On Growth, Foreign Aid, and Reverse Causality

Friday, December 14, 2007

From World Bank Research

World Bank Research E-Newsletter

-World Development Report 2009
Economic activity becomes increasingly concentrated with development. As this happens, substantial disparities in welfare can emerge between rural and urban areas, between leading and lagging regions within countries and, perhaps most dramatically, between countries in different parts of the world. The objective of the World Development Report (WDR) 2009 "Seeing Development in 3D" is to identify and understand the interactions between economic geography, growth, and living standards, and to draw the implications of these interactions for policy. WDR 2009 charts the changes in the three spatial dimensions of economic activity and household welfare: rising density, falling distance and persisting division. The WDR will highlight the dimensions and significance of spatial forces that shape economic development; and recommend policies to facilitate the spatial transformations necessary to sustain economic growth, reduce disparities in welfare, and reduce poverty. The report aims to reframe three important policy debates: on urbanization in developing countries; on territorial development policies; and on the pros and cons of regional integration.


Analyzing health equity using household survey data
Equity has long been considered an important goal in the health sector. Yet inequalities persist between poor people and those who are better off, with the poor tending to suffer higher rates of mortality. They also often tend to use health services less, despite having higher levels of need. A new book entitled “Analyzing Health Equity Using Household Survey Data” by O’Donnell, Doorslaer, Wagstaff, and Lindelow provides rigorous analytic techniques for both measurement and analysis of such inequalities, with a view to stimulating health equity research that can support the design and evaluation of health policies and programs. The book offers researchers and analysts a step-by-step practical guide to key analytic techniques in health equity analysis, with examples and computer code, mostly for the Stata program.

Saturday, November 24, 2007

Rules for being a successful empirical economist

Conversations With History - Richard B. Freeman

1. You’ve to like numbers

2. You’ve to listen to people [from the real world, businessmen, labor unions, etc] and get out of office and talk to people

3. Ability to abstract … and build mathematical models.

Berkely need to modernize their style of interviews- and open up for questions in advance for interviewers.

HT: New Economist

Related;
Video about Richard Freeman

"Feminization of Work in the U SA: A New Era for (Man)kind?"

"White Hats or Don Quixotes? Human Rights Vigilantes in the Global Economy"

"What Role for Labor Standards in the Global Economy"

"Working for Nothing: The Supply of Volunteer Labor"
"Does Inequality in Skills Explain Inequality of Earnings Across Countries"

A Fairer Sort of Harvard;
Last spring protesting students at Harvard demanded that the university pay all of its workers at least a living wage and that it stop contracting with outside companies for low-wage work. Faced with unflattering national publicity, Harvard set up a committee of faculty members, administrators, students and employees to look at the situation of its low-wage workers and make recommendations. The protests had raised a fundamental question: Does a major employer like Harvard have a responsibility to be a good employer to workers, or should it seek to get by with the least it can in the labor market?

The last time Harvard faced this question was in December 1929, when the State of Massachusetts ordered it to pay female building cleaners the state minimum wage of 37 cents an hour, 2 cents above what the university had been paying. Choosing to get by with the least it could, Harvard fired the cleaning women and directed other workers to do their jobs.

This time Harvard is going in a very different direction. Its committee's report, which came out this week, documents the substantial decline in the real wages of custodians and other low-paid employees. It describes how the threat that work would be contracted out has put pressure on unionized workers to accede to low pay. If the committee's recommendations are adopted next month by Harvard's president, Lawrence Summers -- as is likely, given his positive reaction to the report -- the university will be committed to treating its lower-wage workers as full members of the university community and to giving them decent wages, respect for their work and opportunities for further training.

The committee also recommends pay increases that would take the lowest wages to between $10.83 and $11.30 an hour from $8.50. These rates are based on what the committee felt collective bargaining would have produced absent the threat of outsourcing to lower-wage contractors. The recommended pay levels exceed the levels in the living wage law that the City of Cambridge applies to municipal employees and city contractors.

Contrary to the fears of some alumni, students and administrators, the committee did not cave in to student demands for setting low-level pay according to a living wage formula, about which there could be considerable controversy, or to end outsourcing. Though it recommends a wage floor for the present, the heart of its proposal is something else: a parity wage and benefits policy for contractors, based on collective bargaining. Companies under contract to provide workers at Harvard would have to pay wages equivalent to the wages for Harvard's unionized employees doing comparable work. The Harvard unions would be bargaining, in effect, for minimum wages and benefits for the employees of contractors as well as for themselves, even though those outside workers might not be union members.


Richard Freeman awarded IZA Prize 2007

DATA SETS:
Public Sector Collective Bargaining Law Data Set
Occupational Wages around the World (OWW) Database
Worker Representation and Participation Survey (WRPS)

Tuesday, November 20, 2007

Trade paper of the Day

Export Diversification; What’s behind the Hump? by Céline Carrère, Vanessa Strauss-Kahn, and Olivier Cadot

The paper explores the evolution of export diversification patterns along the economic development path. Using a large database with 159 countries over 17 years at the HS6 level of disaggregation (4’998 product lines) we look for action at the “intensive” and “extensive” margins (diversification of export values among active product lines and by addition of new product lines respectively) using various export concentration indices and the number of active export lines. We also look at new product introduction as an indicator of “export-entrepreneurship”. We find a hump-shaped pattern of export diversification similar to what Imbs and Wacziarg (2003) found for production and employment. Low and Middle income countries diversify mostly along the extensive margin whereas high income countries diversify along the intensive margin and ultimately re-concentrate their exports towards fewer products. Such hump-shaped pattern is consistent with the conjecture that countries travel across diversification cones as discussed in Schott (2003, 2004) and Xiang (2007).


Thanks to Rodrik

Of the authors Céline Carrère lectures in the World Bank Graduate Scholarship Program (Professional Master in Development economics) at CERDI and Olivier Cadot has also done work for the World Bank. Does it mean anything? I don't know.

Saturday, November 17, 2007

Debate of the Day

Does Death Penalty Save Lives?;
The death penalty “is applied so rarely that the number of homicides it can plausibly have caused or deterred cannot reliably be disentangled from the large year-to-year changes in the homicide rate caused by other factors,” John J. Donohue III, a law professor at Yale with a doctorate in economics, and Justin Wolfers, an economist at the University of Pennsylvania, wrote in the Stanford Law Review in 2005. “The existing evidence for deterrence,” they concluded, “is surprisingly fragile.”

Gary Becker, who won the Nobel Prize in economics in 1992 and has followed the debate, said the current empirical evidence was “certainly not decisive” because “we just don’t get enough variation to be confident we have isolated a deterrent effect.”

But, Mr. Becker added, “the evidence of a variety of types — not simply the quantitative evidence — has been enough to convince me that capital punishment does deter and is worth using for the worst sorts of offenses.”

Capital Punishment: More Con from Econometrics


Datasets on the issue;
Donohue and Wolfers (2005)

Related Papers;
Uses and Abuses of Empirical Evidence in the Death Penalty Debate, by John J. Donohue and Justin Wolfers (Stanford Law Review, December 2005)
Is Capital Punishment Morally Required? Acts, Omissions and Life-Life Trade-offs, by Cass R. Sunstein and Adrian Vermuele (Stanford Law Review, December 2005)
Does Capital Punishment Have a Deterrent Effect? New Evidence From Post-moratorium Panel Data, by Hashem Dezhbaksh, Paul H. Rubin and Joanna M. Shepherd (American Law and Economics Review 2003)
Deterrence Versus Brutalization: Capital Punsishment's Differing Impacts Among States, by Joanna Shepherd (Michigan Law Review, November 2005)
Prison Conditions, Capital Punishment and Deterrence, by Lawrence Katz, Steven D. Levitt and Ellen Shustorovich (American Law and Economics Review 2003)
Getting Off Death Row: Commuted Sentences and the Deterrent Effect of Capital Punishment, by H. Naci Mocan and R. Kaj Gittings (Journal of Law and Economics, October 2003)
Capital Punishment and Capital Murder: Market Share and the Deterrent Effects of the Death Penalty, by Jeffrey Fagan, Franklin E. Zimring and Amanda Geller (Texas Law Review, June 2006)
Sociological Realities and Econometric Illusions

This and That

Breastfeeding does NOT cause higher IQ

Are Aggregate Terrorism Acts Random?

In DNA Era, New Worries About Prejudice

What makes us happier? Income or wealth?


Why We Trade;

Coase's Toilet

Is there Serial Correlation in World of Warcraft? Should There Be?


A Freakonomics Contest: The Coase Theorem Online

Thursday, November 15, 2007

The Bond Market and Iraq

PRESIDENT BUSH’S surge of troops in Iraq has done little to resolve the political debate over the Iraq war. But global financial markets have been monitoring the war for months, and with remarkable consistency, they have concluded that the long-term prospects for a stable Iraq are very bleak.

That is the picture that emerges from a study by Michael Greenstone, an economics professor at the Massachusetts Institute of Technology, titled, “Is the ‘Surge’ Working? Some New Facts,” which has been circulating as a working paper in academic circles.

Professor Greenstone started by reviewing basic statistics on the Iraqi economy and on the battle for security within Iraq since February. This data provided a murky view, at best.

He found that civilian deaths in Iraq had fallen substantially in recent months. At the same time, though, he found little change in the rate of American and Iraqi military fatalities, while the recruitment of members of the new Iraqi security forces declined sharply. On the industrial side, crude oil production fell as much as 20 percent, but there was evidence of a slight improvement in the availability of electricity.

Sifting through these facts was time-consuming, but it provided little real guidance on the state of affairs in Iraq.

It wasn’t until Professor Greenstone began examining the financial markets’ pricing of Iraqi government debt that he had his eureka moment. It was immediately clear that the bond market — which, historically, has often been an early indicator of the demise of a political system — was pessimistic about the Iraqi government’s chances for survival.

First, some background on the Iraqi bonds. After the United States helped Iraq renegotiate its leftover debt from the Saddam Hussein era, the Iraqi government issued about $3 billion of new bonds in January 2006. These dollar-denominated bonds pay 2.9 percent twice a year and mature in 2028, paying the face value of $100.

To say the least, the market for these bonds is not robust: as of last week, a bond with a face value of $100 was trading at around $60. Professor Greenstone calculated that, from the markets’ standpoint, the implied default risk over the life of the bond was about 80 percent.

The important point is that anyone who owns one of these Iraqi bonds has to decide each day whether the Iraqi government is likely to be functional enough to make its debt payments, or will default along the way. All else being equal, if the surge policy is effective, it ought to be raising the market price of these bonds.

Bondholders “aren’t politically motivated,” Professor Greenstone said. “They don’t have to rationalize their previous statements or justify their votes from years past. All they care about is whether there will be a functioning Iraq in the future such that they will receive their payments.” At a certain price, most securities will find a buyer, and there are still buyers for Iraqi bonds. But the price they are willing to pay is very low.

Of course, it’s worth asking whether bond traders know anything more about Iraq than the pundits do. It’s impossible to say with certainty, but the collective wisdom of financial markets has proved remarkably adept at evaluating events and predicting the future, even the turning points of war.

During the American Civil War, for example, when Confederate forces lost at Gettysburg, Confederate cotton bonds traded in England dropped by about 14 percent. During World War II, German government bonds fell 7 percent when the Russians started their counterattack at Stalingrad in 1942, and French government bonds rose 16 percent after the Allied invasion at Normandy in 1944. Many such examples of the prescience of financial markets have been documented by economic historians.

Comparing the yields on Iraqi bonds from the start of the surge in February to late August, Professor Greenstone calculated that the bondholders implicitly raised the chances of an Iraqi bond default by 40 percent. Over that period, Iraqi bond prices fell about 14 percent — as much as the Confederate cotton bonds fell after the battle of Gettysburg.

Professor Greenstone is quick to acknowledge that the bond evidence does not necessarily imply anything about the surge as a military tactic. The American troop buildup might be giving the Iraqi government a reprieve, but over the long term, most bondholders seem to have concluded, it’s a lost cause.

In an interview, Professor Greenstone used a medical analogy to describe the possibility that the surge might be defined as successful, but would still result in the demise of the Iraqi government. “It might be a heart surgery that failed so the patient is dying,” he said, “or a heart surgery that succeeded but during the operation they found a deadly liver cancer so the patient is dying. Either way, though, the guy is dying.”

HE also knows that the late-summer turmoil in global bond markets because of the subprime housing problems and the ensuing credit crisis could complicate his analysis. But he points to two important pieces of evidence suggesting that the overall problems in the credit markets did not cause the Iraqi bond meltdown.

First, the Iraqi bonds were already falling before the subprime crisis began, and at no point did they ever rise above their pre-surge levels. So even if you do not attribute the entire 40 percent increase in the chance of default to the surge, there is certainly no evidence that it reduced the odds.

Second, and more important, while the bond-market turmoil affected all kinds of debt, the plunge in the value of Iraqi bonds has been much worse. Professor Greenstone’s data shows that Iraqi bonds have fallen not just in comparison with safe United States Treasuries but also when compared with those of nearby Qatar, and with a broad range of risky emerging-market bonds.

In the market, people vote with their money, and the vote is not going well for the new Iraq. Politicians in the United States may be divided over whether the surge has raised the chances of political reconciliation in Iraq. But the bond market has already made its message clear: don’t bet on it.

-In the Bond Market, a Bleak Prognosis for Iraq

Related: Programs and Data Used to Produce the paper

Sunday, November 4, 2007

How many databases does it take to measure poverty?

The MDG Monitor is designed as a one-stop-shop for information on progress towards the Millennium Development Goals (MDGs), globally and at the country level. It is intended as a tool for policymakers, development practitioners, journalists, students and others interested in learning about the Goals and tracking progress toward them.

Globalis-is an interactive world atlas where you decide what is to be displayed on the map. Globalis aims to create an understanding for similarities and differences in human societies, as well as how we influence life on the planet.

geo.worldbank.org

Online Atlas of MDGs

ADePT MAPS

Poverty Analysis Toolkit
Michael Lokshin and Martin Ravallion are developing a set of Stata ado programs to make accessible various methodologies for dynamic poverty analysis.

As of today, the Poverty Analysis Toolkit includes four programs for dynamic poverty analysis. The first two programs GIDECOMPOSITION and SEDECOMPOSITION perform growth-inequality and sectoral decompositions of poverty between two periods of time. Programs GICURVE and POV_ROBUST produce graphs. The first program produces the growth incidence curve and the second program produces various graphs for stochastic dominance analysis. The programs are accompanied by the help files with a detailed explanation of the programs’ syntax and applications. The sample program “Dynamic_poverty_example.do” illustrates the use of the program on a fictitious dataset

Poverty Mapping Program
The Poverty and Inequality Mapper Module is a SAS program that combines survey and census data to generate poverty and inequality estimates with standard errors at low levels of aggregation. The program generates such profiles for Atkinson inequality measures, Generalized Entropy class inequality indices, the Gini index, and Foster-Greer-Thorbecke (FGT) poverty measures. Use of the programs requires basic familiarity with SAS.

Mapping the Majority compiles relevant indicators on economic participation and the living conditions in Latin America and the Caribbean

EQxIS offers estimations of social indicators for monitoring the Millennium Development Goals (MDGs) based on microdata from household surveys

DataGob is a user-friendly interface for accessing most of the publicly available indicators related to governance

DATAINTAL is a system of trade statistics of countries in the Americas developed by the Institute for the Integration of Latin America (INTAL)

International Development Statistics (IDS) online


PovSTAT -an Excel based program that produces forecasts that vary by level of complexity depending on the availability of reliable data for the post survey period and on the extent to which various factors influencing poverty levels are incorporated. You will find a chapter describing the tool, as well as a file with the program itself

SimSIP Poverty — an Excel based program that enables the user to make poverty and inequality comparisons between sectors and over time.

Friday, November 2, 2007

Basic Econometrics

Some lecture notes on Introduction to Econometrics by James H. Stock, Harvard University and Mark W. Watson, Princeton University

Related on the book;
Practice Quizzes
Datasets for Replicating Empirical Results
STATA Tutorial
STATA review;
Introduction to Econometrics, 2nd Edition, by James H. Stock and Mark W. Watson is a real page-turner. By ingeniously introducing statistical methods as a means of answering four interesting empirical questions, the authors have written a rigorous text that makes you want to keep reading to find out how the story ends. The authors use the excitement generated by the questions as a springboard for an excellent introduction to estimation, inference, and interpretation in econometrics.

The text makes advanced statistical concepts easily understandable. For instance, the current econometric approach to analyzing linear models combines assumptions on the conditional moments of random variables and large-sample theory to derive estimators and their properties. This textbook provides an accessible introduction to this technique and its application to cross-sectional, panel-data, and time-series regression.

The coverage and level of this text make it an excellent choice for undergraduate study or as a supplement to advanced courses.

The second edition includes many improvements that make the book more accessible to students, as well as some additional topics to excite those who use the text as a supplement. The expansion of the ordinary least-squares introduction from two to four chapters is the most notable increase in accessibility. The brief introduction to the current best practices for dealing with weak instruments is the most exciting new topic.

Answer a question and earn money?

I wonder how Google Answers work? I came across the following recently;


How to compute Newey West Standard Errors
List Price: $100.00
I'm computing the past performance of stock market trading stategies.
A common trading rule is momentum, which selects stocks on the basis
of their past returns (high past returns = buy; low past returns =
sell). I rely on a short holding period of 1 month only, so I
re-balance the portfolio at the end of each month. This generates
high turnover, but lends itself to statistical analysis. Since there
are no overlapping holding periods, traditional standard errors are
fine. But I want to extend the holding period (say for 3 months)
which means the portfolios overlapping. Researchers compute
Newey-West standard errors to account for this, but I haven't yet
found an explanation of the methodology that I can understand. One
more thing - I don't have access to stats/econometrics software, only
Excel. So how do I calculate Newey-West standard errors in Excel?

Discuss

"Dollar weakness has boosted the price of dollar-denominated commodities and helped oil to surge by more than a third since the middle of August"


For Background read, Does Dollar Weakness 'Cause' High Oil Prices?

Learning Objective: serial correlation, Newey-West