{"id":214783,"date":"2024-11-06T11:38:08","date_gmt":"2024-11-06T16:38:08","guid":{"rendered":"https:\/\/ibkrcampus.com\/campus\/?p=214783"},"modified":"2024-11-06T11:38:20","modified_gmt":"2024-11-06T16:38:20","slug":"r-a-simple-replication-of-cointegration-test-results","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/","title":{"rendered":"R: A Simple Replication of Cointegration Test Results"},"content":{"rendered":"\n<p>This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-johansen-cointegration-test-using-r\">Johansen cointegration test using R<br><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-johansen-test-result-from-johansen-and-juselius-1990\">Johansen Test Result from Johansen and Juselius (1990)<\/h3>\n\n\n\n<p>I will not cover cointegration theory here, as there are many excellent books on the topic, such as&nbsp;<em>Analysis of Financial Time Series<\/em>&nbsp;by Ruey S. Tsay. Instead, I will demonstrate how to replicate the cointegration test results from Johansen and Juselius (1990), as it can serve as a starting point or reference for further research.<\/p>\n\n\n\n<p>In their influential paper, two datasets are utilized: Danish and Finnish data. Both datasets are analyzed using 2 lags and a quarterly seasonal dummy. The Danish dataset includes a constant in the cointegration equation, whereas the Finnish dataset does not use either a constant or a trend.<\/p>\n\n\n\n<p>The target result is Table 3 on page 183 of Johansen and Juselius (1990), as presented below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"854\" height=\"453\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/cointegration_test-SHLee-AI-Financial.png\" alt=\"\" class=\"wp-image-214789 lazyload\" style=\"--smush-placeholder-width: 854px; aspect-ratio: 854\/453;width:854px;height:auto\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/cointegration_test-SHLee-AI-Financial.png 854w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/cointegration_test-SHLee-AI-Financial-700x371.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/cointegration_test-SHLee-AI-Financial-300x159.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/cointegration_test-SHLee-AI-Financial-768x407.png 768w\" data-sizes=\"(max-width: 854px) 100vw, 854px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">R code<\/h3>\n\n\n\n<p>Using the urca R package, the above results can be implemented as follows:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"r\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Load the necessary package for cointegration\nlibrary(urca)\n \n# Load the 'denmark' dataset \ndata(denmark)\n \n# select data \ndata &lt;- as.matrix(denmark[,c(2,3,5,6)])\n \n#=====================================================\n# Perform the Johansen cointegration test\n#=====================================================\n# - type  = \"trace\" runs the trace test \n#           alternatively, \n#           use \"eigen\" for the max-eigenvalue test\n#\n# - ecdet = \"none\" for no intercept in cointegration, \n#           \"const\" for constant term in cointegration\n#           \"trend\" for trend variable in cointegration.\n#\n# - K     = The lag order of the series (levels) in the VAR.\n#        ex) K = 2 sets the lag length (1 lag difference)\n#=====================================================\n \ntest_tr &lt;- ca.jo(data, type = \"trace\", ecdet = \"const\", \n                 K = 2, season = 4)\ntest_eg &lt;- ca.jo(data, type = \"eigen\", ecdet = \"const\", \n                 K = 2, season = 4)\n \nresult1 = data.frame(trace=round(test_tr@teststat,2), \n                    trace_95=test_tr@cval[,2],\n                    lamax=round(test_eg@teststat,2), \n                    lamax_95=test_eg@cval[,2])\n \n \n# Load the 'finland' dataset \ndata(finland)\ndata2 &lt;- as.matrix(finland)\n \ntest_tr2 &lt;- ca.jo(data2, type = \"trace\", ecdet = \"none\", \n                  K = 2, season = 4)\ntest_eg2 &lt;- ca.jo(data2, type = \"eigen\", ecdet = \"none\", \n                  K = 2, season = 4)\n \nresult2 = data.frame(trace=round(test_tr2@teststat,2), \n                     trace_95=test_tr2@cval[,2],\n                     lamax=round(test_eg2@teststat,2), \n                     lamax_95=test_eg2@cval[,2])\n \nprint(\"The Danish data\")\nresult1\n \nprint(\"The Finnish data\")\nresult2<\/pre>\n\n\n\n<p>We can see that this replication closely matches the original results, as shown in the output below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"627\" height=\"333\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/coint_result-SHLee-AI-Financial.png\" alt=\"\" class=\"wp-image-214791 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/coint_result-SHLee-AI-Financial.png 627w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/11\/coint_result-SHLee-AI-Financial-300x159.png 300w\" data-sizes=\"(max-width: 627px) 100vw, 627px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 627px; aspect-ratio: 627\/333;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Reference<\/h3>\n\n\n\n<p>Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration \u2013 with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169\u2013210.&nbsp;<\/p>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/shleeai.blogspot.com\/2024\/10\/r-simple-replication-of-cointegration.html\">SHLee AI Financial Model<\/a> blog.<\/em><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.<\/p>\n","protected":false},"author":662,"featured_media":181803,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,341,342],"tags":[806,487,17996,17995,6591],"contributors-categories":[13728],"class_list":{"0":"post-214783","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-ibkr-quant-news","10":"category-quant-development","11":"category-r-development","12":"tag-data-science","13":"tag-r","14":"tag-r-urca-package","15":"tag-replication-of-cointegration","16":"tag-rstats","17":"contributors-categories-sh-fintech-modeling"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>R: A Simple Replication of Cointegration Test Results<\/title>\n<meta name=\"description\" content=\"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/214783\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R: A Simple Replication of Cointegration Test Results\" \/>\n<meta property=\"og:description\" content=\"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-06T16:38:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-06T16:38:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sang-Heon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Sang-Heon Lee\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\"\n\t            },\n\t            \"headline\": \"R: A Simple Replication of Cointegration Test Results\",\n\t            \"datePublished\": \"2024-11-06T16:38:08+00:00\",\n\t            \"dateModified\": \"2024-11-06T16:38:20+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/\"\n\t            },\n\t            \"wordCount\": 224,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/R-programing.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"R\",\n\t                \"R urca package\",\n\t                \"Replication of Cointegration\",\n\t                \"rstats\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/\",\n\t            \"name\": \"R: A Simple Replication of Cointegration Test Results | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/R-programing.jpg\",\n\t            \"datePublished\": \"2024-11-06T16:38:08+00:00\",\n\t            \"dateModified\": \"2024-11-06T16:38:20+00:00\",\n\t            \"description\": \"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-a-simple-replication-of-cointegration-test-results\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/R-programing.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/R-programing.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"Sign Constrained Lasso with R code\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\",\n\t            \"name\": \"Sang-Heon Lee\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/sang-heonlee\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"R: A Simple Replication of Cointegration Test Results","description":"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/214783\/","og_locale":"en_US","og_type":"article","og_title":"R: A Simple Replication of Cointegration Test Results","og_description":"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/","og_site_name":"IBKR Campus US","article_published_time":"2024-11-06T16:38:08+00:00","article_modified_time":"2024-11-06T16:38:20+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sang-Heon Lee","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"R: A Simple Replication of Cointegration Test Results","datePublished":"2024-11-06T16:38:08+00:00","dateModified":"2024-11-06T16:38:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/"},"wordCount":224,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","keywords":["Data Science","R","R urca package","Replication of Cointegration","rstats"],"articleSection":["Data Science","Programming Languages","Quant","Quant Development","R Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/","name":"R: A Simple Replication of Cointegration Test Results | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","datePublished":"2024-11-06T16:38:08+00:00","dateModified":"2024-11-06T16:38:20+00:00","description":"This post is a straightforward replication of the Johansen cointegration test results from Johansen and Juselius (1990) using R urca package.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-a-simple-replication-of-cointegration-test-results\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","width":900,"height":550,"caption":"Sign Constrained Lasso with R code"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200","name":"Sang-Heon Lee","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/sang-heonlee\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/R-programing.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/214783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/662"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=214783"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/214783\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/181803"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=214783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=214783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=214783"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=214783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}