View source: R/robust-score-test.R
robust_score_test | R Documentation |
Doubly robust p-values and confidence intervals for parameters in (stratified) linear (shift-scale) transformation models obtained using the tram generalised covariance measure test.
robust_score_test(object, ...)
## S3 method for class 'tram'
robust_score_test(
object,
parm = names(coef(object)),
alternative = c("two.sided", "less", "greater"),
nullvalue = 0,
confint = FALSE,
level = 0.95,
ranger_args = NULL,
...
)
object |
an object of class ' |
... |
additional arguments, currently ignored. |
parm |
a vector of names of parameters to be tested. These
parameters must be present in |
alternative |
a character string specifying the alternative
hypothesis, must be one of |
nullvalue |
a number specifying an optional parameter used to form the null hypothesis H_0: parm = nullvalue and defaults to zero |
confint |
a logical indicating whether to (numerically) invert the test to obtain a robust score confidence interval |
level |
the confidence level |
ranger_args |
arguments passed to |
For a (stratified) linear shift (-scale) transformation he tram-GCM test
tests the hypothesis H0: parm
= nullvalue
by re-fitting the
model under the null hypothesis, computing the score residuals (see
residuals.tram
), and running an additional regression
of the column in the design matrix corresponding to parm
on the
remaining columns, computing the corresponding residuals, and finally
computing correlation-type test between the score and predictor residuals.
An object of class 'htest
' or a list thereof.
Lucas Kook, Torsten Hothorn
Kook, L., Saengkyongam, S., Lundborg, A. R., Hothorn, T., & Peters, J. (2024). Model-based causal feature selection for general response types. Journal of the American Statistical Association, 1-12. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2024.2395588")}
data("mtcars")
### Linear shift tram
m <- Lm(mpg ~ cyl + disp, data = mtcars)
robust_score_test(m, parm = "cyl")
### Linear shift-scale tram
m2 <- Lm(mpg ~ cyl | disp, data = mtcars)
robust_score_test(m2, parm = "cyl")
robust_score_test(m2, parm = "scl_disp")
### Stratified linear shift tram
m3 <- Lm(mpg | 0 + disp ~ cyl, data = mtcars)
robust_score_test(m3, parm = "cyl")
### Stratified linear shift-scale tram
m4 <- Lm(mpg | 0 + disp ~ cyl | cyl, data = mtcars)
robust_score_test(m4, parm = "cyl")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.