------------------------------------------------------------------------------- help forpredxcon-------------------------------------------------------------------------------

Predicted means, medians, or proportions for a continuous X variable

predxconyvar[ifexp] [inrange],xvar(xvar)from(#)to(#)inc(#)[adjust(covlist)poly(#)class(classvar)modelgraphlevel(#)linearmediannolistcluster(cluster_var)savepred(filename)graph_options]

Description

predxconcalculates and prints predicted values and 95% confidence intervals for linear, quantile, or logistic model estimates for a continuous X variable, adjusted for covariates. Default prints predicted values and confidence intervals; model estimates and graph can be shown. Optionally a quadradic or a quadratic and cubic term can be added to the model. An interaction between X and a nominal variable can be estimated and graphed. Dummy variables are created for the nominal variable with the lowest category defaulting to the reference group.

Variables and options required

yvaris the dependent variableIf

yvaris continuous, defaults to linear regressionIf

yvaris binary (0,1), defaults to logistic regression

xvar(xvar)-- continuous independent variable (interval or ordinal)

from(#)-- bottom value forxvar

to(#)-- top value forxvar

inc(#)-- increment size between bottom and top values (defaults to 1)

Options

adjust(covlist)lists any covariates. If none are specified, unadjusted means, medians, or proportions are reported. Covariates are set to their mean, based on observations used in the analysis, or can be set to user specified values (e.g., age=50 gender=1). (Note: if anadjustvariable is nominal with more than 2 categories, it must be defined with dummy variables in theadjustlist, whereas dummy variables are created automatically in thexvaroption)

poly(2 or 3)-- polynomial terms added: 2=quadratic 3=quadradic and cubic (will not work with themedianoption)

class(classvar)-- nominal variable for anxvarbyclassvarinteraction

model-- for display purposes only, this option prints the regression table

graph-- displays graph of predicted values and 95% confidence intervals; ifclass()is requested, confidence intervals are not displayed

level(#)-- specifies the confidence level, in percent, for calculation of confidence intervals (default=95%)

linear-- requests linear regression whenyvaris binary (0,1); if not specified, logistic regression is assumed

median-- requests quantile regression whenyvaris continuous

nolist-- does not print list of predicted values and 95% CIs

cluster(cluster_var)-- Name of cluster variable; adjusts standard errors for intraclass correlation

savepred(filename)-- saves adjusted values and CI's to a Stata file

Examples

. predxcon chol, xvar(age) from(20) to(80) inc(5) adjust(sys hra)Using linear regressin, 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 systolic blood pressure and heart rate; displays predicted values, but does not display model or graph

. predxcon chol, xvar(sys) f(60) t(280) i(20) adj(hra) graph class(race)Using linear regression, calculates the predicted cholesterol values for systolic blood pressure readings from 60 to 300 in 20mm/hg increments by categories of race, adjusted for heart rate; tests for an age by race interaction; displays graph and list of predicted values

. predxcon htn, xvar(chol) f(100) t(300) i(20) class(race) graphUsing logistic regression, calculates the unadjusted probability of hypertension for cholesterol from 100 to 200 in 20-unit increments, by categories of race; displays a likelihood ratio test for interaction; graphs the results

. predxcon htn, xvar(age) f(40) t(80) poly(3) adj(chol=250) graphUsing logistic regression, calculates the probabilitity of hypertension for 1-yr increments of age; terms for age-squared and age-cubed included in model using the poly(3) option; also adjusted to a cholesterol level of 250; displays graph

Author

J.M.Garrett, Professor, School of Medicine, University of North Carolina, Chapel Hill, NC. Email: joanne_garrett@med.unc.edu