Hello,
I am currently using quantileFit
and trying to change the variable names. I've tried three different ways of defining variable names as written below and am still getting the result which is based on the default names x01
, x02
, etc.
The code that I've used is
tau = seqa(0.05,0.1,10);
struct qfitOut qOut;
struct qfitControl qCtl;
qCtl = qfitControlCreate();
//three ways of defining var names
qCtl.varnames="constant"$~"pos_daily"$~"neg_daily"$~"weekly"$~"monthly";
qCtl.varnames={"constant","pos_daily","neg_daily","weekly","monthly"};
qCtl.varnames={constant,pos_daily,neg_daily,weekly,monthly};
qCtl.bootstrap=100;
qCtl.verbose=1;
qOut = quantileFit(Y, X, tau, qCtl);
Also, I am not able to find the detailed tutorial for quantileFit. The help section has outlined relevant options and so on but it is not complete. For example, it has explanations for qCtl.varnames
, qCtl.bootstrap
, etc but it does not say anything about defining the controls. No link to qfitControlCreate
or any hint on the reserved word qfitControl
. Is there someplace that has a more comprehensive explanation for quantileFit
or quantileFitLoc
? There are documents for olsmt
, optmt
, and so on but I could not locate one for the quantile.
Thank you very much!
2 Answers
0
new;
cls;
rndseed 4893;
N = 1000;
X = 10*rndu(N, 3) - 5;
b_hat = { 2, -1, 0.5 };
y = 5 + X*b_hat + rndn(rows(X), 1)*10;
// Set up tau for regression
tau = 0.05|0.50|0.75|0.95;
struct qfitControl ctl;
ctl = qFitControlCreate();
// Create string array of variable names
ctl.varnames = "Alpha" $| "Beta" $| "Gamma";
// Call quantileFit
call quantileFit(y, X, tau, ctl);
which returns:
============================================================ Linear Quantile Regression ============================================================ Total observations: 1000 Number of variables: 3 VAR. / tau (in %) 5% 50% 75% 95% ----------------------------------------------------------- CONSTANT -11.9972 5.6790 12.1160 21.0821 Alpha 1.9468 1.9532 1.9120 2.1104 Beta -1.6559 -1.2839 -1.0226 -1.0420 Gamma 0.7706 0.5872 0.3307 0.2627
With regard to qfitControlCreate
the only thing you need to know is that it fills the qfitControl
structure with default settings and it should always be called as the first step after declaring the qfitControl
structure, like this:
// Declare `qCtl` to be a `qfitControl` structure
// and fill with default settings
struct qfitControl qCtl;
qCtl = qfitControlCreate();
I will post some more about the other controls later.
0
Hello,
Please note tutorials for `quantileFit` are now available. The topics covered include:
- Introduction to quantile regression
- Specifying the quantile levels
- Performing weighted analysis
- Storing output from quantile regressions
- The qFitControl structure
- Changing variable names for quantile regression
- Specifying printing options for quantile regression
- Standard errors and confidence intervals for quantile regression
Your Answer
2 Answers
new;
cls;
rndseed 4893;
N = 1000;
X = 10*rndu(N, 3) - 5;
b_hat = { 2, -1, 0.5 };
y = 5 + X*b_hat + rndn(rows(X), 1)*10;
// Set up tau for regression
tau = 0.05|0.50|0.75|0.95;
struct qfitControl ctl;
ctl = qFitControlCreate();
// Create string array of variable names
ctl.varnames = "Alpha" $| "Beta" $| "Gamma";
// Call quantileFit
call quantileFit(y, X, tau, ctl);
which returns:
============================================================ Linear Quantile Regression ============================================================ Total observations: 1000 Number of variables: 3 VAR. / tau (in %) 5% 50% 75% 95% ----------------------------------------------------------- CONSTANT -11.9972 5.6790 12.1160 21.0821 Alpha 1.9468 1.9532 1.9120 2.1104 Beta -1.6559 -1.2839 -1.0226 -1.0420 Gamma 0.7706 0.5872 0.3307 0.2627
With regard to qfitControlCreate
the only thing you need to know is that it fills the qfitControl
structure with default settings and it should always be called as the first step after declaring the qfitControl
structure, like this:
// Declare `qCtl` to be a `qfitControl` structure
// and fill with default settings
struct qfitControl qCtl;
qCtl = qfitControlCreate();
I will post some more about the other controls later.
Hello,
Please note tutorials for `quantileFit` are now available. The topics covered include:
- Introduction to quantile regression
- Specifying the quantile levels
- Performing weighted analysis
- Storing output from quantile regressions
- The qFitControl structure
- Changing variable names for quantile regression
- Specifying printing options for quantile regression
- Standard errors and confidence intervals for quantile regression