06-03-2013 04:27 PM
Hello, I am running a quantile regression and do not want to use the standard options associated with the ORDER=statement in QUANTREG. I would instead like to establish my own reference/comparison group-is there a way currently to do this with the QUANTREG method?
proc quantreg data=dataset ci=resampling (nrep=500); by Pathogen; class commodity;
model ill=commodity/quantile=0.25 0.5 0.75 plot=quantplot;
06-03-2013 08:18 PM
Unlike with some other PROCs (e.g., LOGISTIC), QUANTREG does not have an option to change the reference level in the CLASS statement. You will have to use the ORDER= option.
06-04-2013 09:32 AM
My approach would be to create a new variable in a data step, to be used as the CLASS variable. If you are using a character variable, the reference level should start with a "z" or "zz" so that it is the last one.
06-05-2013 07:30 AM
Create a new format value for the CLASS variable you want to specify a reference level for. For example, if "Barley" is the commodity you want as your reference level for all your commodities, use a PROC FORMAT VALUE statement to create a formatted value that sorts at the end of all formatted values by preceding that value with one or more right braces ("}"):
value $comm "Barley"="}} Barley";
proc quantreg . . . order=formatted;
. . . .
format commodity $comm.;
This syntax will make "Barley" the reference level for the classification variable, commodity.