SlideShare a Scribd company logo
1 of 28
TEAM MEMBERS
WELCOME!
Import “GPA 2_1.dta”
FROM MENU
 File
 Import
 Excel Spreadsheet
 Browse and select
 Import 1st row as variable name
 OK
Command: use "D:Session 3 4 Nazmul
Hossaingpa2_1.dta“
br
Merge
FROM MENU
 Data
 Combine dataset
 Merge two datasets
 One to one
 Key Variable: Id
 Browse “GPA 2_2.dta”
Command: merge 1:1 id using "C:UsersDept. of
EconomicsDesktopBER 20_04_2019gpa2_2.dta"
Labeling Dataset
▸ label data "GPA 2"
Labeling Variables
▸ label variable sat "combined SAT score"
▸ label variable tothrs "total hours through fall semest"
▸ label variable colgpa "GPA after fall semester"
▸ label variable athlete "=1 if athlete"
▸ label variable hsize "size graduating class, 100s"
▸ label variable hsrank "rank in graduating class"
▸ label variable hsperc "100*(hsrank/hssize)"
▸ label variable female "=1 if female"
▸ label variable white "=1 if white"
▸ label variable black "=1 if black"
▸ label variable hsizesq "hsize^2"
▸ label variable verbmath "verbal/math SAT score"
Labeling Values (for dummy variables)
▸ label define black_lbl 0 "Non-black" 1 "Black"
▸ label values black black_lbl
▸ label define white_lbl 0 "Non-white" 1 "White"
▸ label values white white_lbl
▸ label define athlete_lbl 0 "Non-athlete" 1 "Athlete"
▸ label values athlete athlete_lbl
▸ label define female_lbl 0 "Male" 1 "Female"
▸ label values female female_lbl
Generating New Variables (log form)
▸ gen lsat=ln(sat)
▸ gen ltothrs=ln( tothrs)
▸ gen lcolgpa=ln( colgpa)
▸ label var lsat "ln of sat"
▸ label var ltothrs "ln of tothrs"
▸ label var lcolgpa "ln of colgpa"
Egen Command
▸ egen meangpa=mean(colgpa)
Mean of colgpa= 2.652685
Recoding “colgpa”
▸ recode colgpa (min/1.99=1 "Low GPA")
(2/3.49=2 "Moderate GPA") (3.5/max=3
"High GPA"), gen(ggpa)
GPA after fall semester Label
0-1.99 Low GPA
2-3.49 Moderate GPA
3.5-4 High GPA
Tabulate “ggpa”
▸ tab ggpa
RECODE of colgpa
(GPA after fall
semester)
Freq. Percent Cum.
Low GPA 592 14.31 14.31
Moderate GPA 3087 74.62 88.93
High GPA 458 11.07 100.00
Describe
▸ des
obs: 4,137 GPA 2
vars: 18 25 Apr 2019 02:06
size: 297,864
----------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
----------------------------------------------------------------------------------------------------------------------------------
id float %9.0g
sat float %9.0g combined SAT score
tothrs float %9.0g total hours through fall semest
colgpa float %9.0g GPA after fall semester
athlete float %11.0g athlete_lbl
=1 if athlete
verbmath float %9.0g verbal/math SAT score
hsize float %9.0g size graduating class, 100s
hsrank float %9.0g rank in graduating class
hsperc float %9.0g 100*(hsrank/hssize)
female float %9.0g female_lbl
=1 if female
white float %9.0g white_lbl
=1 if white
black float %9.0g black_lbl
=1 if black
hsizesq float %9.0g hsize^2
lsat float %9.0g ln of sat
ltothrs float %9.0g ln of tothrs
lcolgpa float %9.0g ln of colgpa
meangpa float %9.0g
ggpa float %12.0g ggpa RECODE of colgpa (GPA after fall semester)
----------------------------------------------------------------------------------------------------------------------------------
Sorted by: id
Summarize
▸ sum sat tothrs colgpa hsize hsrank hsperc athlete female white
black
Variable Obs Mean Std.Dev. Min Max
sat 4137 1030.331 139.401 470 1540
tothrs 4137 52.832 35.33 6 137
colgpa 4137 2.653 .659 0 4
hsize 4137 2.8 1.737 .03 9.4
hsrank 4137 52.83 64.684 1 634
hsperc 4137 19.237 16.569 .167 92
athlete 4137 .047 .211 0 1
female 4137 .45 .498 0 1
white 4137 .926 .263 0 1
black 4137 .055 .229 0 1
TABLE: Descriptive Statistics
Crosstab
▸ tab athlete black, row
Athlete=1 if athlete
Black=1 if black
0 1 Total
0 3758 185 3943
95.31 4.69 100.00
1 150 44 194
77.32 22.68 100.00
Total 3908 229 4137
94.46 5.54 100.00
Tabulation of athlete black
First row has frequencies and second row has row percentages
“
graph pie, over(female) plabel(_all percent, color(white) size(medium))
“
graph bar (count), over(ggpa) blabel(bar)
“
hist colgpa, norm
Scatter plot
colgpa vs tothrs
lcolgpa vs ltothrs
colgpa vs sat
lcolgpa vs lsat
Regression
reg lcolgpa lsat ltothrs hsize hsizesq athlete female black
There is no
multicollinearity
problem
Post-estimation: Checking for
multicollinearity
. corr lsat ltothrs hsize athlete female black
| lsat ltothrs hsize athlete female black
-------------+---------------------------------------------------------------------
lsat | 1.0000
ltothrs | 0.0121 1.0000
hsize | 0.0652 -0.0397 1.0000
athlete | -0.2079 0.0107 0.0493 1.0000
female | -0.1446 0.0314 -0.0042 -0.0970 1.0000
black | -0.2533 -0.0054 -0.0575 0.1663 0.0213 1.0000
. estat imtest, white
White's test for Ho: homoskedasticity
against Ha: unrestricted heteroskedasticity
chi2(31) = 183.61
Prob > chi2 = 0.0000
Cameron & Trivedi's decomposition of IM-test
-------------------------------------------------------------
Source | chi2 df p
---------------------+---------------------------------------
Heteroskedasticity | 183.61 31 0.0000
Skewness | 63.89 7 0.0000
Kurtosis | 10.33 1 0.0013
---------------------+----------------------------------------
Total | 257.82 39 0.0000
---------------------------------------------------------------
There is
heteroscedasticity
problem
Post-estimation: Checking for
heteroscedasticity
There is no
Specification bias
problem
Post-estimation: Checking for
specification bias
. estat ovtest
Ramsey RESET test using powers of the fitted
values of lcolgpa
Ho: model has no omitted variables
F(3, 4124) = 1.26
Prob > F = 0.2854
Robust standard errors in parentheses
*** p<0.01, ** p<0.05, * p<0.1
From STATA to
MS Word
outreg2 command
outreg2 using “myfile.doc", replace ctitle(model)
From STATA to MS Word
ssc install asdoc asdoc command run
THANK YOU!
27
SlidesCarnival icons are editable shapes.
This means that you can:
● Resize them without losing quality.
● Change line color, width and style.
Isn’t that nice? :)
Examples:
Now you can use any emoji as an icon!
And of course it resizes without losing quality and you can change the color.
How? Follow Google instructions
https://twitter.com/googledocs/status/730087240156643328
✋👆👉👍👤👦👧👨👩👪💃🏃💑❤😂😉
😋😒😭👶😸🐟🍒🍔💣📌📖🔨🎃🎈🎨🏈
🏰🌏🔌🔑 and many more...
😉
28

More Related Content

Similar to Analysis with Stata Example Dataset

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
Command Prompt., Inc
 
CBO Basics: Cardinality
CBO Basics: CardinalityCBO Basics: Cardinality
CBO Basics: Cardinality
Sidney Chen
 

Similar to Analysis with Stata Example Dataset (10)

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
 
Using histograms to get better performance
Using histograms to get better performanceUsing histograms to get better performance
Using histograms to get better performance
 
MariaDB: Engine Independent Table Statistics, including histograms
MariaDB: Engine Independent Table Statistics, including histogramsMariaDB: Engine Independent Table Statistics, including histograms
MariaDB: Engine Independent Table Statistics, including histograms
 
JF608: Quality Control - Unit 3
JF608: Quality Control - Unit 3JF608: Quality Control - Unit 3
JF608: Quality Control - Unit 3
 
CBO Basics: Cardinality
CBO Basics: CardinalityCBO Basics: Cardinality
CBO Basics: Cardinality
 
Customer Clustering for Retailer Marketing
Customer Clustering for Retailer MarketingCustomer Clustering for Retailer Marketing
Customer Clustering for Retailer Marketing
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreAdvanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & more
 
Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
 

More from Farhin Islam

More from Farhin Islam (12)

Why should you donate blood?
Why should you donate blood?Why should you donate blood?
Why should you donate blood?
 
Determinants of Methane Emission in Bangladesh: Time Series Research
Determinants of Methane Emission in Bangladesh: Time Series ResearchDeterminants of Methane Emission in Bangladesh: Time Series Research
Determinants of Methane Emission in Bangladesh: Time Series Research
 
Skill hunt
Skill huntSkill hunt
Skill hunt
 
Important SDGs for Bangladesh
Important SDGs for BangladeshImportant SDGs for Bangladesh
Important SDGs for Bangladesh
 
Food poverty paper presentation
Food poverty paper presentationFood poverty paper presentation
Food poverty paper presentation
 
A cross Country Analysis to Determine the Causes of 'Growth without Development'
A cross Country Analysis to Determine the Causes of 'Growth without Development'A cross Country Analysis to Determine the Causes of 'Growth without Development'
A cross Country Analysis to Determine the Causes of 'Growth without Development'
 
Social safety nets: Problems and solutions
Social safety nets: Problems and solutionsSocial safety nets: Problems and solutions
Social safety nets: Problems and solutions
 
Datageek: An app based data system
Datageek: An app based data systemDatageek: An app based data system
Datageek: An app based data system
 
Data analysis in social sciences
Data analysis in social sciencesData analysis in social sciences
Data analysis in social sciences
 
Carbon emission: Global and Bangladesh perspective
Carbon emission: Global and Bangladesh perspectiveCarbon emission: Global and Bangladesh perspective
Carbon emission: Global and Bangladesh perspective
 
What you must know about Foreign Direct Investment (FDI)
What you must know about Foreign Direct Investment (FDI)What you must know about Foreign Direct Investment (FDI)
What you must know about Foreign Direct Investment (FDI)
 
Factors influencing trade balance: case of Bangladesh
Factors influencing trade balance: case of BangladeshFactors influencing trade balance: case of Bangladesh
Factors influencing trade balance: case of Bangladesh
 

Recently uploaded

sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444
saurabvyas476
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
varanasisatyanvesh
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh +966572737505 get cytotec
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
wsppdmt
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
yulianti213969
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Abortion pills in Jeddah |+966572737505 | get cytotec
Abortion pills in Jeddah |+966572737505 | get cytotecAbortion pills in Jeddah |+966572737505 | get cytotec
Abortion pills in Jeddah |+966572737505 | get cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
LuisMiguelPaz5
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 

Recently uploaded (20)

5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
 
DS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .pptDS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .ppt
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptx
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Abortion pills in Jeddah |+966572737505 | get cytotec
Abortion pills in Jeddah |+966572737505 | get cytotecAbortion pills in Jeddah |+966572737505 | get cytotec
Abortion pills in Jeddah |+966572737505 | get cytotec
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
Huawei Ransomware Protection Storage Solution Technical Overview Presentation...
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTSDBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 

Analysis with Stata Example Dataset

  • 2. Import “GPA 2_1.dta” FROM MENU  File  Import  Excel Spreadsheet  Browse and select  Import 1st row as variable name  OK Command: use "D:Session 3 4 Nazmul Hossaingpa2_1.dta“ br
  • 3. Merge FROM MENU  Data  Combine dataset  Merge two datasets  One to one  Key Variable: Id  Browse “GPA 2_2.dta” Command: merge 1:1 id using "C:UsersDept. of EconomicsDesktopBER 20_04_2019gpa2_2.dta"
  • 5. Labeling Variables ▸ label variable sat "combined SAT score" ▸ label variable tothrs "total hours through fall semest" ▸ label variable colgpa "GPA after fall semester" ▸ label variable athlete "=1 if athlete" ▸ label variable hsize "size graduating class, 100s" ▸ label variable hsrank "rank in graduating class" ▸ label variable hsperc "100*(hsrank/hssize)" ▸ label variable female "=1 if female" ▸ label variable white "=1 if white" ▸ label variable black "=1 if black" ▸ label variable hsizesq "hsize^2" ▸ label variable verbmath "verbal/math SAT score"
  • 6. Labeling Values (for dummy variables) ▸ label define black_lbl 0 "Non-black" 1 "Black" ▸ label values black black_lbl ▸ label define white_lbl 0 "Non-white" 1 "White" ▸ label values white white_lbl ▸ label define athlete_lbl 0 "Non-athlete" 1 "Athlete" ▸ label values athlete athlete_lbl ▸ label define female_lbl 0 "Male" 1 "Female" ▸ label values female female_lbl
  • 7. Generating New Variables (log form) ▸ gen lsat=ln(sat) ▸ gen ltothrs=ln( tothrs) ▸ gen lcolgpa=ln( colgpa) ▸ label var lsat "ln of sat" ▸ label var ltothrs "ln of tothrs" ▸ label var lcolgpa "ln of colgpa"
  • 8. Egen Command ▸ egen meangpa=mean(colgpa) Mean of colgpa= 2.652685
  • 9. Recoding “colgpa” ▸ recode colgpa (min/1.99=1 "Low GPA") (2/3.49=2 "Moderate GPA") (3.5/max=3 "High GPA"), gen(ggpa) GPA after fall semester Label 0-1.99 Low GPA 2-3.49 Moderate GPA 3.5-4 High GPA
  • 10. Tabulate “ggpa” ▸ tab ggpa RECODE of colgpa (GPA after fall semester) Freq. Percent Cum. Low GPA 592 14.31 14.31 Moderate GPA 3087 74.62 88.93 High GPA 458 11.07 100.00
  • 11. Describe ▸ des obs: 4,137 GPA 2 vars: 18 25 Apr 2019 02:06 size: 297,864 ---------------------------------------------------------------------------------------------------------------------------------- storage display value variable name type format label variable label ---------------------------------------------------------------------------------------------------------------------------------- id float %9.0g sat float %9.0g combined SAT score tothrs float %9.0g total hours through fall semest colgpa float %9.0g GPA after fall semester athlete float %11.0g athlete_lbl =1 if athlete verbmath float %9.0g verbal/math SAT score hsize float %9.0g size graduating class, 100s hsrank float %9.0g rank in graduating class hsperc float %9.0g 100*(hsrank/hssize) female float %9.0g female_lbl =1 if female white float %9.0g white_lbl =1 if white black float %9.0g black_lbl =1 if black hsizesq float %9.0g hsize^2 lsat float %9.0g ln of sat ltothrs float %9.0g ln of tothrs lcolgpa float %9.0g ln of colgpa meangpa float %9.0g ggpa float %12.0g ggpa RECODE of colgpa (GPA after fall semester) ---------------------------------------------------------------------------------------------------------------------------------- Sorted by: id
  • 12. Summarize ▸ sum sat tothrs colgpa hsize hsrank hsperc athlete female white black Variable Obs Mean Std.Dev. Min Max sat 4137 1030.331 139.401 470 1540 tothrs 4137 52.832 35.33 6 137 colgpa 4137 2.653 .659 0 4 hsize 4137 2.8 1.737 .03 9.4 hsrank 4137 52.83 64.684 1 634 hsperc 4137 19.237 16.569 .167 92 athlete 4137 .047 .211 0 1 female 4137 .45 .498 0 1 white 4137 .926 .263 0 1 black 4137 .055 .229 0 1 TABLE: Descriptive Statistics
  • 13. Crosstab ▸ tab athlete black, row Athlete=1 if athlete Black=1 if black 0 1 Total 0 3758 185 3943 95.31 4.69 100.00 1 150 44 194 77.32 22.68 100.00 Total 3908 229 4137 94.46 5.54 100.00 Tabulation of athlete black First row has frequencies and second row has row percentages
  • 14. “ graph pie, over(female) plabel(_all percent, color(white) size(medium))
  • 15. “ graph bar (count), over(ggpa) blabel(bar)
  • 17. Scatter plot colgpa vs tothrs lcolgpa vs ltothrs colgpa vs sat lcolgpa vs lsat
  • 18. Regression reg lcolgpa lsat ltothrs hsize hsizesq athlete female black
  • 19.
  • 20. There is no multicollinearity problem Post-estimation: Checking for multicollinearity . corr lsat ltothrs hsize athlete female black | lsat ltothrs hsize athlete female black -------------+--------------------------------------------------------------------- lsat | 1.0000 ltothrs | 0.0121 1.0000 hsize | 0.0652 -0.0397 1.0000 athlete | -0.2079 0.0107 0.0493 1.0000 female | -0.1446 0.0314 -0.0042 -0.0970 1.0000 black | -0.2533 -0.0054 -0.0575 0.1663 0.0213 1.0000
  • 21. . estat imtest, white White's test for Ho: homoskedasticity against Ha: unrestricted heteroskedasticity chi2(31) = 183.61 Prob > chi2 = 0.0000 Cameron & Trivedi's decomposition of IM-test ------------------------------------------------------------- Source | chi2 df p ---------------------+--------------------------------------- Heteroskedasticity | 183.61 31 0.0000 Skewness | 63.89 7 0.0000 Kurtosis | 10.33 1 0.0013 ---------------------+---------------------------------------- Total | 257.82 39 0.0000 --------------------------------------------------------------- There is heteroscedasticity problem Post-estimation: Checking for heteroscedasticity
  • 22. There is no Specification bias problem Post-estimation: Checking for specification bias . estat ovtest Ramsey RESET test using powers of the fitted values of lcolgpa Ho: model has no omitted variables F(3, 4124) = 1.26 Prob > F = 0.2854
  • 23.
  • 24. Robust standard errors in parentheses *** p<0.01, ** p<0.05, * p<0.1 From STATA to MS Word outreg2 command outreg2 using “myfile.doc", replace ctitle(model)
  • 25. From STATA to MS Word ssc install asdoc asdoc command run
  • 27. 27 SlidesCarnival icons are editable shapes. This means that you can: ● Resize them without losing quality. ● Change line color, width and style. Isn’t that nice? :) Examples:
  • 28. Now you can use any emoji as an icon! And of course it resizes without losing quality and you can change the color. How? Follow Google instructions https://twitter.com/googledocs/status/730087240156643328 ✋👆👉👍👤👦👧👨👩👪💃🏃💑❤😂😉 😋😒😭👶😸🐟🍒🍔💣📌📖🔨🎃🎈🎨🏈 🏰🌏🔌🔑 and many more... 😉 28