{smcl}
{* 15mar2002}{...}
{hline}
help for {hi:avplot2}
{hline}

{title:Partial regression plots for subsamples } 

{p 8 16}{cmd:avplot2} {it:varname} {cmd:,}{cmdab:sep:arate(}{it:varname}{cmd:)} [ {it:graph_options} ]      

{title:Description}

{p}{cmd:avplot2} generates "partial regression plots" from an analysis of covariance
model, where a category variable has been included in dummy-variable form among the regressors 
along with a constant term (that is, a dummy for all but one categories appears) and the full set of 
dummies have been interacted with a continuous variable. The "partial predictions" of
such a model are then defined, for each category, as the category-specific constant term
plus the category-specific slope multiplied by the continuous variable. Any number of additional
covariates, continuous or discrete, may appear in the regression model, but do not affect the
partial predictions.


{title:Remarks} 

{p}One variable must be specified: the continuous variable which has been fully interacted
in the regression model. If there are G categories of the discrete variable, the continuous
variable must be included as G interaction terms, each named {it:categoryvarname} x {it:varname}.
See the example below.

{p}The separate option must specify the integer variable ({it:categoryvarname}) 
that defines the G categories. The model must contain (G-1) dummy variables for all but one
category, and a constant term. It is immaterial which category is excluded.


{title:Options}

{p 0 4} 
{it:graph_options} are options of {cmd:graph, twoway}. One may use, for instance, the saving
option to create a .gph file from the displayed graph.

{p 4 4} 
The defaults include {cmd:connect(l)} for each subset of predicted values. 

{p 0 4}
{cmd:separate(}{it:varname}{cmd:)} specifies the integer variable which defines categories.



{title:Examples}

{p 4 8}{inp:. use auto}

{p 4 8}{inp:. drop if rep78==.}

{p 4 8}{inp:. recode rep78 1/2=2}

{p 4 8}{inp:. tab rep78,gen(repair)}

{p 4 8}{inp:. rename rep78 repair}

{p 4 8}{inp:. forv i=1/4 { g repair`i'xmpg = mpg*repair`i' } }

{p 4 8}{inp:. reg price length foreign repair2-repair4 repair1xmpg repair2xmpg repair3xmpg repair4xmpg } 

{p 4 8}{inp:. avplot2 mpg, sep(repair) }



{title:Author}

    Christopher F Baum, Boston College, USA
    baum@bc.edu
    
    
{title:Acknowledgements} 

    Nick Cox and his routines regplot and keyplot were indispensable in constructing
    this program. Development of the routine was inspired by conversations with Rebekah 
    Coley and Jodi Morris.


{title:Also see}

{p 0 19}On-line:  help for {help regress}, {help graph}, {help regdiag}, 
{help regplot} (if installed), {help sparl} (if installed)  
{p_end}
{p 1 19}Manual: {hi: [U] 21 Programming Stata} 
{p_end}