# Graphical Output

Nonlinear regression programs provide a variety of graphical output. These plots can be very in understanding the quality of the fit to the data.

## Calculated and Observed Data versus Time

This is a fairly basic graph but it can point out simple errors in data entry or model specification. Data entry errors may show up as unexplained outliers. Model mis-specification may result in data points in one direction and line in another. Unfortunately too commonly observed...more subtle systematic deviations might suggest modification of the model.

Figure 9.5.1 Linear plot of Cp versus time - Two compartment fit to two compartment data (Wt 2)

Figure 9.5.2 Semi-log plot of Cp versus time - Two compartment fit to two compartment data (Wt 2)

Figure 9.5.1 and 9.5.2 are plots of calculated and observed data illustrating excellent fits to the data.

Figure 9.5.3 Linear plot of Cp versus time - One compartment fit to two compartment data (Wt 2)

Notice the systematic deviations between the calculated line and the observed data in Figure 9.5.3. There are large positive, then negative and finally positive deviation as time progresses. This is even more obvious on the semi-log plot below.

Figure 9.5.4 Semi-log plot of Cp versus time - One compartment fit to two compartment data (Wt 2)

## Calculated versus Observed Data

Another technique for looking at these same data to plot the observed data versus the calculated data. This can be a sensitive way of 'seeing' systematic deviations.

Figure 9.5.5 Linear plot of Calculated versus Observed data - Two compartment fit to two compartment data (Wt 2)

A good fit is represented by linear plot of Calculated versus Observed data with a slope of 1. As mentioned before a correlation coefficient close to one would also be expected. In Figure 9.5.6 a fit with the wrong model produces systematic deviations from a straight line.

Figure 9.5.6 Linear plot of Calculated versus Observed data - One compartment fit to two compartment data (Wt 2)

## Weighted Residual versus Time Plot

Weighted residual plots can be very useful in the determination of a best model and confirmation of the chosen weighting scheme (1, 2).

Figure 9.5.7 Plot of standardized weighted residual versus time - Two compartment fit to two compartment data (Wt 2)

Notice, no pattern! Well nothing obvious. This is indicative of a good fit with an acceptable weighting scheme.

Figure 9.5.8 Plot of standardized weighted residual versus time - One compartment fit to two compartment data (Wt 2)

In Figure 9.5.8 there is a definite pattern. Can you see the 'U' shape. This is a plot illustrating a fit with a model that is too small (by two parameters - 'U'). From the previous, Figure we can see that the bigger, two compartment model, is better.

Figure 9.5.9 Plot of standardized weighted residual versus time - Two compartment fit to two compartment data (Wt 0)

This figure is the result of fitting with the better model but with a weighting scheme that might be the best choice. Can you see a pattern? A funnel shape, rotated to the left? Weighted residuals of larger magnitude at one end of the time (which correlates with concentration scale) scale versus the weighting scheme could be better. Compare this plot with Figure 9.5.7 to see a difference.

## Weighted Residual versus ln(Calculated Data) Plot

Plotting the weighted residual versus the natural logarithm of the calculated data (3) instead of time produces a slightly different view. The same observations as before apply. A random scatter of points indicate a good model and weighting scheme.

Figure 9.5.10 Plot of standardized weighted residual versus ln(calculated data) - Two compartment fit to two compartment data (Wt 2)

As in Figure 9.5.7 there appears to be reasonable scatter in the data with little appearance of a pattern.

Figure 9.5.11 Plot of standardized weighted residual versus ln(calculated data) - One compartment fit to two compartment data (Wt 2)

There is an obvious 'U' pattern when analyzing these results using a model that is too small. In this case a one compartment model instead of the better two compartment model.

Figure 9.5.12 Plot of standardized weighted residual versus ln(calculated data) - Two compartment fit to two compartment data (Wt 0)

It is harder to say with confidence that this plot has more or less scatter (randomness) than Figure 9.5.10. Thus, it is difficult to rule out either weighting scheme with this plot. Modeling is not always clear cut. There may be conflicting results with different criteria. Choosing a best weighting scheme should start with an analysis of error in the data assay or collection process. These weighted residual plots are better used to confirm a weighting scheme than choosing between alternate weighting schemes.

References
1. Draper, N.R. and Smith, H. 1966 Applied Regression Analysis, Wiley, New York, NY, p 86-100
2. Boxenbaum, H.G., Riegelman, S., and Elashoff, R.M. 1974 "Statistical Estimation in Pharmacokinetics", J. Pharmacokin. Biopharm., 2, p 123-148
3. Davidian, M. and Giltinan, D.M. 1995 Nonlinear Models for Repeated Measurement Data, Chapman and Hall, London, p 48