Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

segraph

Stata command for scatter or line plots of group means with error bars.

Installation

net install segraph, from("https://raw.githubusercontent.com/MalcolmWardlaw/segraph/main/")

Syntax

segraph varlist [if] [in] [aweight], by(varname) [options]

Options

Option Description
by(varname) Grouping variable for the x-axis (required)
subpop(varname) Split series by subpopulation levels (up to 8)
line Connected lines instead of scatter points
nose Suppress error bars
scale(#) Error bar multiplier (default: 1.96)
ci(#) Confidence interval percent, 1--99 (e.g., ci(95))
setype(string) Error type: semean (default), sebinomial, or sd
axis2 Plot 2nd+ variables on right y-axis
refline(numlist) Vertical reference lines
scheme() name() title() subtitle() note() legend() saving() Standard graph options
xlabel() xtitle() xscale() ylabel() ytitle() yscale() Axis options
graphopt(string) Additional twoway options passed through

Examples

webuse nlswork, clear

* Basic scatter of means with error bars
segraph ln_wage hours, by(year)

* Line graph with 90% confidence intervals
segraph ln_wage, by(year) line ci(90)

* Subpopulations by college graduation
segraph ln_wage, by(year) subpop(collgrad)

* Dual axis with title
segraph ln_wage hours, by(year) axis2 title("Wages and Hours over Time")

* Weighted means with standard deviation bars
segraph ln_wage [aw=hours], by(year) setype(sd)

Author

Malcolm Wardlaw, University of Georgia

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages