Sunday, June 26, 2011

A beautiful day!

No pictures or equations---just a huge sigh of relief. I finally managed to export data from my agent-based model and get it into Stata statistics software for analysis. The thing that was holding me up was that the attribute data for the 604 parishes in the SW of England is held in polygons....and when those polygons are imported into the Netlogo agent-based model, some of the data "disappears" or reappears in a corrupted form, which is even worse. I converted the polygons to points and that does the trick.

So---the agent - based model calculates the closest market-town for each farmer, and tells the farmer its population. Then exports that data so I can work out the effect of distance and population. Sounds simple doesn't it...

Anyway, I found that we have an interesting "gravity" model here, where the gravity equals the population divided by the square root of the distance. This declining effect makes sense: the average cost per unit distance was higher for shorter distances because of the fixed costs of loading and unloading all those sacks of grain.

It is days like these that I live for.

Friday, April 8, 2011

The effect of soil type on rent elasticity

The railways paper is moving along. We now have 23 estates in the dataset. We have shown that rent rose with the amount of track within a 40km radius of the estate. We have also shown that the year when the railway track near the estate was connected to London was statistically highly significant. This implies that the London market was really dominant. One result which is still a bit puzzling and which we are working on is the differences in elasticity. By elasticity, we mean the percentage change in rent caused by a percentage change in amount of track. The elasticities are really quite different....Holkham Hall for example is twice that of the smallest. This is interesting! The rate of increase may show us something about the relationship between landowner and tenant.

One possible reason is the production type of the farm. We know that dairy and meat prices rose more than wheat farming during the 1832-1869 time period. Folks were getting richer and so could afford a better diet. So farms which were on soil suitable for dairying might be more profitable and so the landowner could charge a higher rent. The map shows the estates, with the green circle proportional to the elasticity. Red soil is good for dairying and light blue for wheat. The seems to be a pattern: smaller elasticities on wheat soil. BUT look at the circle I've drawn around Leconfield and Emmanuel Hospital. They seem to be on the same (red) soil but the elasticities are quite different. Leconfield is the little circle just to the left of the larger Emmanuel circle. Why? Perhaps because Emmanuel Hospital is institutionally owned. Or the owner of Leconfield wasn't a tough businessman? More work to do.

Thursday, February 24, 2011

Railways and rent

So far we have twelve estates with kilometres of railway track counted up. In the regression we get very satisfactory results, which go to show that railway construction did indeed cut costs for farmers---but those savings were transferred to their landlords in the form of higher rents. However, in my readings I am finding some interesting differences between landlords. Some landlords had political ambitions and wished to be able to direct the votes of their tenants. As a result they under-rented...so the next research step is to try to find out which of our landlords had political ambitions, and then include this variable as a dummy variable. Then we can see the effect of politics on rent.

Wednesday, February 16, 2011

Coastal counties got cheaper wheat

I coded the counties with a dummy variable (0 = interior, 1 = coastal) so that I could test whether there was
any difference in the 'mark-up' according to whether a county importing wheat was on the coast or not.  A lot of wheat was shipped by coastal routes because that mode was often easier than using a horse and cart. I want to test for that. So
was the regression equation I used. On the left-hand side we have the dependent variable, the difference in wheat price between any one county and the source of the wheat, which was either Cambridgeshire or Lincolnshire. On the right-hand side is the intercept, then the coefficient for distance between the counties; the coefficient for amount of surplus or deficit in wheat for that county; and finally the dummy variable for 'coastal'.

As you can see from the output below, all the explanatory variables are statistically significant at the 95% level (p < 0.05). The coefficient for distance is positive, meaning that the further away, the higher the price difference. In effect this is giving us the transport rate for hauling wheat. It should be positive, makes sense doesn't it? Surplus/deficit has a negative sign. That means that the more surplus the county has, the smaller the price difference. Again, that makes sense. Why would a county pay more for wheat if they already have lots of it? The coastal dummy is the most interesting. It has a negative sign. So if you lived in a county on the coast, you paid less for wheat "other things being equal". We are 'controlling for" distance and surplus. So if we happened to have two counties, both the same with respect to distance and surplus, the one on the coast would pay less for wheat. Because they got more of their wheat through coastal shipping would seem to be a reasonable explanation! Can you see the power of these techniques? We can learn a huge amount just with a few bits of data scraped off the floor.

Tuesday, February 15, 2011

Difference in wheat market prices by distance

I came across a really special dataset that has wheat (and other grain) prices by the week from 1760 to 1820 for every one of the 40+ English counties. Think of the work some dedicated soul did in copying out all those numbers! I used this dataset in a recent post to show that wheat prices varied quite a lot, especially by 'demand', ie whether the destination market was in surplus or deficit.
Malcolm's map showing wheat origins

Malcolm has kindly provided me with a set of measurments from the two major wheat producing counties (Cambridgeshire and Lincolnshire) to each of the counties. See Malcolm's map on the right. We know the price difference between the wheat exporting county and county of importation; the distance between the two; the mean elevation of the journey, and the standard deviation of the elevation of the journey. The last measurement is to proxy the 'roughness' of the journey. I figured that greater changes in the standard deviation would be more expensive for the horse and cart operators of that time, and so they would increase the prices accordingly. We only have about 35 observations, but the results are interesting. After some experimentation, I found that regressing the natural log of the price difference against the natural log of the distance produced an acceptable result (p=0.02). The scatter plot of log price difference on the x axis with log distance on the y axis is shown here, together with a trend line of predicted values.

Regression of log price diff against log distance
If we use logs in the regression, then we also have a measure of the elasticity. The coefficient from the regression is 0.47, which means that a one percent increase in distance increases the price difference by 0.47 per cent. (See how useful logs and elasticities are!). This is quite a lot, and more than I had expected. The other measurements, such as roughness of the journey, didn't seem to matter as much. Now I am going to move on to 'control' for other variables, such as whether or not the county was industrial/agricultural, or on the coast. Why should coastal be interesting? Quite a lot of wheat was shipped by coastal vessels, probably a lot cheaper than by land. More later.

Thursday, February 10, 2011

Wheat price differentials surplus/deficit areas

Earlier I calculated the 'wheat flow' from counties where they grew more than they ate to counties which grew less wheat and more livestock. Recently I found extraordinarily detailed data which lists the wheat price by county only by year but by week within the year! I thought that the difference in wheat price between counties might be explicable just by some function of the distance between them. Turns out not to be so simple as that, but more interesting. The difference between counties is much more pronounced when there is a bad harvest. When the harvest is bad, the wheat exporting counties really take advantage and the prices in the importing counties surge. Sounds like the sort of behaviour we see over tickets to hockey games, doesn't it! So I worked out which counties had the most surplus (Lincolnshire and Cambridgeshire) and which had the biggest deficits (Lancashire and Middlesex). Then I subtracted Lincolnshire from Cambridgeshire...because if my theory os correct, the gap between the two surplus counties shouldn't change much. Then between the biggest surplus county (Lincolnshire) and the highest deficit county (Lancashire). If things are going my way, then the difference between these two should be accentuated in years of bad harvests. Sure enough, the red line really jumps in years when we know from old books that the harvest was poor. The years 1816/17 are a good example of this. 1800 looks dramatic, but we were at war with the French then (remember Napoleon?) and so there were all sorts of other factors involved. These results have a modern-day significance in terms of food security. Especially now as the world looks like it is running out of food. The events in Eqypt were basically triggered by high food prices. Learn from history! Next step is to try to quantify the effect. This is fun!

Tuesday, February 8, 2011

Relationship between flow and price in wheat

Negative relationship between surplus/deficit
In my last post I presented a map showing counties which were in surplus or deficit. I am convinced there is a relationship between price and surplus or deficit, with the price difference between counties being due to transport costs. I regressed (there you are again!) the flow against the wheat price, and found a strong statistical relationship (p=0.007). Here is a scatterplot which admittedly looks---well, scattered! But you can tell by eye that the relationship is negative. The greater the deficit, shown by having a negative sign on the y axis, the more you pay for wheat, price of wheat on the x axis. Now I need to try somehow to build a mathematical relationship between flow, distances travelled, and wheat prices. If I can find this relationship, then I can set it to zero on one side of the equation to find the 'limit of cultivation'. If that limit happens to be the border between Devon and Somerset----problem solved and game over!