![]() fitPlot() was originally designed for students to quickly visualize the results of one- and two-way ANOVAs and simple, indicator variable, and logistic regressions. We are taking this action to make FSA more focused on fisheries applications and to eliminate “black box” functions. It will likely be removed at the end of the year 2001. Note that other aspects of the plot can be changed using the capabilities in PROC SGPLOT including changes to color, line pattern, or thickness, adding reference lines or text on the plot, and so on.We are deprecating fitPlot() from the next version of FSA (v0.9.0). The resulting plot is essentially identical to the one above. Score data=Inplotdata out=Plotdata pred=p uclm=u lclm=l / ilink īand upper=u lower=l x=LWT / transparency=.3 Finally, PROC SGPLOT is used, as above, to produce the desired plot. Without this option, the values would be on the log odds scale. Since a logistic model uses a link function (the logit link), the ILINK option is needed to produce values on the mean (probability) scale. PROC PLM then reads the saved model and the data for scoring and produces the predicted values and confidence limits. LWT is varied over the desired range of 100 to 200. Of course, any desired values could be used instead. Data for scoring (Inplotdata) are then generated with the other three predictors set at their means or reference levels as done by the EFFECTPLOT statement. ![]() In the following statements, the model is refitted and then saved using the STORE statement. The plot can also be produced by storing the fitted model and producing suitable plot data. Title "Effect of mother's weight from 100 to 200" Yaxis values=(0 to 0.5 by 0.1) grid offsetmin=.05 offsetmax=.05 Xaxis values=(100 to 200 by 20) grid offsetmin=.05 offsetmax=.05 Finally, suitable titles are specified to display above the plot.īand upper=_uclm lower=_lclm x=_xcont1 / transparency=.3 Also specified are options to produce a set of grid lines, specify the Y axis label, and add a small offset, within the plot area, beyond the axis ranges. The desired axis ranges are specified in the XAXIS and YAXIS statements. The confidence band is made semi-transparent to allow the grid lines to show from behind. The X axis variable, LWT, appears in this data set with the name _XCONT1. The SERIES and BAND statements specify the variables in the Logfit data representing the predicted values and the upper and lower confidence limits of the confidence band. The NOAUTOLEGEND option turns off the legend that appears by default in the plot produced by PROC SGPLOT which is not particularly helpful for this plot. You might want to display the contents of the Logfit data set to see the variables that are used in the code below. The following PROC SGPLOT statements produce the desired graph using the saved graph data. While the YRANGE= option can be used in the EFFECTPLOT statement (or as a suboption in PLOTS=EFFECT) to limit the probability axis range, there is no corresponding option to limit the X axis range. Suppose that you would like the plot to restrict the LWT range to between 100 and 200 and the probability range to between 0 and 0.5. The EFFECTPLOT statement in the above PROC LOGISTIC step produces the following graph. This name is used in the ODS OUTPUT statement to save the data that produces the plot. The name of the plot, FitPlot, can be found as described in the referenced note above. In the following statements, PROC LOGISTIC fits the desired model and uses the EFFECTPLOT statement to display the fitted model showing the effect of LWT while holding the other predictors fixed. Of interest is a plot of the predicted probability of low birth weight against the LWT predictor, the last weight of the mother. The probability of low birth weight (low=1) is modeled as a function of several predictors. The following example uses data from a low birth weight study presented by Hosmer and Lemeshow (2000). Both methods are illustrated below for a logistic model. Another method that can be used for this type of plot is storing the model and then creating, scoring, and plotting a suitable set of data using the stored model. The most common modification method is to save the data for the graph and then produce the plot as desired using PROC SGPLOT. Most modifications to the appearance of the produced plot must be made using one of the general methods for altering ODS graphs discussed in this note. Limited aspects of the plot can be altered directly in the modeling procedure. ![]() ![]() The predicted (or linear predictor, xβ) values are plotted against one predictor in the model while holding any other predictors at their mean (if continuous) or reference level (if categorical). A plot of the fitted model can be produced by many modeling procedures using either the EFFECTPLOT statement or the PLOTS= option in the PROC statement.
0 Comments
Leave a Reply. |