Skip to content

Latest commit

 

History

History
480 lines (328 loc) · 13.2 KB

File metadata and controls

480 lines (328 loc) · 13.2 KB

Demand for paper and paperboard products in the European Union

Load data

FAOSTAT is the source of forest products data and World Bank is the source of GDP, deflator and exchange rate data.

source("code/func.r")
print(load("enddata/EU27 paper products demand.rdata"))
## [1] "paperProducts" "ppagg"         "pptrade"       "wb"
pp = paperProducts # Give a shorter name to the data frame

Consumption, Production and Trade Volumes

In the following file, we explore a data table containing paper and paperboard consumption data for 27 countries from 1961 to 2012.
In 2012, the overall EU consumption, production and trade in million Tons per item was:

##                           Item Consumption Production Net_Trade Import Export
## 205 Total Paper and Paperboard          80         92        12     49     61
## 206                  Newsprint           7          8         0      5      5
## 207 Printing and Writing Paper          24         32         8     20     27
## 208 Other Paper and Paperboard          49         53         4     24     28
# Consumption, production, trade and net trade at the European Level
ggplot(data=subset(ppagg, !Element%in%c("Import_Value", "Export_Value","Price"))) +  
    geom_line(aes(x=Year, y=Value/1e6, colour=Item),size=1) +
    facet_wrap(~Element) +
    ylab("Million metric Ton") + theme_bw()

plot of chunk consumptionTotalEU

 

Net trade is slightly in favor of exports for most products except for newsprint. From bilateral trade statistics (not shown here), we know that most of the trade is happening inside the European Union.

Consumption at the country level

Consumption by country

Apparent consumption of Total paper and paperboard by country

ggplot(data=subset(pp, Item=="Total Paper and Paperboard"))+
    geom_line(aes(x=Year, y=Consumption/1e+06, colour=Item), size=1) + 
    facet_wrap(~Country, scales = "free_y") +
    xlab("Year") + ylab("Million metric Ton") + 
    theme_bw() +  theme(legend.position="bottom")

plot of chunk consumptionbyCountry

The largest consumers of paper and paperboard products are France, Germany, Italy, Spain, United Kingdom.

Apparent consumption of graphics paper and other paper and paperboard by country

# Create a new table with graphics papers following Lauri's comments
ppgraph = subset(pp, Item %in% c("Newsprint","Printing and Writing Paper"))
ppgraph = aggregate(ppgraph[c("Consumption", "Net_Trade")],
                     ppgraph[c("Year", "Country")], sum)
ppgraph$Item = "Graphics Paper"
ppgraph = rbind(ppgraph, 
                subset(pp, Item == "Other Paper and Paperboard", 
                       c(Year, Country, Item, Consumption, Net_Trade)))

ggplot(data=ppgraph)+
    geom_line(aes(x=Year, y=Consumption/1e+06, colour=Item), size=1) + 
    facet_wrap(~Country, scales = "free_y") +
    xlab("Year") + ylab("Million metric Ton") + 
# scale_colour_manual(values = c("Blue", "Green")) +
    theme_bw() +  theme(legend.position="bottom") 

plot of chunk graphAndOtherconsumptionbyCountry

Heat map of consumption per capita

Consumption of total paper and paperboard in $$m^3$$ per habitant.

# add population data
pp = merge(pp, wb[c("Country","Population")])
ggplot(data=subset(pp, Item=="Total Paper and Paperboard"), aes(Year, Country)) +
    geom_tile(aes(fill = 1000*Consumption/Population), colour = "white") +
    scale_fill_gradient(low = "white", high = "steelblue")

plot of chunk heatmap

ggplot(data=pp, aes(Year, Country)) +
    geom_tile(aes(fill = 1000*Consumption/Population), colour = "white") +
    scale_fill_gradient(low = "white", high = "steelblue") + facet_wrap(~Item)

plot of chunk heatmap

Consumption and Net Trade by Country

Apparent consumption and Net Trade of Total paper and paperboard by country

ggplot(data=subset(pp, Item=="Total Paper and Paperboard"))+
    geom_line(aes(x=Year, y=Consumption/1e+06, colour=Item, linetype = "Consumption"), 
              size=1) + 
    geom_line(aes(x=Year, y=Net_Trade/1e+06, colour=Item, linetype = "Net trade"),
              size=1) + 
    facet_wrap(~Country, scales = "free_y") +
    xlab("Year") + ylab("Million metric Ton") + 
    theme_bw() +  theme(legend.position="bottom")

plot of chunk consumptionNetTradebyCountry

Large producing countries such as Finland and Sweden produce over 10 million tons of paper products per year and export most of their production. Germany is the largest consumer with over 20 million tons of paper products consumed annually, Germany's net trade is slightly positive. France is the second largest consumer and is slightly importing. The United Kingdom also consumes around 10 million tons annually and is importing more than half of its production.

GDP by country

# 1 plot per country
ggplot(data=wb, aes(x=Year, y=GDPconstantUSD/1e9)) +  
    geom_line(size=1) + xlab("Years") + ylab("GDP (constant) in 2010 Billion USD ") +
    theme_bw() + theme(legend.position= "none") + facet_wrap(~Country, scales = "free_y")

plot of chunk GDPbyCountry

Prices of paper and paperboard

EU prices

Average trade price of paper products in the European Union

ggplot(data=subset(ppagg, Element=="Price")) +
    geom_line(aes(x=Year, y=Value, color=Item)) +
    ylab("Price in (2010) constant USD /Metric Ton")

plot of chunk priceEU

Price has lowered since 2010, probably due to overcapacity in the market.

Prices per country

Prices are a ponderation of import and export prices as used in Chas-Amil and Buongiorno 2000. Prices are expressed in constant US dollars of 2010.

Price = (Import_Value + Export_Value)/ (Import_Quantity + Export_Quantity) / DeflUS *1000)

Countries with a particularly high price were removed from the set.

library(scales)
ggplot(data=subset(pp, !Country%in%c("Slovakia", "Malta"))) +
    geom_line(aes(x=Year, y=Price, color=Item))  + facet_wrap( ~ Country) + 
    ylab("Price in (2010) constant USD /m3") + scale_y_continuous(labels = dollar)

plot of chunk pricesByCountry

Trade prices by Country

ggplot(data=subset(pptrade, !Country%in%c("Slovakia", "Malta"))) +
    geom_line(aes(x=Year, y=Price_Trade, color=Item, linetype = Trade))+
    facet_wrap( ~ Country) + 
    ylab("Price in (2010) constant USD /m3")

plot of chunk tradePricesByCountry

Trade prices for Sweden, Germany, France and Finland

# Sweden Germany France Finland 
ggplot(data=subset(pptrade, Country%in%c("Sweden", "Germany", "France", "Finland"))) +
    geom_line(aes(x=Year, y=Price_Trade, color=Item, linetype = Trade))  + 
    facet_wrap( ~ Country) + ylab("Price in (2010) constant USD /m3")

plot of chunk tradePricesSGFF

Distribution of the estimation data for 4 important years

Cross sectional distribution of demand

Number of countries for a given demand volume in million m3

# 1980, 1990, 2000, 2010
pp4hist = subset(pp, Year%in%c(1980, 1990, 2000, 2010)&Item=="Total Paper and Paperboard")
ggplot(data=pp4hist) + geom_histogram(aes(x=Consumption/1e6), binwidth=1) + facet_wrap(~Year)

plot of chunk histdemand

Number of countries for a given demand volume in log of the volume in m3

# Consumption in log
ggplot(data=pp4hist) + geom_histogram(aes(x=log(Consumption)), binwidth=1) + facet_wrap(~Year)

plot of chunk histdemandlog

Distribution of prices

ggplot(data=pp4hist) + geom_histogram(aes(x=log(Price)), binwidth=0.1) + facet_wrap(~Year)

plot of chunk histGDPlog1

Distribution of GDP

ggplot(data=pp4hist) + geom_histogram(aes(x=log(GDPconstantUSD)), binwidth=1) + facet_wrap(~Year)

plot of chunk histGDPlog2

Plot log of the estimation data

We will estimate the model $$ log(Consumption) = \beta_0 + \beta_1 log(GDP) + \beta_2 log(Price) + \beta_3 log(Consumption_{t-1}) $$

Lets look at the relationship between log(Consumption) and log(GDP) first.

Total Paper and Paperboard

Data for 2000 and beyond in red

plot(log(Consumption) ~ log(GDPconstantUSD), data=subset(pp, Item=="Total Paper and Paperboard"))
## Warning: NaNs produced
points(log(Consumption) ~ log(GDPconstantUSD), 
     data=subset(pp, Item=="Total Paper and Paperboard"&Year>1999), col="red")

plot of chunk unnamed-chunk-2

Explore the influence of Year and Net_Trade by country

Sort countries by Net_Trade, then display a color for each country

d=data.frame(s=c(45,43))
ppc = subset(pp, Item=="Total Paper and Paperboard"&Year==2012)
ppc = ppc[order(ppc$Net_Trade),]
pp$Country = factor(pp$Country, levels= ppc$Country, ordered=TRUE)
p = ggplot(pp, aes(x=log(GDPconstantUSD), y=log(Consumption))) + facet_wrap(~Item)
p + geom_point(aes(alpha=Year, color=Country))  

plot of chunk unnamed-chunk-3

Check the ggplot shape parameter and the scale_shape_identity to improve this graph with a "+" sign for positive net trade and a "o" sign for negative net trade. Plot only Printing and Writing Paper for this graph.

p = ggplot(data=subset(pp, Item=="Printing and Writing Paper"),
           aes(x=log(GDPconstantUSD), y=log(Consumption))) + facet_wrap(~Item)
p + scale_shape_identity() +
    geom_point(aes(color=Country, shape=1 + 2*(Net_Trade>0) ))

plot of chunk unnamed-chunk-4

Total Paper and Paperboard

plot(log(Consumption) ~ log(Price), data=subset(pp, Item=="Total Paper and Paperboard"))
## Warning: NaNs produced
points(log(Consumption) ~ log(Price), 
       data=subset(pp, Item=="Total Paper and Paperboard"&Year==2012), col="red")

plot of chunk unnamed-chunk-5

All products

p = ggplot(pp,aes(x=log(Price), y=log(Consumption), alpha=Year)) + facet_wrap(~Item)
p + geom_point(aes(color=Country, alpha=Year)) 

plot of chunk unnamed-chunk-6

Countries that trade less seem to have higher prices.

Change point shapes with a "+" sign for positive net trade and a "o" sign for negative net trade. Show only Printing and writing paper for this graph.

p = ggplot(data=subset(pp, Item=="Printing and Writing Paper"),
           aes(x=log(Price), y=log(Consumption))) + facet_wrap(~Item)
p +  scale_shape_identity() + 
    geom_point(aes(color=Country, alpha=Year, shape=1 + 2*(Net_Trade>0) )) 

plot of chunk unnamed-chunk-7

Panel data models

Over the 1960 - 1992 estimation period.

EU15 = unique(wb$Country[wb$EU15==1])

# Create a column consumption at year t-1
pp = ddply(pp, .(Country,Item), mutate, 
           Consum_t_1 = c(NA,Consumption[-length(Consumption)]))
## Warning: duplicated levels in factors are deprecated
# Select same data as in the chasamil paper
chasamil = subset(pp, Year>=1969&Year<=1992&Country%in%EU15 & 
                  Country!="Ireland" & #Remove Ireland because it doesn't have GDPConstantUSD Data
                      Item=="Printing and Writing Paper", select=-Item)

# Set data as panel data
pchasamil <- plm.data(chasamil, index=c("Country","Year"))

Pooled OLS

pooling <- plm(log(Consumption) ~ log(GDPconstantUSD) + log(Price) + log(Consum_t_1), 
               data=pchasamil, model= "pooling")
## Warning: NaNs produced

duplicate couples (time-id)

## Error:
printSummaryTable(pooling)
## Error: object 'pooling' not found
summary(pooling)
## Error: object 'pooling' not found

Fixed effects or within estimator

fixed <- plm(log(Consumption) ~ log(GDPconstantUSD) + log(Price) + log(Consum_t_1), 
               data=pchasamil, model= "within")
## Warning: NaNs produced

duplicate couples (time-id)

## Error:
printSummaryTable(fixed)
## Error: object 'fixed' not found

Random effects estimator

random <- plm(log(Consumption) ~ log(GDPconstantUSD) + log(Price) + log(Consum_t_1), 
               data=pchasamil, model= "random")
## Warning: NaNs produced

duplicate couples (time-id)

## Error:
printSummaryTable(random)
## Error: object 'random' not found

The estimation of the random effect model tells me that there is an Error in swar(object, data, effect) : "the estimated variance of the individual effect is negative".