plausible_predictor_test: Internal Test for plausible predictors

Description Usage Arguments Details Value See Also

View source: R/ICP-plausible_predictor_test.R

Description

plausible_predictor_test is a generic function used to test whether a set of predictors might be plausible causal predictors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
plausible_predictor_test(method, Y, X, ...)

## Default S3 method:
plausible_predictor_test(method, Y, X, ...)

## S3 method for class 'TimeVar'
plausible_predictor_test(method, Y, X, level, Bonferroni = TRUE, ...)

## S3 method for class 'EnvirRel'
plausible_predictor_test(method, Y, X, E, ...)

## S3 method for class 'CR'
plausible_predictor_test(
  method,
  Y,
  X,
  E,
  level,
  fullAnalysis,
  Bonferroni = TRUE,
  ...
)

Arguments

method

a method object describing the model class to use in the fitting procedure and the testing method. When used in the ICP function the method object is inherited from the ICP function.

Y

a vector or Surv object describing the target variable. The Y will be passed to the fit_model function for fitting, and it is therefor important that the class of Y is understood by the regression method used in fit_model. So if method specifies that a cox regression is to be used, then Y must be a Surv object.

X

a matrix, vector or data frame describing the covariates.

...

additional arguments to be passed to lower level functions.

level

the alpha level of testing, but it is only relevant if the method is iterative and fullAnalysis is FALSE.

Bonferroni

if TRUE Bonferroni correcting will be used if relevant.

E

a vector describing the environmants

fullAnalysis

if TRUE a p-value must be retured. If FALSE the method is 'allowed' to only return 0/1 for hypothesis rejected/accepted.

Details

The plausible_predictor_test is meant to be used in the wrapper function ICP, but can also be used on its own as a simple hypothesis testing function. The method object method, which is created by the method_obj function dictates the plausible_predictor_test method. As this function is generic which means that new testing methods can easily be added for new classes.

For the plausible_predictor_test to work correctly in the ICP wrapper it must be a test of the null hypothesis

H_{0,S}: S is an invariant set w.r.t. (X,Y)

where an invariant set is defined as a set of indicies S such that

(Y^e | X^e_S) = (Y^f | X^f_S)

in distribution for all environments e,f. If the data is time dependent we formulate an analog invariance statement for all time points t and s. For more detailes and discussion of this hypothesis and invariance see the references.

As the plausible_predictor_test is a hypothesis test it must return a p value, that is a number between 0 and 1.

Value

Returns a p-value, i.e. a number between 0 and 1, to be used in the ICP function.

See Also

ICP for the full wrapper function.


Laksafoss/ICPSurv documentation built on Feb. 26, 2020, 11:32 a.m.