Learn R Programming

tram (version 1.2-1)

robust_score_test: Doubly Robust Transformation Score Test

Description

Doubly robust p-values and confidence intervals for parameters in (stratified) linear (shift-scale) transformation models obtained using the tram generalised covariance measure test.

Usage

robust_score_test(object, ...)

# S3 method for 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, ... )

Value

An object of class 'htest' or a list thereof.

Arguments

object

an object of class 'tram'

...

additional arguments, currently ignored.

parm

a vector of names of parameters to be tested. These parameters must be present in object

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater", or "less"

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 ranger for the regression of the column in the design matrix corresponding to parm against all others

Author

Lucas Kook, Torsten Hothorn

Details

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.

References

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. tools:::Rd_expr_doi("10.1080/01621459.2024.2395588")

Examples

Run this code
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")

Run the code above in your browser using DataLab