clear all /* Applied Microeconometrics I Stata tutorial 2023 Atte Pudas */ *Part II *Note: I am using Stata 18 *Note: the step numbers below refer to document "Stata_tutorial_session_2023_slides.pdf" *Step 20: cd "YOUR FOLDER PATH HERE" log using "tutorial_log2.log", replace use elemapi2.dta, clear *Step 21: Scatter plot with fitted line twoway (scatter api00 enroll) (lfit api00 enroll) *The look of the previous graph can be modified in many ways, for example: twoway (scatter api00 enroll, mcolor(pink) msymbol(circle_hollow) msize(small)) /// (lfit api00 enroll, lcolor(green)), /// graphregion(color(white)) /// title("Title", color(black) size(medium)) /// note("Notes here.", size(vsmall)) /// xlabel(0(250)1500, labsize(small)) /// ylabel( ,angle(horizontal) labsize(small)) /// xtitle("Name of the x-variable",size(small)) /// ytitle("Name of the y-variable", size(small)) /// legend(order(2 1) size(vsmall) symy(2) symx(2) rows(2) position(3)) * we can save the previous graph as a "Stata graph" (.gph), or as .pdf, .jpg, .png,... graph save "example_graph", replace graph export "example_graph.pdf", replace graph export "example_graph.jpg", replace *Step 22: Slope reg api00 enroll *Step 23: Stata can be used as a calculator di ln(30000) di 45+10 di ln(30000)-ln(15000) log close