.- help for ^regpred2^ (STB-33: sg42.1) .- Display predictions from ordinary or two-stage linear regression ---------------------------------------------------------------- ^regpred2^ yvar xvar [^if^ exp]^,^ ^f^rom^(^#^)^ ^t^o^(^#^)^ [ ^i^nc^(^#^)^ ^a^djust^(^covlist^)^ ^inst(^ivlist^)^ ^o^ne^(^varlist^)^ ^z^ero^(^varlist^)^ ^lev^el^(^#^)^ ^p^oly^(^#^)^ ^nom^odel ^nol^ist ^nop^lot graph_options ] Description ----------- Like ^regpred^ published by Joanne Garrett in STB-26, ^regpred2^ displays the predicted values and their confidence intervals from a linear regression for selected values of a continuous ^xvar^. By default, both ^regpred2^ and ^regpred^ display the regression estimates and a plot and listing of the requested predictions. ^regpred2^ contains four additional options not included in the original ^regpred^ program: ^inst^, ^one^, ^zero^ and ^level^. The ^inst^ option adds the capability for two-stage least squares by allowing the user to specify a list of instrumental variables. The ^one^ and ^zero^ options allow the user to specify that some of the covariates listed in option ^adjust^ are to be set equal to one or zero instead of to their means. The ^level^ option allows forecast intervals to be set to confidence levels determined by the user rather than only to 95% confidence levels. (^regpred2^ also implements standard STATA usage by allowing the global macro S_level to determine the default confidence level for the command.) Options ------- ^adjust(^covlist^)^ specifies the other covariates in the model all of which are set to their sample means in computing the predicted values unless the ^one^ or ^zero^ options are specified as described below. ^from(^#^)^ specifies the lowest value of ^xvar^ for which a prediction is to be calculated. This option is required. ^inc(^#^)^ specifies the increment between adjacent values of ^xvar^. The default increment is 1. ^inst(^ivlist^)^ specifies that the regression is to be estimated by two-stage least squares and provides the list of instrumental variables to be used. See the description of two-stage least squares estimation in the help file and in the manual description of the ^regress^ command for details. ^level(^#^)^ specifies the confidence level to be used in computing and displaying the forecast interval. ^nolist^ suppresses the list of predicted values. ^nomodel^ suppresses the display of the estimated regression. ^noplot^ suppresses the graph of predicted values. ^one(^varlist^)^ specifies a subset of ^covlist^ to be set to one instead of to their mean values in the data. ^poly(^#^)^ indicates that ^xvar^ enters the model as a polynomial. Quadratic (^poly(2)^) and cubic (^poly(3)^) models are allowed. The polynomial terms are created and entered in the regression automatically. ^to(^#^)^ specifies the highest value of ^xvar^ for which a prediction is to be calculated. This option is required. ^zero(^varlist^)^ specifies a subset of ^covlist^ to be set to zero instead of to their mean values in the data. graph-options allowed include ^xlabel^, ^ylabel^, ^saving(^filename^)^, and ^titles^. Examples -------- . ^regpred2 chol age, from(20) to(80) inc(5) adj(fat smk race) noplot^ Calculates the predicted cholesterol values for 5 year increments of age from 20 years to 80 years (i.e., age=20,25,30,...,80) adjusted for fat in the diet, smoking status, and race; displays model and predicted values but does not display graph. . ^regpred2 chol age, from(20) to(80) inc(5) adj(fat smk race) zero(race)^ Same as above example, except predictions are for the race corresponding to ^race^ == 0 instead of for the sample average of race. Graph is displayed. . ^regpred2 chol sys, f(60) t(300) i(20) adj(age smk) ylab xlab^ Calculates the predicted cholesterol values for systolic blood pressure readings from 60 to 300 in 20 mm/hg increments, adjusted for age and smoking status; displays model, graph, and predictions. . ^regpred2 chol age, f(40) t(80) poly(3) adj(sys) xlab ylab nolist^ Calculates the predicted cholesterol values for 1 year increments of age; terms for age-squared and age-cubed included in model using the poly(3) option; also adjusted for systolic blood pressure; displays model and graph; does not list predictions and 95% CIs. . ^regpred2 chol sys, f(60) t(300) i(20) adj(age smk) inst(age smk race)^ Calculates the predicted cholesterol values for systolic blood pressure readings from 60 to 300 in 20 mm/hg increments, adjusted for age and smoking status, under the assumption that systolic blood pressure contains a component that is systematically correlated with the disturbance term. This would be true if the variable sys is measured with error or if sys is determined by chol as well as a determinant of chol. The variables age, smk and race are assumed to be valid exogenous instruments. Displays model, graph, and predictions. . ^regpred2 chol age, f(40) t(80) adj(sys smk) inst(age smk race) level(90)^ Same as previous example, except predictions are calculated for age instead of for sys and the confidence level for the forecast interval is set to 90%. Author ------ Mead Over World Bank FAX: 202-522-3230 Also see -------- STB: STB-33, sg42.1; STB-26, sg42; STB-24, sg33 Manual: [R] regress On-line: help for @regress@, @level@, @regpred@ (if installed), @logpred@ (if installed), @adjmean@ (if installed), @adjprop@ (if installed)