Limited-time offer! Save up to 50% Off | Solutions starting at \$6 each

EC2017: Introductory Econometrics

Added on - 12 Nov 2021

• EC2017

Course

• 8

Pages

• 828

Words

• 19

Views

• 0

• Save

Share

Showing pages 1 to 3 of 8 pages
ECONOMETRICS - STATA ASSIGNMENT
1
*Original Data Opened
use "C:\Users\trishit\Desktop\867165\myZip_867165\ec2017cwdata.dta", clear
*Duplicate removed for merging data sets
duplicates report
duplicates drop
*Randomly 560 samples selected
sample 560,count
*File saved as data1.dat
save "C:\Users\trishit\Desktop\867165\myZip_867165\160074470_data1.dta"
*Linear Regression
regress logy loge
summarize loge
*Test hypothesis for linearity of loge and constant
test (loge _cons)
test (loge)
test (_cons)
*Generate 1 more sample other than 560 observations
merge 1:1 logy loge logk using "C:\Users\trishit\Desktop\867165\myZip_867165\
ec2017cwdata_160074470.dta"
keep if _merge==2
sample 1,count
2
label variable logy "Y0"
label variable loge "X0"
list
*store the generated sample
gen Y0 = logy
gen X0 = loge
*Append in data1 file for further analyses
append using "C:\Users\trishit\Desktop\867165\myZip_867165\160074470_data1.dta"
* Finding point estimation
gen point_estimate = _b[loge] *X0+ _b[_cons]
display point_estimate
*Finding point estimation for forecast error
predict y_resD, residuals
regress y_resD loge
gen point_estimate_fore = _b[loge] *X0+ _b[_cons]
display point_estimate_fore
*Estimate the variance of the predictor
egen loge_m = mean(loge)
gen dev_2 = (X0-loge_m)^2
gen dev_3 = (loge-loge_m)^2
3