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

EC2017: Introductory Econometrics

Added on - 12 Nov 2021

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 3 of 8 pages
ECONOMETRICS - STATA ASSIGNMENT
1
TASK 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"
*Task 1
*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
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document