You are on page 1of 2

Lecture 12 all codes - Printed on 12/19/2023 10:01:44 PM

1 use "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Pakistandata.dta", clear


2 log using "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\results.smcl", append
3 tsset years
4 histogram gdp_bn
5 histogram gdp_bn, normal
6 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram gdp.png", as
(png) replace
7 histogram lgdp, normal
8 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram lgdp.png",
as(png) replace
9 histogram dlgdp, normal
10 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Histogram dlgdp.png",
as(png) replace
11 histogram lgdp, normal
12 histogram con_bn, normal
13 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram con_bn.png",
as(png) replace
14 histogram con_bn, normal
15 histogram fdi_bn, normal
16 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram fdi_bn.png",
as(png) replace
17 histogram dfdi, normal
18 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram dfdi.png",
as(png) replace
19 histogram ge_bn, normal
20 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram ge_bn.png",
as(png) replace
21 histogram lge, normal
22 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram lge.png", as
(png) replace
23 histogram dlge, normal
24 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram dlge.png",
as(png) replace
25 histogram imports_bn, normal
26 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram
imports_bn.png", as(png) replace
27 histogram exports_bn, normal
28 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram
exports_bn.png", as(png) replace
29 histogram netexports, normal
30 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram
netexports.png", as(png) replace
31 histogram dnetexports, normal
32 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\histogram
dnetexports.png", as(png) replace
33 //comments
34 *comments
35 **** Linearity Assumption*****Scatter Plots****
36 twoway scatter (gdp_bn consumption)
37 twoway scatter (gdp_bn consumption)(lfit gdp_bn consumption)
38 twoway scatter (gdp_bn consumption)lfit (gdp_bn consumption)
39 twoway (line gdp consumption)
40 twoway (scatter gdp consumption)
41 twoway (scatter gdp imports)(lfit gdp imports)
42 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter Plots\gdp
.png", as(png) replace
43 twoway (scatter gdp imports)(lfit gdp imports)
44 twoway (scatter gdp consumption)(lfit gdp consumption)
45 twoway (scatter gdp_bn )(lfit gdp consumption)
46 twoway (scatter gdp_bn con_bn)(lfit gdp_bn con_bn)
47 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter Plots\gdp_bn
con_bn.png", as(png) replace
48 twoway (scatter gdp_bn ge_bn)(lfit gdp_bn ge_bn)
49 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter Plots\gdp_bn
ge_bn.png", as(png) replace
50 twoway (scatter gdp_bn imports_bn)(lfit gdp_bn imports_bn)
51 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter
Plots\imports_bn.png", as(png) replace
52 twoway (scatter gdp_bn exports_bn)(lfit gdp_bn exports_bn)
53 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter

Page 1
Lecture 12 all codes - Printed on 12/19/2023 10:01:44 PM
Plots\exports_bn.png", as(png) replace
54 twoway (scatter gdp_bn fdi_bn)(lfit gdp_bn fdi_bn)
55 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter
Plots\fdi_bn.png", as(png) replace
56 twoway (scatter gdp_bn netexports)(lfit gdp_bn netexports)
57 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Scatter
Plots\netexports.png", as(png) replace
58 regress gdp_bn con_bn fdi_bn ge_bn imports_bn exports_bn
59 predict resid, r
60 ssc install jb
61 jb resid
62 histogram resid, normal
63 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Histograms\resid.png",
as(png) replace
64 estat hettest
65 estat imtest
66 estat dwatson
67 vif
68 log close
69 save "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Pakistandata.dta", replace
70 log using "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\results.smcl", append
71 regress lgdp lge dfdi dnetexports
72 predict resid1, r
73 jb resid1
74 histogram resid1, normal
75 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Histograms\resid1.png"
, as(png) replace
76 estat hettest
77 estat imtest
78 estat dwatson
79 vif
80 regress dlgdp dlge dfdi dnetexports
81 predict resid2, r
82 jb resid2
83 histogram resid2, normal
84 graph export "C:\Users\test\Documents\Fall 2023 BAF\BBA 5A\Lecture 11\Histograms\resid3.png"
, as(png) replace
85 estat hettest
86 estat imtest
87 estat dwatson
88 vif
89 log close
90 ssc install asdoc
91 asdoc regress dlgdp dlge dfdi dnetexports
92 predict resid3, r
93 asdoc jb resid3
94 asdoc estat hettest
95 asdoc estat imtest
96 asdoc estat dwatson
97 asdoc vif
98

Page 2

You might also like