**************** **************** ** lincom ** estimates linear combinations of most recently fit model **************** **************** Overview: The logistic or logit command estimates a logistic regression for a binary outcome variable. Lincom can then be used to estimate the expected value and variance of any linear combination of the parameters. Usage: "logistic Dvar X1 X2 X3" Where - Dvar is the disease variable (1=disease, 0=control) Xj are predictor variables "lincom exp" where exp is a linear combination of the coefficients. Use the names associated with the independent variable for each coefficient in the expression e.g. 100*ALC + 40*TOB Summaries: lincom will provide the estimated value of the linear combination on either the log or original scales (see options). It also provides a 95% CI. The standard error may not be too useful if the result is given on the original scale instead of the log scale. All CI's are computed on the log scale and transformed, if necessary. Options: Useful options are level(#) to specify the confidence level and or (equivalent to rrr) to specify that the estimate be given on the odds ratio scale instead of the linear predictor (log) scale. or is the default if the prior command was logistic. **************** **************** ** predict ** predictions / fits & logistic regression **************** **************** Overview: The "logistic" command estimates a logistic regression for a binary outcome variable. To obtain summaries of the fitted probabilities, or the fitted log odds ("X beta") we can use the predict command. Usage: "logistic Dvar X1 X2 X3" Where - Dvar is the disease variable (1=disease, 0=control) Xj are predictor variables "predict pfit" -- gives fitted P( D | X1, X2, X3 ) "predict lgfit, xb" -- gives fitted log odds Summaries: The argument "pfit" is simply a name you choose for the variable that you would like to be the fitted values. Similarly "lgfit" is a name use choose for the fitted log odds. Options: (1) "predict pfit" -- this creates "pfit" as the fitted probability for each observation. Recall that this is just exp(xb)/[1+exp(xb)] where "xb" is the fitted "X beta" for each observation. (2) "predict lgfit, xb" -- this is used to create the variable lgfit which equals the estimated regression log odds, "X beta". **************** **************** ** fracpoly ** Using fractional polynomials (this command not necessary for **************** homework 5, but could be used to help identify function form. **************** Overview: The "fracpoly" command allows use of general polynomial regression models (even using fractional powers such as sqrt(X) = X^{1/2}, and negative powers such as 1/X = X^{-1}). This allows a very flexible curve to be used for a continuous covariate. Usage: "fracpoly logistic chd bmi" "fracplot bmi" Note that the useage of "fracpoly" comes before a general regression command. Summaries: The "fracpoly" function actually uses a variable selection method to chose the powers of X that will be used. This is why the fitting procedure can be somewhat slow. When a model is determined the routine will tell you the powers of X that are used. I don't find the coefficients of these variables interesting, but the shape/form can be shown using the "fracplot bmi" command. This includes the regression model with standard error bars. Options: (1) "fracplot bmi" -- shows the fitted curve with 95% CIs.