Skip to content

Instantly share code, notes, and snippets.

@minhtt159
Created October 3, 2022 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minhtt159/99973698ad9a6a7b22bdcaff11cab662 to your computer and use it in GitHub Desktop.
Save minhtt159/99973698ad9a6a7b22bdcaff11cab662 to your computer and use it in GitHub Desktop.
ex
/*
APPLIED ECONOMETRICS FOR SPATIAL ECONOMICS
Empirical Assignement II
Deadline: 07 Oct 2022
Group 6
*/
*Cleares the workspace
clear
*Set working directory
cd
*Import dataset "VOTTdata.xlsx" from personal workspace
import excel
*install necessary packages
***********************************************
*************** Questions ********************
***********************************************
*************** Question 1 ********************
//1) --> See Word document
//2)
*Showing description
sum BaseTime income
sum BaseTime income if gender == 1 //Male
sum BaseTime income if gender == 2 //Female
*Predicted probabilities for probit model (I already run logit and it gave the same result
replace y=y-1 //As STATA cannot understand 1;2, we replace it with 0;1
probit y BaseTime income gender //Probit regression models the probability that Y=1
predict y_probit, pr //predict values are probabilities that y = 1 for i-th obs
sort y
*Showing sample probabilities
list y y_probit in 1/10 //slowest alternative is chosen
list y y_probit in 8013/8022 //fastest alternative is chosen
//3) Display dominant alternatives
*************** Question 2 ********************
//1) --> See Word document
//2)
*Create new dependent variable with outcome 0 (formely 1) and 1 (formerly 2)
//3)
logit
//4) --> See Word document
//5)
*************** Question 3 ********************
//1)
//2)
//3)
//4)
*************** Question 4 ********************
//1)
//2)
//3)
***** END OF QUESTIONS *******
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment