Hi useRs.. I cant figure out how to test for causality using causality() in vars package I have two datasets (A, B) and i want to test if A (Granger)cause B. How do I write the script? I dont understand ?causality. How do I get x to "contain" A and B. Further using the command VAR() to specify x, I dont either understand. Kind regards Tobias -- View this message in context: http://old.nabble.com/test-for-causality-tp26373931p26373931.html Sent from the R help mailing list archive at Nabble.com.
Tobias The grangertest function in the lmtest package might be simpler for your application. Regards Schalk Heunis On Mon, Nov 16, 2009 at 5:31 PM, tobiasfa <tobias.farnlycke@gmail.com>wrote:> > Hi useRs.. > > I cant figure out how to test for causality using causality() in vars > package > > I have two datasets (A, B) and i want to test if A (Granger)cause B. > How do I write the script? I dont understand ?causality. How do I get x to > "contain" A and B. Further using the command VAR() to specify x, I dont > either understand. > > Kind regards Tobias > > -- > View this message in context: > http://old.nabble.com/test-for-causality-tp26373931p26373931.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]]
> > >Hi useRs.. > >I cant figure out how to test for causality using causality() in vars >package > >I have two datasets (A, B) and i want to test if A (Granger)cause B. >How do I write the script? I dont understand ?causality. HowDear Tobias, have a look at example(causality). A Granger-causality test is a F-test. You need to estimate a VAR first, i.e., provide the complete data set (cbind(A, b)) in VAR() and then provide the causing variable(s) in causality. Best, Bernhard>do I get x to >"contain" A and B. Further using the command VAR() to specify x, I dont >either understand. > >Kind regards Tobias > >-- >View this message in context: >http://old.nabble.com/test-for-causality-tp26373931p26373931.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. >***************************************************************** Confidentiality Note: The information contained in this ...{{dropped:10}}