From ef330aca6b7851359ef62d218735c9b536132852 Mon Sep 17 00:00:00 2001 From: jonlachmann Date: Fri, 15 Jul 2022 16:39:08 +0200 Subject: [PATCH] Fix check of x variables lag order. The lag order of x is now checked for all lag orders supplied and not just the first. --- R/auto.ardl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/auto.ardl.R b/R/auto.ardl.R index ac7754a..d1d9089 100644 --- a/R/auto.ardl.R +++ b/R/auto.ardl.R @@ -53,7 +53,7 @@ auto.ardl <- function( formula, data, subset=NULL, ymax=4, xmax=4, case=3, ic="b T <- dim(data)[1] if (ymax<0 || ymax>=T) stop('Check ymax: it should be between 1 and nbr-1 observations') - if (xmax<0 || xmax>=T) stop('Check xmax: it should be between 1 and nbr-1 observations') + if (any(xmax < 0 | xmax >= T)) stop('Check xmax: it should be between 1 and nbr-1 observations') if (is.na(match( case, c(1,3,5) ))) stop("case must be 1, 3 or 5") -- GitLab