The following discusses estimation of a ratio of functions of model parameters. Procedures to estimate other ratios such as risk (prevalence) ratios, odds ratios, hazard ratios, ratios of means are mentioned in the list of FrequentlyAsked for Statistics.
Two methods for estimating the confidence limits for a ratio will be discussed using the common example of estimation of the ED50 and the relative potency. In bioassay studies that investigate the effect of various doses of one or more drugs, the ED50 is the dose at which 50% of the subjects respond. The relative potency is the ratio of doses of two drugs that produce the same response. Both the ED50 and the relative potency are estimated as ratios of model parameters in a binary response model.
Stokes et. al. (2000) discuss a study on mice comparing two drugs applied at several doses. The data are presented below.
data assay; input drug $ dose ndead total; ldose=log(dose); datalines; N 0.01 0 30 N 0.03 1 30 N 0.10 1 10 N 0.30 1 10 N 1.00 4 10 N 3.00 4 10 N 10.00 5 10 N 30.00 7 10 S 0.30 0 10 S 1.00 0 10 S 3.00 1 10 S 10.00 4 10 S 30.00 5 10 S 100.00 8 10 ;
A sequence of logistic models fit to the data show that a model with separate intercepts for the drugs but with a common slope fits well. The following statements fit this final model. Note that with the NOINT option the two DRUG parameters are the intercepts for the two drugs. See this note for more on assessing the need for separate slopes when modeling data from multiple groups. The OUTEST= and COVOUT options are not needed to fit the model but provide a data set containing the estimated model parameters and covariance matrix for use later. The STORE statement is used to save the model information for use later by the NLEstimate macro. This data set is displayed by the PROC PRINT step.
proc logistic data=assay outest=parms covout; class drug / param=glm; model ndead/total = drug ldose / noint; store out=assaymod; run; proc print noobs; run;

It is now of interest to estimate the ED50 for each drug as well as their relative potency, and to obtain confidence intervals for them. Stokes et. al. (2000) shows that the estimates of the ED50 for drug N and drug S are a_{N}/b and a_{S}/b, where a_{N} and a_{S} are the estimated drug N and S intercepts, and b is the estimated log dose (LDOSE) parameter, the common slope. They also show that the estimate of the relative potency is (a_{N}  a_{S})/b. Notice that these statistics are ratios of functions of model parameters.
There are two methods for obtaining the confidence limits for a ratio of linear combinations of model parameters — the method using Fieller's theorem and the delta method. Zerbe (1978) shows how confidence limits based on Fieller's theorem can be obtained for any ratio of linear combinations of model parameters in a generalized linear model. The delta method is a general method that provides an approximate estimate of the variance of nonlinear functions of random variables. Hirschberg and Lye (2010) compare the two methods and discuss when they produce similar results.
Note that for the particular case of estimating the effective dose for some response rate (ED50 or other rate), the INVERSECL option in the MODEL statement of PROC PROBIT can be used to obtain confidence limits based on Fieller's theorem.^{Note1} The methods discussed below can be used more generally to estimate ratios
Delta method using the NLEstimate macro
Since the ED50 and relative potency are nonlinear functions of model parameters, they can be estimated using the NLEstimate macro. The NLEstimate macro uses the fitted model information saved with the STORE statement in PROC LOGISTIC. It then uses PROC NLMIXED to estimate the functions and the delta method to obtain confidence limits. When estimating several functions, it is useful to specify them in a data set with appropriate labels. This is done in the following statements and the resulting data set is specified in the fdata= NLEstimate macro parameter. Your write the functions to be estimated using the parameter names. See the description of the NLEstimate macro for details about displaying parameter names and using the macro.
data fd; length label f $32767; infile datalines delimiter=','; input label f; datalines; Drug S ED50,b_p2/b_p3 Drug N ED50,b_p1/b_p3 N:S Rel. Potency,(b_p1b_p2)/b_p3 ; %NLEstimate(instore=assaymod, fdata=fd, df=14)
The estimates and confidence intervals for the three ratios appear in the Estimate, Lower, and Upper columns of the Additional Estimates table. For example, the estimated log dose of Drug S that produces a 50% response is 3.3835 with 95% confidence interval (2.3684, 4.3985). The estimate and confidence interval on the dose scale can be obtained by exponentiating these values. The log relative potency estimate is similarly 1.7341 with 95% confidence interval (0.3996, 3.0686).

Delta method using PROC NLMIXED
Estimation by the delta method can also be done by fitting the model in PROC NLMIXED and specifying the ratio in the ESTIMATE statement. The following statements fit the same logistic model as above in PROC NLMIXED. The first two ESTIMATE statements estimate the ED50 for each drug, and the relative potency is estimated by the third ESTIMATE statement. The delta method is used by the ESTIMATE statement to approximate the variance of the ratio and provides the confidence limits. The ODS OUTPUT statement saves the results of the ESTIMATE statements in a data set named DELTA.
proc nlmixed data=assay; p=logistic(bdrugs*(drug="S") + bdrugn*(drug="N") + bdose*ldose); model ndead ~ binomial(total,p); estimate "Drug S ED50" bdrugs/bdose; estimate "Drug N ED50" bdrugn/bdose; estimate "N:S Rel. Potency" (bdrugnbdrugs)/bdose; ods output AdditionalEstimates=delta; run;
The results are the same as from the NLEstimate macro above.
Fieller's method using SAS/IML^{®}
Stokes et. al. (2000) present a SAS/IML module based on Zerbe (1978) that implements Fieller's method.^{Note2} The following statements create a macro using similar code. This code must be run in order to define the Fieller macro and make it available for use.
%macro Fieller(data=, out=RatioCI, num=, den=, label=Ratio, alpha=.05, intercept=yes); data _inest; set &data; drop _LNLIKE_ %if %substr(%upcase(&intercept),1,1)=N %then Intercept; ; run; proc iml; use _inest; read all var _num_ into beta where (_type_="PARMS"); beta=beta`; read all var _num_ into cov where (_type_="COV"); k={ &num }; h={ &den }; ratio=(k*beta) / (h*beta); tsq=probit(1&alpha/2)**2; a=(h*beta)**2(tsq)*(h*cov*h`); b=2*(tsq*(k*cov*h`)(k*beta)*(h*beta)); c=(k*beta)**2 (tsq)*(k*cov*k`); disc=((b**2)4*a*c); if (disc<=0  a<=0) then do; print "ERROR: confidence interval can't be computed"; stop; end; sroot=sqrt(disc); l_b=((b)sroot)/(2*a); u_b=((b)+sroot)/(2*a); estlims=ratiol_bu_b; lname={"Estimate", "LCL", "UCL"}; create &out from estlims[colname=lname]; append from estlims; quit; data &out; set &out; Ratio="&label"; run; proc print data=&out; id Ratio; run; %mend;
The following statements call the macro three times to estimate the ED50 for each drug and the relative potency. The data set created by the OUTEST= and COVOUT options in PROC LOGISTIC should be specified in the DATA= option. The OUT= option names the data set containing the estimates and confidence intervals. If omitted, the data set name is RatioCI. The NUM= and DEN= options specify vectors of coefficients, which when multiplied by the vector of model parameters, produce the linear combinations that define the numerator and denominator of the ratio of interest. For example in the first macro call below, the NUM= vector (1 0 0) multiplies the parameter vector (a_{N} a_{S} b) yielding a_{N}, and the DEN= vector (0 0 1) yields b, the numerator and denominator of the Drug N ED50 a_{N}/b. The INTERCEPT= option specifies whether an overall intercept was included in the model. In this case, the overall intercept was omitted by the NOINT option, so INTERCEPT=NO. This option can be omitted in cases when the overall intercept is included in the model. The LABEL= option provides a label for the ratio in the displayed results. By default, the macro produces a 95% confidence interval corresponding to an alpha level of 0.05. The confidence level can be changed by specifying the ALPHA= option.
%Fieller(data=parms, out=DN, num=1 0 0, den=0 0 1, label=Drug N ED50, intercept=no) %Fieller(data=parms, out=DS, num=0 1 0, den=0 0 1, label=Drug S ED50, intercept=no) %Fieller(data=parms, out=RP, num=1 1 0, den=0 0 1, label=N:S Rel. Potency, intercept=no)
Notice that the confidence limits using Fieller's method are slightly different from those produced above by the delta method.

Hirschberg and Lye (2010) discuss conditions under which the delta method and Fieller's theorem produce similar confidence intervals. They note:
"As a general rule, when the sign of the estimated ratio is the same as the sign of the estimated correlation between the numerator and denominator, one can consider the Delta interval and thus avoid the computational burden involved in using the Fieller interval. However, when these signs differ and the precision of the denominator is low, the Fieller interval should be used."
They conclude that:
"... when the Fieller and Delta intervals differ, the Fieller interval results in better coverage, and in some cases, this advantage can be very large."
In this case, the estimated ratios are all positive and the correlation between numerator and denominator is also positive for each ratio suggesting that either method should be reasonable.
The following statements produce a plot that compares the Fieller and delta method intervals.
data delta; set delta; Ratio=label; LCL=Lower; UCL=Upper; type="Delta "; keep Ratio Estimate LCL UCL type; run; data fieller; length Ratio $ 20; type="Fieller"; set DN DS RP; run; data RatioCIs; length Ratio $ 20; set delta fieller; run; proc sgplot data=RatioCIs; highlow y=ratio low=lcl high=ucl / group=type groupdisplay=cluster clusterwidth=0.5 highcap=serif lowcap=serif lineattrs=(thickness=3); scatter y=ratio x=estimate / group=type groupdisplay=cluster clusterwidth=0.5 markerattrs=(symbol=circlefilled size=10); xaxis display=(nolabel); label type="CI Type"; title "Fieller and Delta Method Confidence Intervals"; run;
As can be seen in the plot, the intervals are quite similar for each ratio. Note that the Fieller intervals are not necessarily symmetric about the ratio estimate.
__________
Note 1: PROC PROBIT can fit probit or logistic models. The INVERSECL option estimates the effective dose for the drug that is treated as the reference level. By default, the INVERSECL option provides effective dose estimates for a range of response rates. You can specify one or more specific rates with the PROB= suboption. The following statements fit the same logistic model as above and estimate the ED50 for each drug using Fieller's method.
proc probit data=assay log; class drug(ref="N"); model ndead/total = drug dose / inversecl(prob=.5) d=logistic; run; proc probit data=assay log; class drug(ref="S"); model ndead/total = drug dose / inversecl(prob=.5) d=logistic; run;
Note 2: In the interval computations, Zerbe (1978) uses a quantile from the t distribution with np degrees of freedom, where n is the sample size and p is the number of model parameters. This macro uses a quantile from the standard normal distribution, which should produce similar results in large samples when n is much larger than p.
References
Hirschberg, J. and Lye, J. (2010), "A Geometric Comparison of the Delta and Fieller Confidence Intervals," The American Statistician, 64:3, 234241.
Stokes, M.E., Davis, C.S., and Koch G.G. (2000), Categorical Data Analysis Using SAS^{®}, Third Edition, Cary, NC: SAS Institute Inc.
Zerbe, G.O. (1978), "On Fieller's Theorem and the General Linear Model", The American Statistician, 32:3, 103105.
Product Family  Product  System  SAS Release  
Reported  Fixed*  
SAS System  SAS/STAT  z/OS  
Z64  
OpenVMS VAX  
Microsoft® Windows® for 64Bit Itaniumbased Systems  
Microsoft Windows Server 2003 Datacenter 64bit Edition  
Microsoft Windows Server 2003 Enterprise 64bit Edition  
Microsoft Windows XP 64bit Edition  
Microsoft® Windows® for x64  
OS/2  
Microsoft Windows 8 Enterprise 32bit  
Microsoft Windows 8 Enterprise x64  
Microsoft Windows 8 Pro 32bit  
Microsoft Windows 8 Pro x64  
Microsoft Windows 8.1 Enterprise 32bit  
Microsoft Windows 8.1 Enterprise x64  
Microsoft Windows 8.1 Pro  
Microsoft Windows 8.1 Pro 32bit  
Microsoft Windows 95/98  
Microsoft Windows 2000 Advanced Server  
Microsoft Windows 2000 Datacenter Server  
Microsoft Windows 2000 Server  
Microsoft Windows 2000 Professional  
Microsoft Windows NT Workstation  
Microsoft Windows Server 2003 Datacenter Edition  
Microsoft Windows Server 2003 Enterprise Edition  
Microsoft Windows Server 2003 Standard Edition  
Microsoft Windows Server 2003 for x64  
Microsoft Windows Server 2008  
Microsoft Windows Server 2008 R2  
Microsoft Windows Server 2008 for x64  
Microsoft Windows Server 2012 Datacenter  
Microsoft Windows Server 2012 R2 Datacenter  
Microsoft Windows Server 2012 R2 Std  
Microsoft Windows Server 2012 Std  
Microsoft Windows XP Professional  
Windows 7 Enterprise 32 bit  
Windows 7 Enterprise x64  
Windows 7 Home Premium 32 bit  
Windows 7 Home Premium x64  
Windows 7 Professional 32 bit  
Windows 7 Professional x64  
Windows 7 Ultimate 32 bit  
Windows 7 Ultimate x64  
Windows Millennium Edition (Me)  
Windows Vista  
Windows Vista for x64  
64bit Enabled AIX  
64bit Enabled HPUX  
64bit Enabled Solaris  
ABI+ for Intel Architecture  
AIX  
HPUX  
HPUX IPF  
IRIX  
Linux  
Linux for x64  
Linux on Itanium  
OpenVMS Alpha  
OpenVMS on HP Integrity  
Solaris  
Solaris for x64  
Tru64 UNIX 
Type:  Usage Note 
Priority:  
Topic:  Analytics ==> Analysis of Variance Analytics ==> Categorical Data Analysis Analytics ==> Regression SAS Reference ==> Procedures ==> LOGISTIC SAS Reference ==> Procedures ==> REG SAS Reference ==> Procedures ==> NLMIXED SAS Reference ==> Macro 
Date Modified:  20160829 13:09:18 
Date Created:  20150821 16:20:18 