Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Creating a Line Graph of Life Expectancy for Males and Females in the US, Slides of Econometrics and Mathematical Economics

Instructions on how to create a line graph using stata software to visualize the life expectancy trends for males and females in the us from 1900 to 2000. Various aspects of customizing the graph, such as adjusting labels, tick marks, titles, and legend positions.

Typology: Slides

2011/2012

Uploaded on 11/10/2012

uzman
uzman 🇮🇳

4.8

(12)

148 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Making Professional Graphs
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27

Partial preview of the text

Download Creating a Line Graph of Life Expectancy for Males and Females in the US and more Slides Econometrics and Mathematical Economics in PDF only on Docsity!

Making Professional Graphs

OBJECTIVES The main objectives are: ™In depth analysis of line graph ™In depth analysis of scatter graph ™Working with^ labels,^ legend^

and^ other

graphing options.

Line Graphs To get the same^ graph,^ we^ can^ simply

write^ the

previous command as follows: line^ le_female le_male year

80 70 60 50 40 1900 1920 1940 1960

(^1980 2000) YearLife expectancy, females Life expectancy, males

The^ same^ Graph^ is shown.

Line Graphs We can modify the ‘X labels’ and ‘Y labels’.For ‘X labels’, type the command: line le_male le_female year, xlabel(1900(10)2000) 80 70 60 50 40 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990

(^2000) Year Life expectancy, males^ Life expectancy, females

Line Graphs We can do the same for the ‘Y-axis’. 80 70 60 50 40 1900 1910 1920 1930 1940 1950 1960 1970 1980

(^1990 2000) YearLife expectancy, males Life expectancy, females

line le_male le_female year, xlabel(1900(10)2000)xtic(1900(5)2000) ylabel(35(10)80) ytic(35(5)80)

Line Graphs Add a title to your graph.For this just add the title commands at the end of yourgraph.The command is: line le_male le_female year, xlabel(1900(10)2000)xtic(1900(5)2000) ylabel(35(10)80) ytic(35(5)80)title("LIFE EXPECTANCY OF MALES &FEMALES OF US ") xtitle("NO OF YEARS")ytitle("LIFE EXPECTANCY")

10

Line Graphs The graph is shown below: 75 65 55 LIFE EXPECTANCY 45 35 1900 1910 1920 1930 1940 1950 1960 1970 1980

(^1990 2000) NO OF YEARS LIFE EXPECTANCY OF MALES & FEMALES OF USLife expectancy, males^ Life expectancy, females

11

Line Graphs We can also adjust the size of the titles and also their marginfrom the graph.Just type the following command: line le_male le_female^ year,^ xlabel(1900(10)2000)xtic(1900(5)2000) ylabel(35(10)80)^ ytic(35(5)80)

title("LIFE EXPECTANCY OF MALES & FEMALES OF US ", size(large)margin(medium))^ xtitle("NO

OF^ YEARS",^ size(medium) margin(small))^ ytitle("LIFE

EXPECTANCY",^ size(medium) margin(small))

13

Line Graphs Now make the X and Y labels small. i.e. make the font of xlabels (1900, …etc) small. line le_male le_female^ year,^ xlabel(1900(10)2000,

labs(small)) xtic(1900(5)2000)^ ylabel(35(10)

,^ labs(small) )^ ytic(35(5)80) title("LIFE EXPECTANCY OF MALES & FEMALES OF US ",size(large)^ margin(medium))

xtitle("NO^ OF^ YEARS", size(medium)^ margin(small))

ytitle("LIFE^ EXPECTANCY", size(medium) margin(small))

14

Line Graphs The graph is shown below: 75 65 55 45 LIFE EXPECTANCY 35 1900 1910 1920 1930 1940 1950 1960 1970 1980

(^1990 2000) NO OF YEARS LIFE EXPECTANCY OF MALES & FEMALES OF USLife expectancy, males^ Life expectancy, females

16

Line GraphsThe Stata command is: line le_male le_female^ year,^ xlabel(1900(10)2000,

labs(small)) xtic(1900(5)2000)^ ylabel(35(10)80,

labs(small))^ ytic(35(5)80) title("LIFE EXPECTANCY OF MALES & FEMALES OF US ",size(large)^ margin(medium))

xtitle("NO^ OF^ YEARS", size(medium)^ margin(small))

ytitle("LIFE^ EXPECTANCY", size(medium) margin(small)) leg(pos(6)) Try the following options for the legends: leg(pos(9))leg(pos(3))leg(pos(-3))(Note: The last command will use the default value b/c -3 is out ofrange).

17

Line Graphs The graph is shown: 75 65 55 45 LIFE EXPECTANCY 35 1900 1910 1920 1930 1940 1950 1960 1970

(^1980 1990 2000) NO OF YEARSLife expectancy, males Life expectancy, females LIFE EXPECTANCY OF MALES & FEMALES OF US

19

Line Graphs The graph is shown below: 75 65 55 45 LIFE EXPECTANCY 35 1900 1910 1920 1930 1940 1950 1960 1970

(^1980 1990 2000) NO OF YEARSLife expectancy, malesLife expectancy, females LIFE EXPECTANCY OF MALES & FEMALES OF US

20

Line GraphsYou can also stack the legends one above the other byusing the command: line le_male le_female^ year,^ xlabel(1900(10)2000,

labs(small)) xtic(1900(5)2000)^ ylabel(35(10)80,

labs(small))^ ytic(35(5)80) title("LIFE EXPECTANCY OF MALES & FEMALES OF US ",size(large)^ margin(medium))

xtitle("NO^ OF^ YEARS", size(medium)^ margin(small))

ytitle("LIFE^ EXPECTANCY", size(medium) margin(small)) leg(col(1) stack pos(6))