0% found this document useful (0 votes)
35 views2 pages

KTL

This document provides instructions for using Stata commands to prepare and analyze a dataset. It discusses using tab to view variable distributions, gen to create new variables, drop to delete variables, and label to name variables. It recommends checking correlations between variables using corr before estimating a linear regression model with OLS. The linear model should only include independent variables found to correlate with the dependent variable.

Uploaded by

td342003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

KTL

This document provides instructions for using Stata commands to prepare and analyze a dataset. It discusses using tab to view variable distributions, gen to create new variables, drop to delete variables, and label to name variables. It recommends checking correlations between variables using corr before estimating a linear regression model with OLS. The linear model should only include independent variables found to correlate with the dependent variable.

Uploaded by

td342003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

 Don’t use command sum for dummy variables

 Sum can go with if or by


o +-*/
o >=,<=
o |(or)
o &(and)
o !=(unequal)
o After if, we use ==
 Tab provides disttribution of values of variables so that we can understand the
structure of the dataset
 Histogram educ, normal
 Gen: to generate new variable
o Gen newvar=
o Gen educsq=educ^2
 Drop: delete variable
 Label variable + name + “..”
 Gen … if/ Replace …. If
 List in/if
o Sort wage
o List wage in 1/10
o List wage in 517/526
 Drop/keep in/if
o Drop variable
o Drop in 1/20
 Rename
o Rename var newname
o Rename educ hocvan
Step 5: Estimate the model
 Econometrics model: linear regression model (data set is cross sectional and
dependent variable is quantitative and continous)
 Methods to estimate coefficients: OLS
 Check the correlation of X and Y
o Corr Y X -> correlation matrix
o Corr wage educ exper
 Correlation matrix presents
o Correlation between X and Y -> r(X,Y). If r(Y,X) #0 _> has correlation can
include
o Example:
 r(wage, educ)>0 education has positive correlation with wage -> educ
should be included in the model.
 R(wage, nonwhite)<0 -> race has negative corr with wage implying
that nonwhite ppl tends to have lower wage than white ppl.
 r(wage, female)<0 ->gender has corr with wage. Female tends to have
lower wage than male o average
 Conclusion: all the independent variables have correlation with the dependent
variable -> we can include them in the model.
 Note: Choosing Y and X
Topic 1: Analyse the impact of foreign direct investment on GDP growth of Vietnam
Y: GDP growth
X1: FDI (main independent variable)
X2, X3, …, Xk: Control variable

Topic 2: Analyse the relationship between FDI and GDP growth of Vietnam
(1): GDP Growth – f(FDI, X1 )
(2): FDI – f(GDP Growth, X2 )

Topic 3: Analyze the relationship between the rice output and the rainfall of Vietnam
Rice Output (Y), Rainfall (X)

If we have two var A and B and we want to see if A and B can be X and Y we have to
check the nature of corr between A and B
Calculate the corr
If r(A,B)#0 -> can include in the model
If correlate check if it is causation or not
If causation:
Result/consequence: Y
Cause: X

You might also like