If you truly want quantile regression (QR) for models that are nonlinear in the parameters, then Rick is right, there is no dedicated procedure. However, if you are knowledgeable in statistics and know how to program in NLMIXED, there may be hope. There have been several developments in "parametric" approaches to the QR problem. See articles by Geraci and colleagues (maybe start with a 2008 Biostatistics article). Their aproach is for linear models, and most recently for linear mixed quantile models, but the following points should still apply to nonlinear. The idea is to pretend that the data have an asymmetric Laplace (AL) distribution. This is a 3-parameter distribution, where one of the parameters, eta, is the tau-th quantile. That is, tau defines the desired quantile and is fixed by the user; e.g., if one specifies tau=0.5, then eta is the median; with tau=0.75, then eta is the upper quartile; and so on. Eta could either be a single number, or expanded, so that eta = f(X, other parameters). One can fit this model, in principle, by defining the likelihood in NLMIXED. I say "in principle" because I am not yet convinced that I have worked out the details. I have played with this a few times over the last couple of years, but never got far enough. There are several problems with my effort so far, but you may find this helpful. The code below runs, but it doesn't necessarily work.That is, I generate data for a linear model (as an example), and then fit a linear model for the tau-th quantile using NLMIXED (changing one line of code could make it appropriate for a nonlinear model). It converges, but the Hessian has a negative eigenvalue, which is a pathological problem for the standard errors. But I don't think the SEs would be valid anyway, because one is only using the AL as crank to get the quantiles, not for inference. One probably should do bootstrapping for measures of uncertainty. It is critical that the starting values for the parameters are CLOSE to the true values before the optimization starts. Thus, you need a dense grid search specified in the parms statement. If initial guesses are not close, the final estimates will be far from the correct ones. I found it helpful to use an optimization method that does not use derivatives (nmsimp). You should only treat my code as a guide. I am not convinced that I am doing this correctly, so others may find problems with my logic or my coding. I have played with fitting a nonlinear model. I can get it to work, but results can be a bit strange with nonlinear quantile models. The different prediction lines can actually cross. I am also attaching example sas code to do three different quantiles for the linear case, and also three quantiles for a nonlinear example. You should know that the results do NOT duplicate the results from PROC QUANTILE for the linear case (they may be close). Based on Geraci, this is not unexpected. data t;
call streaminit(12345);
do x = 0 to 100 by 10;
do j = 1 to 10 by 1;
e = rand('norm',0)*12;
mu = 10 + 1.5*x;
y = mu + e;
output;
end;
end;
run;
proc nlmixed data=t tech=nmsimp maxiter=1000 ;
title2 'median (tau=0.5)';
*---must do initial search of parameter estimates to get close;
parms nu =0 to 20 by 2 beta = 0.5 to 3.5 by .5 sigma = 1 to 6 by 1 ;
tau = 0.5; *<--for median. change to 0.75 for 75th quantile, etc.;
*---in example, nu is intercept, and beta is slope;
eta = nu + beta*x; *<--change this to any function (linear or nonlinear);
*---rest does not change;
diff = y - eta;
rho = diff*(tau - (diff < 0));
ll = log(tau*(1-tau)) - log(sigma) - rho/sigma ;
model y ~ general(ll); *--Tell NLMIXED that ll (defined above) is the user-specified log-likelihood;
estimate 'var(quant)' sigma**2;
predict eta out=prd ;
run;
*proc print data=prd;run;
proc sgplot data=prd;
scatter y=y x=x;
series y=pred x=x;
run;
... View more