Description Usage Arguments Details Value Author(s) Examples
Interfaces to lmtest
functions that can be used
in a pipeline implemented by magrittr
.
1 2 3 4 5 6 7 8 9 10 11 12 | ntbt_bgtest(data, ...)
ntbt_bptest(data, ...)
ntbt_coxtest(data, ...)
ntbt_dwtest(data, ...)
ntbt_encomptest(data, ...)
ntbt_gqtest(data, ...)
ntbt_grangertest(data, ...)
ntbt_harvtest(data, ...)
ntbt_hmctest(data, ...)
ntbt_jtest(data, ...)
ntbt_raintest(data, ...)
ntbt_resettest(data, ...)
|
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | ## Not run:
library(intubate)
library(magrittr)
library(lmtest)
## ntbt_bgtest: Breusch-Godfrey Test for higher-order serial correlation
x <- rep(c(1, -1), 50)
y1 <- 1 + x + rnorm(100)
dta <- data.frame(x, y1)
## or for fourth-order serial correlation
## Original function to interface
bgtest(y1 ~ x, order = 4, data = dta)
## The interface puts data as first parameter
ntbt_bgtest(dta, y1 ~ x, order = 4)
## so it can be used easily in a pipeline.
dta %>%
ntbt_bgtest(y1 ~ x, order = 4)
## ntbt_bptest: Breusch-Pagan test against heteroskedasticity
## ntbt_gqtest: Goldfeld-Quandt test against heteroskedasticity
## ntbt_hmctest: Harrison-McCabe test for heteroskedasticity
x <- rep(c(-1,1), 50)
err1 <- c(rnorm(50, sd=1), rnorm(50, sd=2))
err2 <- rnorm(100)
y1 <- 1 + x + err1
y2 <- 1 + x + err2
dtah <- data.frame(x, y1, y2)
## Original function to interface
bptest(y1 ~ x, data = dtah)
gqtest(y1 ~ x, data = dtah)
hmctest(y1 ~ x, data = dtah)
bptest(y2 ~ x, data = dtah)
gqtest(y2 ~ x, data = dtah)
hmctest(y2 ~ x, data = dtah)
## The interface puts data as first parameter
ntbt_bptest(dtah, y1 ~ x)
ntbt_gqtest(dtah, y1 ~ x)
ntbt_hmctest(dtah, y1 ~ x)
ntbt_bptest(dtah, y2 ~ x)
ntbt_gqtest(dtah, y2 ~ x)
ntbt_hmctest(dtah, y2 ~ x)
## so it can be used easily in a pipeline.
dtah %>%
ntbt_bptest(y1 ~ x)
dtah %>%
ntbt_gqtest(y1 ~ x)
dtah %>%
ntbt_hmctest(y1 ~ x)
dtah %>%
ntbt_bptest(y2 ~ x)
dtah %>%
ntbt_gqtest(y2 ~ x)
dtah %>%
ntbt_hmctest(y2 ~ x)
## ntbt_coxtest: Cox Test for Comparing Non-Nested Models
## ntbt_encomptest: encompassing test of Davidson & MacKinnon for comparing non-nested models
## ntbt_jtest: Davidson-MacKinnon J test for comparing non-nested models
data(USDistLag)
usdl <- na.contiguous(cbind(USDistLag, lag(USDistLag, k = -1)))
colnames(usdl) <- c("con", "gnp", "con1", "gnp1")
## Original function to interface
coxtest(con ~ gnp + con1, con ~ gnp + gnp1, data = usdl)
encomptest(con ~ gnp + con1, con ~ gnp + gnp1, data = usdl)
jtest(con ~ gnp + con1, con ~ gnp + gnp1, data = usdl)
## The interface puts data as first parameter
ntbt_coxtest(usdl, con ~ gnp + con1, con ~ gnp + gnp1)
ntbt_encomptest(usdl, con ~ gnp + con1, con ~ gnp + gnp1)
ntbt_jtest(usdl, con ~ gnp + con1, con ~ gnp + gnp1)
## so it can be used easily in a pipeline.
usdl %>%
ntbt_coxtest(con ~ gnp + con1, con ~ gnp + gnp1)
usdl %>%
ntbt_encomptest(con ~ gnp + con1, con ~ gnp + gnp1)
usdl %>%
ntbt_jtest(con ~ gnp + con1, con ~ gnp + gnp1)
## ntbt_dwtest: Durbin-Watson test for autocorrelation of disturbances
err1 <- rnorm(100)
x <- rep(c(-1,1), 50)
y1 <- 1 + x + err1
err2 <- filter(err1, 0.9, method="recursive")
y2 <- 1 + x + err2
dta <- data.frame(y1, y2, x)
## Original function to interface
dwtest(y1 ~ x, data = dta)
dwtest(y2 ~ x, data = dta)
## The interface puts data as first parameter
ntbt_dwtest(dta, y1 ~ x)
ntbt_dwtest(dta, y2 ~ x)
## so it can be used easily in a pipeline.
dta %>%
ntbt_dwtest(y1 ~ x)
dta %>%
ntbt_dwtest(y2 ~ x)
## ntbt_grangertest: Test for Granger Causality
data(ChickEgg)
## Original function to interface
grangertest(egg ~ chicken, order = 3, data = ChickEgg)
grangertest(chicken ~ egg, order = 3, data = ChickEgg)
## The interface puts data as first parameter
ntbt_grangertest(ChickEgg, egg ~ chicken, order = 3)
ntbt_grangertest(ChickEgg, chicken ~ egg, order = 3)
## so it can be used easily in a pipeline.
ChickEgg %>%
ntbt_grangertest(egg ~ chicken, order = 3)
ChickEgg %>%
ntbt_grangertest(chicken ~ egg, order = 3)
## ntbt_harvtest: Harvey-Collier test for linearity
x <- 1:50
y1 <- 1 + x + rnorm(50)
y2 <- y1 + 0.3*x^2
dta <- data.frame(y1, x)
## Original function to interface
harvtest(y1 ~ x, data = dta)
## The interface puts data as first parameter
ntbt_harvtest(dta, y1 ~ x)
## so it can be used easily in a pipeline.
dta %>%
ntbt_harvtest(y1 ~ x)
## ntbt_raintest: Rainbow test for linearity
x <- c(1:30)
y <- x^2 + rnorm(30,0,2)
dta <- data.frame(x, y)
## Original function to interface
raintest(y ~ x, data = dta)
## The interface puts data as first parameter
ntbt_raintest(dta, y ~ x)
## so it can be used easily in a pipeline.
dta %>%
ntbt_raintest(y ~ x)
## ntbt_resettest: Ramsey's RESET test for functional form
x <- c(1:30)
y1 <- 1 + x + x^2 + rnorm(30)
y2 <- 1 + x + rnorm(30)
dta <- data.frame(x, y1, y2)
## Original function to interface
resettest(y1 ~ x , power=2, type="regressor", data = dta)
resettest(y2 ~ x , power=2, type="regressor", data = dta)
## The interface puts data as first parameter
ntbt_resettest(dta, y1 ~ x , power=2, type="regressor")
ntbt_resettest(dta, y2 ~ x , power=2, type="regressor")
## so it can be used easily in a pipeline.
dta %>%
ntbt_resettest(y1 ~ x , power=2, type="regressor")
dta %>%
ntbt_resettest(y2 ~ x , power=2, type="regressor")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.