Goals
This tutorial introduces the qFitControl structure. After this tutorial, you should understand:
- How to declare an instance of the
qFitControlstructure - What members are included in the control structure
- How to pass the qFitControl structure to quantileFit
The qFitControl Structure
GAUSS quantile regression implements default modeling parameters to allow you to estimate models with minimal programming. However, you are also able to set custom modeling options using the qFitControl structure. Using the qFitControl structure requires three steps:
- Declare an instance of the
qFitControlstructure.
// Declare 'qCtl' to be a 'qFitControl' structure
struct qFitControl qCtl;
- Fill the created structure with default parameter values using
qFitControlCreate.
// Fill 'qCtl' with default settings
qCtl = qFitControlCreate();
- Change the desired modeling parameters using the appropriate
qFitControlmembers.
qFit.varnames = "Age"$|"Age2"$|"Tenure";
The qFitControl structure members
The qFitControl structure contains the following members for controlling quantile regression :
- qCtl.varnames
- String array, the variable names to be printed in the output table. String array length must equal the number of independent variables.
- qCtl.verbose
- Scalar, indicating whether to the print results, 0 = no printing, 1 = print results. Default = 1.
- qCtl.const
- Scalar, indicating whether to include a constant in regression. 0 = no constant, 1 = constant. Default = 1.
- qCtl.bootstrap
- Scalar, indicating the number of bootstrap repetitions used to find bootstrap standard errors and confidence intervals. Default = 0, no bootstrap errors computed.
- qCtl.alpha
- Scalar, alpha value for computing bootstrap confidence intervals. Not valid if qCtl.bootstrap = 0.
Including the qFitControl structure in the quantileFit call
Once the qFitControl structure is declared and the members are appropriately set, the structure must be passed to the quantileFit procedure. The qFitControl structure must always be passed as the final input into quantileFit.
For example, if no optional arguments are included, the qFitControl structure should be the third input
// Call quantileFit
qOut = quantileFit(y, x, qCtl);
Similarly, if quantile levels are specified, then the qFitControl structure should be the fourth input
// Call quantileFit
qOut = quantileFit(y, x, tau, qCtl);
Conclusion
Congratulations! After this tutorial you should :
- Be able declare an instance of the
qFitControlstructure. - Know how to fill the
qFitControlstructure with default values. - Be able to change the values of the members of the
qFitControlstructure. - Know the members contained in the
qFitControlstructure - Know how to pass the
qFitControlstructure to thequantileFitprocedure
Now that we have been introduced the qFitControl structure we will next look more closely at the members in the qFitControl structure. The next tutorial teaches how to change variable names using the qFit.varnames member.
