Community corner: Stata tips
From graphics to data management to working with the Do-file Editor, Todd Jones provides Stata tips that can benefit Stata users, whether novice or expert. He highlights official commands that improve workflow, powerful community contributed commands, and operating system specific tips. Check out a few of his tips below.
Quick @Stata tip: It's very easy to simultaneously use multiple cursors.
— Todd Jones 🦊 (@toddrjones) September 5, 2022
On a Mac, hold down Command (⌘) and click everywhere you want to place your cursors. On Windows, hold down Control and click. (h/t @PSullivanT.) pic.twitter.com/FFPsyLCNeg
Quick @Stata tip:
— Todd Jones 🦊 (@toddrjones) August 15, 2022
keep if inlist(state, "AL", "AK", "AZ")
is the same as:
keep if state=="AL" | state=="AK" | state=="AZ"
And:
keep if inrange(distance, 10, 91)
is the same as:
keep if distance>=10 & distance<=91
Quick @Stata tip: after a regression, you can use "r(table)" to directly get the 95% confidence interval, p-value, standard error, beta, etc. h/t @nomadj1s
— Todd Jones 🦊 (@toddrjones) August 27, 2022
sysuse auto2, clear
reg trunk weight
matrix list r(table)
local weight_lower_95ci = r(table)[5,1]
di "`weight_lower_95ci'" pic.twitter.com/NHzLqkbdrt
Quick @Stata tip: use "mscatter" to create scatter plots with color gradients. (h/t @friosavila)
— Todd Jones 🦊 (@toddrjones) September 9, 2022
cap ssc inst mscatter
cap ssc inst palettes
sysuse sp500, clear
mscatter change close if inrange(change, -30, 30), msymbol(O) msize(7) sch(s1mono) over(change) colorpalette(viridis) pic.twitter.com/6hEfFpU4cL
Want to see more? Read his full thread of Stata tips here.