We will take a look at weights in Stata. If you often work with survey data, like me, you will come across weights very frequently. Survey data often have weights to give some observations more or less importance. Most Stata commands allow weights.
**********************************
*6. Weights *
**********************************
cd "/Users/bobwen/Documents/2022 Youtube Teaching/Introductory Stata/6. Weights/"
capture log close
log using weights.log, text replace
sysuse census.dta, clear
describe
help weights
summarize medage
*summarize median age with weights
summarize medage [fweight=pop]
*weights in regressions
regress divorce medage
regress divorce medage [fweight=pop]
*scatter plots with weights
scatter divorce medage
scatter divorce medage [fweight=pop]
log close
Some courses on my Youtube channel:
Introductory Stata:
[ Ссылка ]
Introductory Microeconomics:
[ Ссылка ]
【粵語Cantonese】微觀經濟學基礎:
[ Ссылка ]
Introductory Econometrics:
[ Ссылка ]
Five Minute Econometrics:
[ Ссылка ]
【Mandarin國語】五分鐘計量經濟學
[ Ссылка ]
【Cantonese粵語】五分鐘計量經濟學
[ Ссылка ]
On the Road:
[ Ссылка ]
My free online Stata course on Alison:
[ Ссылка ]
#weights #fweight
![](https://i.ytimg.com/vi/tMuEXLC93VU/mqdefault.jpg)