Extensions to generate (egen) | Data Management using Stata | Stata Tutorials Topic 28

Опубликовано: 24 Январь 2024
на канале: Dr. Bob Wen (Stata, Economics, Econometrics)
240
7

Stata Tutorials Topic 28: Extensions to generate (egen) | Summary Statistics and Data Management Using Stata

Hi, I am Bob. Welcome to the Stata course that helps you understand Stata commands for summary statistics and regression analysis. Today, we will explore the "egen" command. The "egen" command creates new variables from existing variables using functions. The "egen" command is more powerful than the "generate" command, making some complicated coding much easier. The "egen" command is used with functions.

Please download the BOB.dta dataset:
https://drive.google.com/file/d/1dUBB...

The Stata commands in this video:
*load the Stata data file for this course
use BOB.dta, clear

describe

summarize

help egen

*Create the mean of a variable
egen avrage=mean(age)

browse age avrage

*Generate standard deviation of age
egen sdage=sd(age)

browse age sdage

summarize age

*Get parents' education using the rowmean, rowmin, rowmax functions
use "http://fmwww.bc.edu/ec-p/data/wooldri...", clear

describe

summarize

egen pareduc=rowmean(fatheduc motheduc)
browse fatheduc motheduc pareduc

egen pareduc2=rowmax(fatheduc motheduc)
browse fatheduc motheduc pareduc2

egen pareduc3=rowmin(fatheduc motheduc)
browse fatheduc motheduc pareduc3

*Cut hourly wages into 4 quartiles
use BOB.dta, clear

egen hwage_quartile=cut(hwage), group(4)

tabulate hwage_quartile

*egen by groups
bysort female: egen avrhwage=mean(hwage)

browse female hwage avrhwage

【Some Free Courses on my YouTube Channel】

Economics in Real Life:
   • Economics in Real Life  

Solutions to Introductory Econometrics A Modern Approach 7th Edition:
   • Solutions to Introductory Econometric...  

Solutions to Microeconomics Theory and Applications with Calculus:
   • Solutions to Microeconomics Theory an...  

Introductory Stata:
   • Introductory Stata (2022)  

Introductory Microeconomics:
   • Introductory Microeconomics (2022)  

Five Minute Econometrics:
   • Five Minute Econometrics (Econometric...  

Five Minute Stata:
   • Stata Tutorials  

【國語Mandarin】現實生活中的經濟學:
   • 【Mandarin國語】現實生活中的經濟學  

【粵語Cantonese】現實生活中的經濟學:
   • 【Cantonese粵語】現實生活中的經濟學  

【粵語Cantonese】微觀經濟學基礎:
   • 粵語Cantonese微觀經濟學基礎2022  

【國語Mandarin】五分鐘計量經濟學:
   • 【Mandarin國語】五分鐘計量經濟學(計量經濟學輔導)  

【粵語Cantonese】五分鐘計量經濟學:
   • 【Cantonese粵語】五分鐘計量經濟學(計量經濟學輔導)  

On the Road:
   • On the Road  

【Become a Supporter of the channel ($2.99) to get PDF transcripts for】
1. Solutions to Microeconomics Theory and Applications with Calculus 5th Edition,
2. Solutions to Introductory Econometrics A Modern Approach 7th Edition,
3. Introductory Stata (2022), and
4. Introductory Microeconomics (2022).
   / @bobwenecon  

#Stata #egen #DataManagement #SummaryStatistics #tutorial


Смотрите видео Extensions to generate (egen) | Data Management using Stata | Stata Tutorials Topic 28 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Dr. Bob Wen (Stata, Economics, Econometrics) 24 Январь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 240 раз и оно понравилось 7 людям.