Stata Tutorial PDF

Title Stata Tutorial
Course Econometrics 2
Institution University of Southampton
Pages 15
File Size 1.2 MB
File Type PDF
Total Downloads 32
Total Views 153

Summary

stata...


Description

tata

Tutorial

https://dss.princeton.edu/online_help/stats_packages/stata/ https://stats.idre.ucla.edu/other/dae/ 1.

Browse

2.

browse make or (br) Mean mean price

3.

heck value of each category ta foreign,nol

4.

Find mean price under condition mean price if foreign==1 (== means giving value)

5.

Find mean price under two conditions mean price if foreign==1 & headroom2

6.

Generating new variable egen_sum_of _prices=sum(prices)

Always check by: ta sum_of_prices

7.

Find the sum of prices separately egen sum_price_foreign=sum(price) if foreign==1 ta sum_price_foreign

egen sum_price_domestic=sum(price) if foreign==0 ta sum_price_domestic

8.

Creation of new variable gen 一般 一般用来产 用来产 用来产生一个 生一个 生一个命令的 命令的 命令的变量,而 变量,而 egen 一般用 般用来产生 来产生 来产生一个通 一个通 一个通过计算 过计算 过计算函数得 函数得 函数得出来的 出来的 变量 gen lnprice=ln(price) gen trunksq=trunk^2 gen trunkqb=trunk^3

9.

Generate Dummy variable br make length gen longcar=1 if length>=201 replace longcar=0 if length=2

11. Estimate the fitted values and residuals reg price trunk predict yhat predict resid, residuals

12. Plot the residuals against x and the fitted values of y Against x rvpplot trunk, yline(0)

Against fitted vlaues of y rvfplot, yline(0)

13. est for normality sktest mpg trunk

We reject that hypothesis that mpg is normally distributed but cannnot reject trunk 14. Predictions at specific values Predict price for mean mileage and weight reg price meg weight mean mpg weight gen price_hat=1946.069+(1.746559*3019.459)-(49.51222*21.2973) ta price_hat

15. Graph Histogram and two way hist price

hist length if foreign==1

twoway scatter price length title (“anything you wish”)

ome commands:

16.

17....


Similar Free PDFs