------------------------------------------------------------------------------- help forsdline-------------------------------------------------------------------------------

SD line (reduced major axis)

sdlineyvarxvar[ifexp] [inrange] [,generate(ysdlvar)nographgraph_options]

Description

sdlineproduces a scatter plot ofyvarversusxvarwith the SD line or reduced major axis superimposed.This line goes through the intersection of the means (mean of

xvar, mean ofyvar) and has slopesign of corr(

xvar,yvar) * (SD ofyvar) / (SD ofxvar)

Options

generate()saves the values ofyvarpredicted from the SD line as a new variable.

graph_optionsare options allowed with twoway scatter. The default options includems(oh none) connect(none l) sort. Know that the data points are plotted first and the SD line second bytwoway scatter. These options include plot_option (Stata 8 only) and addplot_option (Stata 9).

nographsuppresses the graph and is for situations in which only the numerical results for the SD line are desired.

Examples

. sdline length width. sdline length width, gen(length_sd). sdline length width, addplot(lfit length width)

Saved results

r(N)number of observationsr(ymean)mean ofyvarr(ysd)SD ofyvarr(xmean)mean ofxvarr(xsd)SD ofxvarr(slope)slope of SD line

AuthorNicholas J. Cox, Durham University, U.K. n.j.cox@durham.ac.uk

AcknowledgementsAllan Reese found typos in this help.

Also seeOn-line: twoway scatter