Dear all, I know that my question is somewhat special but I tried several times to solve the problems on my own but I am unfortunately not able to compute the following test statistic using the quantreg package. Well, here we go, I appreciate every little comment or help as I really do not know how to tell R what I want it to do^^ My situation is as follows: I have a data set containing a (dependent) vector Y and the regressor X. My aim is to check whether the two variables do not granger-cause each other in quantiles. I started to compute via quantreg for a single tau:= q: rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) This gives me the quantile regression coefficients. Now I want to check whether all the coefficients of X are equal to zero (for this specific tau). Can I do this by applying rq.anova ? I have already asked a similiar question but I am not sure if anova is really calculating this for me.. Currently I am calculating fitunrestricted=rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) fitrestrited=rq(Y_t~Y_(t-1)+Y_(t-2)+...,tau=q) anova(fitrestricted,fitunrestricted) If this is correct can you tell me how the test value is calculated in this case, or in other words: My next step is going to replicate this procedure for a whole range of quantiles (say for tau in [a,b]). To apply a sup-Wald-test I am wondering if it is correct to choose the maximum of the different test values and to simulate the critical values by using the data tabulated in Andrees(1993) (or simulate the vectors of independent Brownian Motions)...please feel free to comment, I am really looking forward to your help! Thank you very much Cheers Stefan -- View this message in context: http://r.789695.n4.nabble.com/quantreg-Wald-Test-tp4638198.html Sent from the R help mailing list archive at Nabble.com.
On Jul 28, 2012, at 8:55 AM, stefan23 wrote:> Dear all, > I know that my question is somewhat special but I tried several times to > solve the problems on my own but I am unfortunately not able to compute the > following test statistic using the quantreg package. Well, here we go, I > appreciate every little comment or help as I really do not know how to tell > R what I want it to do^^ > My situation is as follows: I have a data set containing a (dependent) > vector Y and the regressor X. My aim is to check whether the two variables > do not granger-cause each other in quantiles. I started to compute via > quantreg for a single tau:= q: > rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) > This gives me the quantile regression coefficients. Now I want to check > whether all the coefficients of X are equal to zero (for this specific tau). > Can I do this by applying rq.anova ? I have already asked a similiar > question but I am not sure if anova is really calculating this for me.. > Currently I am calculating > fitunrestricted=rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) > fitrestrited=rq(Y_t~Y_(t-1)+Y_(t-2)+...,tau=q) > anova(fitrestricted,fitunrestricted) > If this is correct can you tell me how the test value is calculated in this > case,Yes, this gives a Wald test if test = "Wald" is specified. You need to read the man page and the references mentioned there for further details. R-help isn't really intended to be a substitute for reading the literature.> or in other words: > My next step is going to replicate this procedure for a whole range of > quantiles (say for tau in [a,b]). To apply a sup-Wald-test I am wondering if > it is correct to choose the maximum of the different test values and to > simulate the critical values by using the data tabulated in Andrees(1993)Do you mean Andrews? Such sup-Wald tests have been extensively discussed in various places, simulating asymptotic critical values is probably the most straightforward approach, but you need to be careful about tail behavior.> (or simulate the vectors of independent Brownian Motions)...please feel free > to comment, I am really looking forward to your help! > Thank you very much > Cheers > Stefan > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/quantreg-Wald-Test-tp4638198.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Stefan: Your comparison of two models, one with a nested reduced set of parameters by fixing the others at zero, with anova() can be used to make inference either based on a likelihood ratio form of test or the rankscore test for a given quantile (see ?anova.rq and the vignette for literature citations with details on the test statistics). So this comparison corresponds to the typical linear model hypothesis of a set of parameters equaling zero. I prefer the rankscore test if sample sizes are not too large (e.g., <5,000). Brian Brian S. Cade, PhD U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: brian_cade@usgs.gov tel: 970 226-9326 From: stefan23 <stefan.voigt@uni-konstanz.de> To: r-help@r-project.org Date: 07/28/2012 10:32 PM Subject: [R] quantreg Wald-Test Sent by: r-help-bounces@r-project.org Dear all, I know that my question is somewhat special but I tried several times to solve the problems on my own but I am unfortunately not able to compute the following test statistic using the quantreg package. Well, here we go, I appreciate every little comment or help as I really do not know how to tell R what I want it to do^^ My situation is as follows: I have a data set containing a (dependent) vector Y and the regressor X. My aim is to check whether the two variables do not granger-cause each other in quantiles. I started to compute via quantreg for a single tau:= q: rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) This gives me the quantile regression coefficients. Now I want to check whether all the coefficients of X are equal to zero (for this specific tau). Can I do this by applying rq.anova ? I have already asked a similiar question but I am not sure if anova is really calculating this for me.. Currently I am calculating fitunrestricted=rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) fitrestrited=rq(Y_t~Y_(t-1)+Y_(t-2)+...,tau=q) anova(fitrestricted,fitunrestricted) If this is correct can you tell me how the test value is calculated in this case, or in other words: My next step is going to replicate this procedure for a whole range of quantiles (say for tau in [a,b]). To apply a sup-Wald-test I am wondering if it is correct to choose the maximum of the different test values and to simulate the critical values by using the data tabulated in Andrees(1993) (or simulate the vectors of independent Brownian Motions)...please feel free to comment, I am really looking forward to your help! Thank you very much Cheers Stefan -- View this message in context: http://r.789695.n4.nabble.com/quantreg-Wald-Test-tp4638198.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
He folks, Thank you very much so far. Of course this forum is not intended to be a substitute for reading the literature, maybe I just posed the question in a way to general. I understand that rq.anovar produces the wald-test proposed in "Tests of Linear Hypotheses and L1 Estimation" (Koenker, Basset). What I do not really get is how to extend this test to the sup-Wald test proposed in "Goodness of Fit and Related Inference Processes for Quantile Regression" (Koenker, Machado). So far I do not really understand whether the anova algorithm prompts the necessary data: I want to use the Test-Statistic for different taus and afterwards choose the maximum for the values in the choosen intervall. So to make my question more straightforward: How can I get the test-value (not the p-value)? Thank you very much for your help, cheers Stefan -- View this message in context: http://r.789695.n4.nabble.com/quantreg-Wald-Test-tp4638198p4639029.html Sent from the R help mailing list archive at Nabble.com.
Hi Stephan, Now I have your same problem on Granger causality test, have you got some news about it? The anova.rq is the right one to do it? Regards, Massimo -- View this message in context: http://r.789695.n4.nabble.com/quantreg-Wald-Test-tp4638198p4645773.html Sent from the R help mailing list archive at Nabble.com.