RINPF
Performs inverse prediction given a fitted simple linear regression model.
Required Arguments
SUMWTF — Sum of products of weights with frequencies from the fitted regression. (Input, if INTCEP = 1)
In the ordinary case when weights and frequencies are all one, SUMWTF equals the number of observations used in the fit of the model.
DFS2 — Degrees of freedom for estimate of σ2. (Input)
If IY0 = 1, DFS2 is the degrees of freedom for error from the fitted regression. If IY0 = 0, DFS2 is the pooled degrees of freedom from the estimate of sigma-squared based on the fitted regression and the additional responses used to compute the mean Y0.
B — Vector of length INTCEP + 1 containing a least-squares solution for the intercept and slope. (Input)
INTCEP
Intercept
Slope
0
 
B(1)
1
B(1)
B(2)
XYMEAN — Vector of length 2 with the mean of the independent and dependent variables, respectively. (Input, if INTCEP = 1)
If INTCEP = 0, XYMEAN is not referenced and can be a vector of length 1.
SSX — Sum of squares for x. (Input)
If INTCEP = 1, SSX is the sum of squares of deviations of x from its mean. If INTCEP = 0, SSX must not be corrected for the mean.
S2s2, the estimate of the variance of the error in the model. (Input)
If IY0 = 1, S2 is the estimate of σ2 from the fitted regression. If IY0 = 0, S2 is the pooled estimate of σ2 based on the fitted regression, and the additional responses used to compute the mean Y0.
Y0 — Value of the response variable for which an interval estimate of the corresponding independent variable value is desired. (Input)
X0HAT — Point estimate of the independent variable. (Output)
XLOWER — Lower limit of the interval estimate for the independent variable. (Output)
XUPPER — Upper limit of the interval estimate for the independent variable. (Output)
Optional Arguments
INTCEP — Intercept option. (Input)
Default: INTCEP = 1.
INTCEP
Action
0
An intercept is not in the model.
1
An intercept is in the model.
CONPER — Confidence level for the interval estimation. (Input)
CONPER must be expressed as a percentage between 0.0 and 100.0. CONPER often will be 90.0, 95.0, 99.0. For one-sided confidence intervals with confidence level ONECL, set CONPER = 100.0  2.0 * (100.0  ONECL).
Default: CONPER = 95.0.
IY0 — Option for Y0. (Input)
Default: IY0 = 1.
IY0
Action
0
Y0 is a sample mean of one or more responses.
1
Y0 is the true mean response.
SWTFY0 — Sum of products of weights with frequencies for Y0. (Input, if IY0 = 0)
In the ordinary case, when weights and frequencies are all one, SWTFY0 is the number of observations used to obtain the mean Y0. If IY0 = 1, SWTFY0 is not referenced.
FORTRAN 90 Interface
Generic: CALL RINPF (SUMWTF,DFS2 , B , XYMEAN , SSX , S2 , Y0 , X0HAT, XLOWER , XUPPER [])
Specific: The specific interface names are S_RINPF and D_RINPF.
FORTRAN 77 Interface
Single: CALL RINPF (SUMWTF,DFS2 , INTCEP, B , XYMEAN , SSX , S2 , CONPER , IY0, SWTFY0, Y0, X0HAT, XLOWER , XUPPER)
Double: The double precision name is DRINPF.
Description
Routine RINPF computes a confidence interval on the independent variable setting x0 for a given response y0 from the results of a straight line fit. Here, y0 may represent the mean of k responses or the true mean response. The results of routine RLINE or RONE can be used for input into RINPF. The simple linear regression model is assumed,
where the ɛi’s are independently distributed normal errors with mean zero and variance σ2/wi. Here, n is the total number of observations used in the fit of the line, i.e., n = DFE + INTCEP + 1 where DFE is the degrees of freedom from the fitted regression. Also, k is the number of additional responses used to determine y0. The wi’s are the weights that must be used in the fit of the model. The methodology is discussed by Graybill (1976, pages 280283). For the case when IY0  = 1, the estimate of σ2s2 (stored in S2), is the usual estimate of σ2 from the fitted regression based on the first n observations. If IY0 = 0, the estimate of σ2 is a pooled estimator based on the fitted regression and the k responses that produce .
This pooled estimator (stored in S2) is given by
where (n  2) + (k  1) (stored in DFS2) is the pooled degrees of freedom for s2.
First, a point estimate (stored in X0HAT) is computed by
Then, a test of the hypothesis H0 : β1 = 0 vs. Ha : β1  0 is performed. If H0 is accepted, the model becomes yi = β0 + ɛi, and therefore no confidence interval exists for x0 because it is no longer in the model. In this case, a type 3 warning error is issued. If H0 is rejected, a confidence interval exists and is computed for the case IY0 = 1 by
where
and t is the 50 + CONPER/2 percentile of the t distribution with DFS2 degrees of freedom. The interval actually has a confidence coefficient less than that specified by CONPER.
In the weighted case, which was discussed earlier, the means (stored in XYMEAN) and the sum of squares for x (stored in SSX) are all weighted. When the variances of the ɛi’s are all equal, ordinary least squares must be used, this corresponds to all wi = 1.
Modifications are necessary to the preceding discussion for other cases. For the case when an intercept is not in the model, let the pooled degrees of freedom of s2 equal to (n  1) + (k  1), and replace the first term under the square root symbol with zero, with zero, and with zero.
For the case of the true response mean, i.e, when IY0 = 1, replace the second term under the square root symbol by zero.
Comments
Informational errors
Type
Code
Description
3
2
The slope is not significant at the (100  CONPER)% level. Confidence limits XLOWER and XUPPER cannot be obtained.
Example
This example fits a line to a set of data discussed by Draper and Smith (1981, Table 1.1, page 9). The response y is the amount of steam used per month (in pounds), and the independent variable x is the average atmospheric temperature (in degrees Fahrenheit). A 95% confidence interval for the temperature x0 is computed given a single response of y0 = 10.
 
USE RINPF_INT
USE RLINE_INT
USE UMACH_INT
 
IMPLICIT NONE
INTEGER NOBS
PARAMETER (NOBS=25)
!
INTEGER INTCEP, IY0, NOUT
REAL B(2), B0, B1, CONPER, DFS2, S2, SSX, STAT(12), &
SUMWTF, SWTFY0, X0HAT, XDATA(NOBS), XLOWER, XUPPER, &
XYMEAN(2), Y0, YDATA(NOBS)
!
DATA XDATA/35.3, 29.7, 30.8, 58.8, 61.4, 71.3, 74.4, 76.7, 70.7, &
57.5, 46.4, 28.9, 28.1, 39.1, 46.8, 48.5, 59.3, 70.0, 70.0, &
74.5, 72.1, 58.1, 44.6, 33.4, 28.6/
DATA YDATA/10.98, 11.13, 12.51, 8.4, 9.27, 8.73, 6.36, 8.5, &
7.82, 9.14, 8.24, 12.19, 11.88, 9.57, 10.94, 9.58, 10.09, &
8.11, 6.83, 8.88, 7.68, 8.47, 8.86, 10.36, 11.08/
!
CALL RLINE (XDATA, YDATA, B0, B1, STAT=STAT)
SUMWTF = NOBS
DFS2 = STAT(10)
INTCEP = 1
B(1) = B0
B(2) = B1
XYMEAN(1) = STAT(1)
XYMEAN(2) = STAT(2)
SSX = STAT(3)*(NOBS-1)
S2 = STAT(11)/STAT(10)
CONPER = 95.0
IY0 = 0
SWTFY0 = 1.0
Y0 = 10.0
CALL RINPF (SUMWTF, DFS2, B, XYMEAN, SSX, S2, Y0, X0HAT, XLOWER, &
XUPPER, IY0=IY0, SWTFY0=SWTFY0)
CALL UMACH (2, NOUT)
 
 
WRITE (NOUT,*) 'X0HAT = ', X0HAT
WRITE (NOUT,*) '(XLOWER,XUPPER) = (', XLOWER, ',', XUPPER, ')'
END
Output
 
X0HAT = 45.3846
(XLOWER,XUPPER) = (20.2627,69.347)