![]() Label define command below creates the value label called foreignl that associates 0 withĭomestic car and 1 with foreign car. This is a two step process where you first define the label, and then you assign the label to the variable. Let’s make a value label called foreignl to label the values of the variableįoreign. Rep78 int %8.0g the repair record from 1978įoreign byte %8.0g the origin of the car, foreign or domestic Mpg int %8.0g the miles per gallon for the car Price int %8.0gc the price of the car in 1978 describe Contains data from /stata/modules/autolab.dta The describe command shows these labels have been applied to the variables. label variable rep78 "the repair record from 1978" label variable price "the price of the car in 1978" label variable mpg "the miles per gallon for the car" label variable foreign "the origin of the car, foreign or domestic" Let’s use the label variable command to assign labels to the variables Obs: 74 This file contains auto data for the year 1978 The describe command shows that this label has been applied to the version that is currently in memory. label data "This file contains auto data for the year 1978" This label can be up to 80 characters long. Let’s use the label data command to add a label describing the data file. Variable name type format label variable label ![]() Size: 3,478 (99.9% of memory free) (_dta has notes) ![]() Let’s use the describe command to verify that indeed this file does not have any labels. Let’s use a file calledĪutolab that does not have any labels. Stata allows you to label your data file ( data label), to label the variables within your data file ( variable labels), and to label the values for your variables ( value labels). (I tried to upload the graph but it does not show on the preview, I hope it shows.)Ĭode: * Example generated by -dataex-.This module will show how to create labels for your data. I tried adding a horizontal line on top with: yline(1984 2000, lcolor(black) lstyle(foreground)), but that did not do anything. || rcap ub lb yob if east=0, lcolor(black) || scatter `scatter1' || area `area2' xline(1990.6, lcolor(black) lpattern(dash)) Twoway area `area' xline(1989.8 1993, lcolor(black) lpattern(dash)) ytitle("Smoking Rates") Local scatter2 mean yob if east=1, connect(direct) lcolor(blue) mcolor(blue) xlabel(#15) xla(, ang(45)) plotregion(margin(zero)) Local scatter1 mean yob if east=0, connect(direct) lcolor(black) mcolor(black) msymbol(triangle) Local area2 upper y if inrange(y, 1990, 1993), bcolor(ltbluishgray) base(0) ![]() Local area upper y if inrange(y, 1989.8, 1990.6), bcolor(bluishgray) base(0) Statsby mean=r(mean) ub=r(ub) lb=r(lb) N=r(N), by(yob east) clear: ci means smoking (Thanks to Nick Cox I figured out everything else - thank you so much, Nick!) I cannot get two lines to show on my twoway graph: The top line of the x-axis where I added two area graphs and a vertical line (at 1990.6) where the two area graphs meet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |