-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchapter7.qmd
1771 lines (1351 loc) · 58.4 KB
/
chapter7.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Chapter 7. Import Tariffs and Dumping
## Empirical exercise
In this exercise, you are asked to reproduce some of the empirical results from Feenstra (1989).
To complete the exercise, the files "cars.csv, trucks.csv, cycon.csv, cyship.csv, cypool.csv" should be stored in the directory: `first-edition/Chapter-7`. Each of these can be used in STATA programs "cars.do, trucks.do, cycon.do, cyship.do, cypool.do" to create a dataset with the variables described in "Documentation_Chp7.doc."
## Data Description for Feenstra (1989)
There are five data sets in excel format: `cars.csv`, `trucks.csv`, `cycon.csv`, `cypool.csv`, `cyship.csv`. All of the variables in the data sets are fitted values from instrumental variables regression.
| Variable | Description |
|----------|--------------------------------------------------|
| iprice | Import price |
| usprice | US price |
| gprice | German price |
| tariff | Tariff rate |
| income | Expenditure on product class |
| lag0 | First order polynomial lag on betas |
| lag1 | Second order polynomial lag on betas |
| lag2 | Third order polynomial lag on betas |
| y | Import price transformed, y = iprice - income |
| x1 | US price transformed, usprice - income |
| x2 | German price transformed, gprice - income |
| z0 | First order polynomial lag transformed |
| z1 | Second order polynomial lag transformed |
| z2 | Third order polynomial lag transformed |
Note: all the transformations are done to reflect their restrictions. So some are restricted to homogeneity, where others are restricted to symmetry and homogeneity.
### Explanation of lag0, lag1 and lag2
With a second-order polynomial, $\alpha_i = a + bi + ci^2$ it follows that
\begin{align}
\sum_{i=0}^4 \log(c_t^* s_{t-i}) \alpha_i &= \sum_{i=0}^4 \log(c_t^* s_{t-i}) (a + bi + ci^2) \\
&= a \sum_{i=0}^4 \log(c_t^* s_{t-i}) + b \sum_{i=0}^4 \log(c_t^* s_{t-i}) i + c \sum_{i=0}^4 \log(c_t^* s_{t-i}) i^2.
\end{align}
Letting $\log(c_t^* s_{t-i}) = x_i$, we can define the three lags appeating in this formula as
\begin{align}
\text{lag}0 = x_0 + x_1 + x_2 + x_3 + x_4 \\
\text{lag}1 = 0 + x_1 + 2x_2 + 3x_3 + 4x_4 \\
\text{lag}2 = 0 + x_1 + 4x_2 + 9x_3 + 16x_4.
\end{align}
Then to compute the total pass-through of the exchange rate, it follow that,
\begin{align}
\sum_{i=0}^4 \alpha_i &= \sum_{i=0}^4 (a + bi + ci^2) \\
&= 5a + b(1 + 2 + 3 + 4) + c(1^2 + 2^2 + 3^2 + 4^2) \\
&= 5a + 10b + 30c.
\end{align}
When estimating the equation using lag0, lag1, and lag2, the coefficient estimates that you obtain are a, b, and c, respectively. Using this, you can recover the coefficient estimate and standard error for each individual exchange rate term reported in the Table 7.2. You can always do this by hand, but STATA does offer a command to calculate the linear combination of the estimated coefficients. The syntax for this is,
```stata
lincom lag0 + lag1 + lag2
```
This will calculate the coefficient estimates for the $\log(c_t^* s_{t-1})$. This is much in a same way as the syntax for test. Lag0 in above command does not refer to the data, but the coefficient estimate associated with lag0.
## Exercise 1
Replicate Table 7.2, i.e., run the specifications of (7.34) without imposing the tests of symmetry or homogeneity. Duplicate all of the coefficients that are reported in this table, except the Durbin-Watson statistics.
### Feenstra's code
#### Cars
```stata
clear
capture log close
log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cars.log, replace
insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cars.csv
* drop if time<=12
regress iprice time timesq lag0 lag1 lag2 usprice gprice income
*i=0
lincom lag0
*i=1
lincom lag0+lag1+lag2
*i=2
lincom lag0+2*lag1+4*lag2
*i=3
lincom lag0+3*lag1+9*lag2
*i=4
lincom lag0+4*lag1+16*lag2
*summation of betai's
lincom 5*lag0+10*lag1+30*lag2
*Impose the homogeneity constraint
regress y time timesq z0 z1 z2 x1 x2
*summation of betai's
lincom 5*z0+10*z1+30*z2
log close
exit
```
Output:
```stata
. clear
. capture log close
.
. log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cars.log, replace
(note: file Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cars.log not found)
----------------------------------------------------------------------------------
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cars.log
log type: text
opened on: 19 Jun 2024, 13:46:47
.
. insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Ch
> apter-7\cars.csv
(15 vars, 46 obs)
. * drop if time<=12
. regress iprice time timesq lag0 lag1 lag2 usprice gprice income
Source | SS df MS Number of obs = 29
-------------+------------------------------ F( 8, 20) = 313.58
Model | 1.88266593 8 .235333241 Prob > F = 0.0000
Residual | .015009666 20 .000750483 R-squared = 0.9921
-------------+------------------------------ Adj R-squared = 0.9889
Total | 1.8976756 28 .067774128 Root MSE = .02739
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
time | -.0071005 .0198015 -0.36 0.724 -.0484056 .0342047
timesq | .2232319 .1698526 1.31 0.204 -.1310743 .5775381
lag0 | .4435311 .1011438 4.39 0.000 .2325488 .6545134
lag1 | -.1156862 .165797 -0.70 0.493 -.4615325 .2301602
lag2 | -.0116016 .0404346 -0.29 0.777 -.0959467 .0727435
usprice | 1.002242 .9090603 1.10 0.283 -.8940243 2.898509
gprice | .0838093 .0880309 0.95 0.352 -.09982 .2674386
income | -.0257564 .1138551 -0.23 0.823 -.2632538 .2117411
_cons | 3.370612 4.178309 0.81 0.429 -5.345189 12.08641
------------------------------------------------------------------------------
.
. *i=0
. lincom lag0
( 1) lag0 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .4435311 .1011438 4.39 0.000 .2325488 .6545134
------------------------------------------------------------------------------
.
. *i=1
. lincom lag0+lag1+lag2
( 1) lag0 + lag1 + lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .3162433 .041669 7.59 0.000 .2293232 .4031634
------------------------------------------------------------------------------
.
. *i=2
. lincom lag0+2*lag1+4*lag2
( 1) lag0 + 2*lag1 + 4*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .1657523 .0782848 2.12 0.047 .0024531 .3290514
------------------------------------------------------------------------------
.
. *i=3
. lincom lag0+3*lag1+9*lag2
( 1) lag0 + 3*lag1 + 9*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.007942 .051645 -0.15 0.879 -.1156716 .0997877
------------------------------------------------------------------------------
.
. *i=4
. lincom lag0+4*lag1+16*lag2
( 1) lag0 + 4*lag1 + 16*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.2048394 .0992571 -2.06 0.052 -.4118862 .0022073
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*lag0+10*lag1+30*lag2
( 1) 5*lag0 + 10*lag1 + 30*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .7127453 .0974163 7.32 0.000 .5095385 .915952
------------------------------------------------------------------------------
.
. *Impose the homogeneity constraint
. regress y time timesq z0 z1 z2 x1 x2
Source | SS df MS Number of obs = 29
-------------+------------------------------ F( 7, 21) = 88.33
Model | .457112589 7 .065301798 Prob > F = 0.0000
Residual | .015525208 21 .000739296 R-squared = 0.9672
-------------+------------------------------ Adj R-squared = 0.9562
Total | .472637797 28 .016879921 Root MSE = .02719
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
time | .0089206 .0042701 2.09 0.049 .0000405 .0178007
timesq | .1355201 .131858 1.03 0.316 -.1386936 .4097339
z0 | .418623 .0958376 4.37 0.000 .2193179 .6179281
z1 | -.0822192 .1595793 -0.52 0.612 -.4140826 .2496442
z2 | -.0182092 .0393397 -0.46 0.648 -.1000206 .0636022
x1 | .2590963 .1491977 1.74 0.097 -.0511772 .5693698
x2 | .115353 .0787821 1.46 0.158 -.0484832 .2791893
_cons | 6.813711 .4488137 15.18 0.000 5.880352 7.74707
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*z0+10*z1+30*z2
( 1) 5*z0 + 10*z1 + 30*z2 = 0
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .7246472 .0956301 7.58 0.000 .5257736 .9235208
------------------------------------------------------------------------------
.
. log close
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cars.log
log type: text
closed on: 19 Jun 2024, 13:46:50
----------------------------------------------------------------------------------
. exit
end of do-file
```
#### Cycon
```stata
clear
capture log close
log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cycon.log,replace
insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cycon.csv
drop if time<=16
drop if time>=45
regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
*/ tariff usprice gprice income
*i=0
lincom lag0
*i=1
lincom lag0+lag1+lag2
*i=2
lincom lag0+2*lag1+4*lag2
*i=3
lincom lag0+3*lag1+9*lag2
*i=4
lincom lag0+4*lag1+16*lag2
*summation of betai's
lincom 5*lag0+10*lag1+30*lag2
*Impose the homogeneity and symmetry constraints
regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
*summation of betai's
lincom 5*z0+10*z1+30*z2
log close
exit
```
Output:
```stata
. clear
. capture log close
.
. log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cycon.log,replace
(note: file Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cycon.log not found)
----------------------------------------------------------------------------------
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cycon.log
log type: text
opened on: 19 Jun 2024, 13:48:28
.
. insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Ch
> apter-7\cycon.csv
(19 vars, 57 obs)
. drop if time<=16
(16 observations deleted)
. drop if time>=45
(13 observations deleted)
. regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
> */ tariff usprice gprice income
Source | SS df MS Number of obs = 28
-------------+------------------------------ F( 12, 15) = 23.08
Model | 1.16011255 12 .096676046 Prob > F = 0.0000
Residual | .062818315 15 .004187888 R-squared = 0.9486
-------------+------------------------------ Adj R-squared = 0.9075
Total | 1.22293087 27 .045293736 Root MSE = .06471
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .0634105 .0430635 1.47 0.162 -.0283773 .1551982
dummy2 | -.0305492 .0369325 -0.83 0.421 -.1092689 .0481706
dummy3 | .0397123 .0355224 1.12 0.281 -.036002 .1154265
time | -.0197231 .0600121 -0.33 0.747 -.1476358 .1081896
timesq | .41476 .4312669 0.96 0.351 -.5044635 1.333984
lag0 | .2879891 .2546382 1.13 0.276 -.2547594 .8307377
lag1 | -.1465425 .3537084 -0.41 0.685 -.9004542 .6073692
lag2 | .0306294 .0866307 0.35 0.729 -.1540196 .2152783
tariff | .9493961 .2181512 4.35 0.001 .4844179 1.414374
usprice | .6821239 .597725 1.14 0.272 -.5918968 1.956145
gprice | .0556783 .1064855 0.52 0.609 -.1712902 .2826468
income | -.2273151 1.683928 -0.13 0.894 -3.816524 3.361893
_cons | 6.738914 11.55768 0.58 0.569 -17.8957 31.37353
------------------------------------------------------------------------------
.
. *i=0
. lincom lag0
( 1) lag0 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .2879891 .2546382 1.13 0.276 -.2547594 .8307377
------------------------------------------------------------------------------
.
. *i=1
. lincom lag0+lag1+lag2
( 1) lag0 + lag1 + lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .172076 .0947437 1.82 0.089 -.0298654 .3740173
------------------------------------------------------------------------------
.
. *i=2
. lincom lag0+2*lag1+4*lag2
( 1) lag0 + 2*lag1 + 4*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .1174215 .1450444 0.81 0.431 -.1917333 .4265763
------------------------------------------------------------------------------
.
. *i=3
. lincom lag0+3*lag1+9*lag2
( 1) lag0 + 3*lag1 + 9*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .1240258 .0837432 1.48 0.159 -.0544686 .3025202
------------------------------------------------------------------------------
.
. *i=4
. lincom lag0+4*lag1+16*lag2
( 1) lag0 + 4*lag1 + 16*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .1918888 .2302309 0.83 0.418 -.2988368 .6826143
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*lag0+10*lag1+30*lag2
( 1) 5*lag0 + 10*lag1 + 30*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .8934012 .3594978 2.49 0.025 .1271498 1.659652
------------------------------------------------------------------------------
.
. *Impose the homogeneity and symmetry constraints
. regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
Source | SS df MS Number of obs = 28
-------------+------------------------------ F( 10, 17) = 8.64
Model | .321112891 10 .032111289 Prob > F = 0.0001
Residual | .063155914 17 .003715054 R-squared = 0.8356
-------------+------------------------------ Adj R-squared = 0.7390
Total | .384268805 27 .014232178 Root MSE = .06095
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .06846 .0367494 1.86 0.080 -.0090744 .1459945
dummy2 | -.0296761 .0333669 -0.89 0.386 -.1000741 .0407219
dummy3 | .0404237 .0329202 1.23 0.236 -.0290317 .1098792
time | -.005507 .0157472 -0.35 0.731 -.0387307 .0277166
timesq | .3625585 .253875 1.43 0.171 -.1730708 .8981879
z0 | .3294302 .1732048 1.90 0.074 -.036 .6948604
z1 | -.1849915 .2875633 -0.64 0.529 -.7916969 .421714
z2 | .0391241 .0718017 0.54 0.593 -.1123642 .1906124
x1 | .6062422 .501893 1.21 0.244 -.4526596 1.665144
x2 | .0639407 .0948443 0.67 0.509 -.1361634 .2640447
_cons | 9.80264 1.904478 5.15 0.000 5.784542 13.82074
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*z0+10*z1+30*z2
( 1) 5*z0 + 10*z1 + 30*z2 = 0
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .9709581 .144562 6.72 0.000 .665959 1.275957
------------------------------------------------------------------------------
.
. log close
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cycon.log
log type: text
closed on: 19 Jun 2024, 13:48:30
----------------------------------------------------------------------------------
. exit
end of do-file
```
#### Cypool
```stata
clear
capture log close
log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cypool.log,replace
insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cypool.csv
regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
*/ tariff usprice gprice income
*i=0
lincom lag0
*i=1
lincom lag0+lag1+lag2
*i=2
lincom lag0+2*lag1+4*lag2
*i=3
lincom lag0+3*lag1+9*lag2
*i=4
lincom lag0+4*lag1+16*lag2
*summation of betai's
lincom 5*lag0+10*lag1+30*lag2
*Impose the homogeneity and symmetry constraints
regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
*summation of betai's
lincom 5*z0+10*z1+30*z2
log close
exit
```
Output:
```stata
. clear
. capture log close
. log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cypool.log,replace
(note: file Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cypool.log not found)
----------------------------------------------------------------------------------
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cypool.log
log type: text
opened on: 19 Jun 2024, 13:49:29
.
. insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Ch
> apter-7\cypool.csv
(19 vars, 65 obs)
.
. regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
> */ tariff usprice gprice income
Source | SS df MS Number of obs = 65
-------------+------------------------------ F( 12, 52) = 28.69
Model | 3.7792523 12 .314937692 Prob > F = 0.0000
Residual | .570888473 52 .010978624 R-squared = 0.8688
-------------+------------------------------ Adj R-squared = 0.8385
Total | 4.35014078 64 .06797095 Root MSE = .10478
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .0415538 .039227 1.06 0.294 -.0371609 .1202686
dummy2 | -.0163882 .0377145 -0.43 0.666 -.092068 .0592915
dummy3 | .0336136 .0373974 0.90 0.373 -.0414297 .108657
time | -.0460622 .025957 -1.77 0.082 -.0981486 .0060242
timesq | .6966283 .3011555 2.31 0.025 .0923156 1.300941
lag0 | .4468833 .20907 2.14 0.037 .0273536 .8664129
lag1 | -.4474712 .3375047 -1.33 0.191 -1.124724 .2297816
lag2 | .1041952 .0844251 1.23 0.223 -.0652161 .2736065
tariff | 1.129379 .1548965 7.29 0.000 .8185561 1.440201
usprice | .5715626 .5883761 0.97 0.336 -.6091005 1.752226
gprice | .0630112 .1045199 0.60 0.549 -.1467234 .2727457
income | .015869 .010022 1.58 0.119 -.0042417 .0359797
_cons | 5.86047 2.524698 2.32 0.024 .7942919 10.92665
------------------------------------------------------------------------------
.
. *i=0
. lincom lag0
( 1) lag0 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .4468833 .20907 2.14 0.037 .0273536 .8664129
------------------------------------------------------------------------------
.
. *i=1
. lincom lag0+lag1+lag2
( 1) lag0 + lag1 + lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .1036072 .091221 1.14 0.261 -.0794411 .2866556
------------------------------------------------------------------------------
.
. *i=2
. lincom lag0+2*lag1+4*lag2
( 1) lag0 + 2*lag1 + 4*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.0312784 .1532273 -0.20 0.839 -.3387515 .2761948
------------------------------------------------------------------------------
.
. *i=3
. lincom lag0+3*lag1+9*lag2
( 1) lag0 + 3*lag1 + 9*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .0422264 .0851726 0.50 0.622 -.1286849 .2131377
------------------------------------------------------------------------------
.
. *i=4
. lincom lag0+4*lag1+16*lag2
( 1) lag0 + 4*lag1 + 16*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .3241215 .2208683 1.47 0.148 -.1190832 .7673262
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*lag0+10*lag1+30*lag2
( 1) 5*lag0 + 10*lag1 + 30*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .88556 .2128404 4.16 0.000 .4584645 1.312655
------------------------------------------------------------------------------
.
. *Impose the homogeneity and symmetry constraints
. regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
Source | SS df MS Number of obs = 65
-------------+------------------------------ F( 10, 54) = 1112.76
Model | 126.137525 10 12.6137525 Prob > F = 0.0000
Residual | .612117901 54 .011335517 R-squared = 0.9952
-------------+------------------------------ Adj R-squared = 0.9943
Total | 126.749643 64 1.98046316 Root MSE = .10647
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .0390208 .0398367 0.98 0.332 -.040847 .1188886
dummy2 | -.0079258 .0380454 -0.21 0.836 -.0842022 .0683506
dummy3 | .0384614 .037904 1.01 0.315 -.0375315 .1144543
time | -.016386 .0142608 -1.15 0.256 -.0449772 .0122052
timesq | .3842091 .2086319 1.84 0.071 -.0340725 .8024908
z0 | .4880678 .1718376 2.84 0.006 .1435541 .8325815
z1 | -.432728 .2915576 -1.48 0.144 -1.017266 .1518097
z2 | .0987337 .0738784 1.34 0.187 -.0493836 .2468511
x1 | -.0833764 .1803078 -0.46 0.646 -.4448718 .278119
x2 | -.009202 .0973665 -0.09 0.925 -.20441 .186006
_cons | 8.96105 .8661 10.35 0.000 7.224624 10.69748
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*z0+10*z1+30*z2
( 1) 5*z0 + 10*z1 + 30*z2 = 0
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.07507 .1528333 7.03 0.000 .7686582 1.381483
------------------------------------------------------------------------------
.
. log close
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cypool.log
log type: text
closed on: 19 Jun 2024, 13:49:32
----------------------------------------------------------------------------------
. exit
end of do-file
```
#### Cyship
```stata
clear
capture log close
log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cyship.log,replace
insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\cyship.csv
drop if time<=16
regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
*/ tariff usprice gprice income
*i=0
lincom lag0
*i=1
lincom lag0+lag1+lag2
*i=2
lincom lag0+2*lag1+4*lag2
*i=3
lincom lag0+3*lag1+9*lag2
*i=4
lincom lag0+4*lag1+16*lag2
*summation of betai's
lincom 5*lag0+10*lag1+30*lag2
*Impose the homogeneity and symmetry constraints
regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
*summation of betai's
lincom 5*z0+10*z1+30*z2
log close
exit
```
Output:
```stata
. clear
. capture log close
.
. log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cyship.log,replace
(note: file Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\cyship.log not found)
----------------------------------------------------------------------------------
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cyship.log
log type: text
opened on: 19 Jun 2024, 13:51:15
.
. insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Ch
> apter-7\cyship.csv
(19 vars, 57 obs)
. drop if time<=16
(16 observations deleted)
. regress iprice dummy1 dummy2 dummy3 time timesq lag0 lag1 lag2 /*
> */ tariff usprice gprice income
Source | SS df MS Number of obs = 37
-------------+------------------------------ F( 12, 24) = 13.33
Model | 2.66760727 12 .222300606 Prob > F = 0.0000
Residual | .400138786 24 .016672449 R-squared = 0.8696
-------------+------------------------------ Adj R-squared = 0.8043
Total | 3.06774606 36 .085215168 Root MSE = .12912
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .0785462 .1458493 0.54 0.595 -.2224719 .3795643
dummy2 | .0405177 .1327231 0.31 0.763 -.2334092 .3144447
dummy3 | .0250007 .0625785 0.40 0.693 -.104155 .1541563
time | -.0778322 .0554157 -1.40 0.173 -.1922045 .0365401
timesq | 1.035907 .568177 1.82 0.081 -.1367526 2.208567
lag0 | .7977086 .6650261 1.20 0.242 -.5748378 2.170255
lag1 | -1.112321 1.191004 -0.93 0.360 -3.570432 1.345791
lag2 | .2729264 .3031369 0.90 0.377 -.3527174 .8985702
tariff | 1.388199 .2721709 5.10 0.000 .8264657 1.949932
usprice | 1.142866 1.998888 0.57 0.573 -2.982636 5.268368
gprice | .1241107 .209419 0.59 0.559 -.3081089 .5563303
income | -.2151571 .5969111 -0.36 0.722 -1.447121 1.016807
_cons | 4.611564 6.469095 0.71 0.483 -8.739992 17.96312
------------------------------------------------------------------------------
.
. *i=0
. lincom lag0
( 1) lag0 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .7977086 .6650261 1.20 0.242 -.5748378 2.170255
------------------------------------------------------------------------------
.
. *i=1
. lincom lag0+lag1+lag2
( 1) lag0 + lag1 + lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.0416857 .2597043 -0.16 0.874 -.577689 .4943175
------------------------------------------------------------------------------
.
. *i=2
. lincom lag0+2*lag1+4*lag2
( 1) lag0 + 2*lag1 + 4*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.3352272 .5234521 -0.64 0.528 -1.415579 .7451248
------------------------------------------------------------------------------
.
. *i=3
. lincom lag0+3*lag1+9*lag2
( 1) lag0 + 3*lag1 + 9*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | -.0829159 .2158146 -0.38 0.704 -.5283353 .3625036
------------------------------------------------------------------------------
.
. *i=4
. lincom lag0+4*lag1+16*lag2
( 1) lag0 + 4*lag1 + 16*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .7152483 .7584352 0.94 0.355 -.850085 2.280582
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*lag0+10*lag1+30*lag2
( 1) 5*lag0 + 10*lag1 + 30*lag2 = 0
------------------------------------------------------------------------------
iprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.053128 .5219069 2.02 0.055 -.0240347 2.130291
------------------------------------------------------------------------------
.
. *Impose the homogeneity and symmetry constraints
. regress y dummy1 dummy2 dummy3 time timesq z0 z1 z2 x1 x2
Source | SS df MS Number of obs = 37
-------------+------------------------------ F( 10, 26) = 14.13
Model | 2.49470896 10 .249470896 Prob > F = 0.0000
Residual | .45918364 26 .017660909 R-squared = 0.8445
-------------+------------------------------ Adj R-squared = 0.7848
Total | 2.9538926 36 .082052572 Root MSE = .13289
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dummy1 | .0455011 .0952729 0.48 0.637 -.1503351 .2413373
dummy2 | .0311428 .0889305 0.35 0.729 -.1516564 .2139419
dummy3 | .0367732 .0635252 0.58 0.568 -.0938049 .1673512
time | -.0260349 .0241189 -1.08 0.290 -.0756121 .0235423
timesq | .4997075 .3460414 1.44 0.161 -.2115907 1.211006
z0 | .7524749 .3159082 2.38 0.025 .1031163 1.401833
z1 | -.912172 .5807959 -1.57 0.128 -2.106015 .2816711
z2 | .2210294 .1505169 1.47 0.154 -.0883625 .5304214
x1 | -.1613882 .3756296 -0.43 0.671 -.9335059 .6107296
x2 | -.0247239 .1679367 -0.15 0.884 -.3699227 .3204749
_cons | 10.24826 1.511092 6.78 0.000 7.142165 13.35435
------------------------------------------------------------------------------
.
. *summation of betai's
. lincom 5*z0+10*z1+30*z2
( 1) 5*z0 + 10*z1 + 30*z2 = 0
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.271538 .2703125 4.70 0.000 .7159023 1.827173
------------------------------------------------------------------------------
.
. log close
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\cyship.log
log type: text
closed on: 19 Jun 2024, 13:51:17
----------------------------------------------------------------------------------
. exit
end of do-file
```
#### Trucks
```stata
clear
capture log close
log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\trucks.log, replace
insheet using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapter-7\trucks.csv
drop if time<=12
regress iprice time timesq lag0 lag1 lag2 tariff usprice income
*i=0
lincom lag0
*i=1
lincom lag0+lag1+lag2
*i=2
lincom lag0+2*lag1+4*lag2
*i=3
lincom lag0+3*lag1+9*lag2
*i=4
lincom lag0+4*lag1+16*lag2
*summation of betai's
lincom 5*lag0+10*lag1+30*lag2
*Impose the homogeneity and symmetry constraints
regress y time timesq z0 z1 z2 x1
*summation of betai's
lincom 5*z0+10*z1+30*z2
log close
exit
```
Output:
```stata
. clear
. capture log close
.
. log using Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\trucks.log, replace
(note: file Z:\home\pacha\github\advanced-international-trade\first-edition\Chapte
> r-7\trucks.log not found)
----------------------------------------------------------------------------------
name: <unnamed>
log: Z:\home\pacha\github\advanced-international-trade\first-edition\Chapt
> er-7\trucks.log