0
$\begingroup$

I have a dataset consisting two variables X and Y. Both of them are of length 250. Now, I want to make conditional quantiles of X and Y. I have been reading the papers of Koenker and Basset (1978) and Firpo et al. (2009), and I had a fair idea about the theoretical aspect of it, I cannot implement it in excel. I have developed unconditional quantiles of both the variables in excel. But I cannot make the conditional quantiles.

It will be of great help, if you can please show me, how to develop conditional quantiles in Excel, so that I can have a practical idea about making conditional quantiles.

$\endgroup$
3
  • 4
    $\begingroup$ Step 1: Close Excel. Step 2: Download R. Step 3: Run install.packages(“quantreg”); library (quantreg); ?rq // If you’re going to do heavy statistics or econometrics, you will want better software than Excel. Alternatives to R include Python, Matlab, SAS, and Stata. A big advantage of R and Python is that they are free. $\endgroup$
    – Dave
    Jul 19, 2021 at 3:56
  • 3
    $\begingroup$ If somebody is forcing you to use excel, then look at stackoverflow.com/questions/49449934/run-r-script-in-excel $\endgroup$ Jul 19, 2021 at 4:33
  • $\begingroup$ Going by the comments, I got an impression that I can run quantile regression in R easily, but cannot just make conditional quantiles. $\endgroup$
    – Rohit
    Jul 19, 2021 at 7:21

1 Answer 1

1
$\begingroup$

As others already noticed in the comments, don't do this in Excel. Implementing complicated algorithms in Excel would lead to a lot of pain and tears, the solution would be slow, and bug-prone. The good software engineering rule is that you don't re-implement things if it isn't absolutely necessary. Use other, available statistical software as suggested.

If you really need to use Excel, the poor man's way of calculating conditional quantiles (or conditional whatever) is to treat it as a GROUP BY operation. Notice however that there are two problems. First, you could GROUP BY only given a discrete variable. If it is continuous, you need to bin it. The problem is that binning introduced bias, Wainer, Gessaroli, and Verdi (2013) gave a nice example where different ways of binning the data enabled them to "show" arbitrary relationships between variables (once positive, once negative). The second problem is that you need enough data, and for quantiles this might be a lot of data if you want to be precise. So the poor man's solution can give really poor results.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.