------------------------------------------------------------------------------- name: log: Q:\C-modelling\runmlwin\website\logfiles\2020-03-27\16\6.1.smcl log type: smcl opened on: 27 Mar 2020, 18:21:49 . **************************************************************************** . * Module 6: Regression Models for Binary Responses Stata Practicals . * . * P6.1: Preliminaries: Mean and Variance of Binary Data . * . * George Leckie . * Centre for Multilevel Modelling, 2010 . **************************************************************************** . * Stata do-file to replicate all analyses using runmlwin . * . * George Leckie . * Centre for Multilevel Modelling, 2013 . * http://www.bristol.ac.uk/cmm/software/runmlwin/ . **************************************************************************** . . use "http://www.bristol.ac.uk/cmm/media/runmlwin/6.1.dta", clear . . describe Contains data from http://www.bristol.ac.uk/cmm/media/runmlwin/6.1.dta obs: 5,366 vars: 10 2 Aug 2013 17:08 ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- comm int %9.0g Community ID womid int %9.0g Woman ID antemed byte %9.0g Antenatal from qualified medic cons byte %9.0g Constant bord byte %9.0g Birth order mage byte %9.0g Mother's age at birth urban byte %9.0g Type of region of residence meduc byte %9.0g Maternal education islam byte %9.0g Religion wealth byte %9.0g Wealth index (1 = poorest) ------------------------------------------------------------------------------- Sorted by: . . . . * P6.1.1 Mean and standard deviation of the response variable . . tabulate antemed Antenatal | from | qualified | medic | Freq. Percent Cum. ------------+----------------------------------- 0 | 2,613 48.70 48.70 1 | 2,753 51.30 100.00 ------------+----------------------------------- Total | 5,366 100.00 . . summarize antemed Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- antemed | 5,366 .5130451 .4998764 0 1 . . . . * P6.1.2 Bivariate relationships between the response and explanatory . * variables . . scatter antemed mage . . bysort mage: egen propantemed = mean(antemed) . . scatter propantemed mage . . tabulate antemed urban, column +-------------------+ | Key | |-------------------| | frequency | | column percentage | +-------------------+ Antenatal | from | Type of region of qualified | residence medic | 0 1 | Total -----------+----------------------+---------- 0 | 2,138 475 | 2,613 | 58.07 28.21 | 48.70 -----------+----------------------+---------- 1 | 1,544 1,209 | 2,753 | 41.93 71.79 | 51.30 -----------+----------------------+---------- Total | 3,682 1,684 | 5,366 | 100.00 100.00 | 100.00 . . tabulate antemed meduc, column +-------------------+ | Key | |-------------------| | frequency | | column percentage | +-------------------+ Antenatal | from | qualified | Maternal education medic | 1 2 3 | Total -----------+---------------------------------+---------- 0 | 1,272 856 485 | 2,613 | 68.17 51.91 26.20 | 48.70 -----------+---------------------------------+---------- 1 | 594 793 1,366 | 2,753 | 31.83 48.09 73.80 | 51.30 -----------+---------------------------------+---------- Total | 1,866 1,649 1,851 | 5,366 | 100.00 100.00 100.00 | 100.00 . end of do-file