%table_v_share_cbc.m 
%Country-by-country estimates of the Share of Variance explained by TOT shocks 
%Table 2  in  ``How Important Are Terms of Trade Shocks?''  by Stephanie Schmitt-Grohe and Martín Uribe. 
%(c) Stephanie Schmitt-Grohé and Martín Uribe, September 2016.

clear all
clc

%Baseline case: log quadratic detrended data
load sgu_tot_run.mat 
%produced with sgu_tot_run.m 

%HP 100 filtered data
%load sgu_tot_run_HP

ncou = numel(country_name); 

disp('\hline')
for k=1:ncou
a = [country_name{k} ' ' num2str(v_share(k,:))];
disp(a)
end
disp('\hline')
b = ['Median ' num2str(median(v_share))];
disp(b)
c = ['Median Absolute Deviation' num2str(mad(v_share,1))];
disp(c)
disp('\hline')