variable_analysis: Determine Significance Level of Individual Variables

Description Usage Arguments Details Value See Also Examples

View source: R/ICP-variable_analysis.R

Description

The variable_analysis function takes an ICP object and outputs evidence for each individual variable being a direct cause.

Usage

1
variable_analysis(x, gof = 0.1)

Arguments

x

An ICP object

gof

If no set of variables (including the empty set) leads to a p-value larger than the goodness-of-fit cutoff gof, the whole model will be rejected. If the model is correct, this will happen with a probability of gof and this option protects again making statements when the model is obviously not suitable for the data.

Details

The function variable_analysis takes an ICP object and a minimum goodness-of-fit cutoff gof and outputs the evidence for each individual variable being a direct cause. To conduct a variable analysis the inputted ICP object should be the result of a call to the ICP function with option fullAnalysis = TRUE. This ensures that variable_analysis has access to the p-values for all the hypothses (H0,S) (see ICP for an explanation of the hypotheses).

If the needed gof level is reached the significance is calculated for each variable Xi by

pi = max{ p-value for H0,S ∣ Xi is not part of XS }.

The gof parameter protects against making statements when the model is obviously not suitable for the data. If no model reaches the threshold gof significance level, i.e. the p-values for (H0,S) are all smaller then gof, we report that there is no evidence for individual variables, as there is no evidence for an invariant set.

The variable_analysis function is also used internally in the ICP function itself if ICP is called with level specified and fullAnalysis = TRUE.

Value

variable_analysis returns a table with class "variable_analysis" where each row reports the significance of the corresponding variable.

See Also

The variable_analysis function is also used internally in the ICP function itself if ICP is called with fullAnalysis = TRUE.

model_analysis is another function for summarizing ICP objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n <- 100
E <- sample(5L, n, replace = TRUE)
X <- data.frame(X1 = rnorm(n, E, 1), X2 = rnorm(n, 3, 1))
Y <- rnorm(n, X$X1, 1)

obj <- ICP(Y, X, E, level = 0.05, fullAnalysis = TRUE)
variable_analysis(obj, gof = 0.1)

# If we make extreem requirements for gof
# all "p-values" will be taken to be 1,
# i.e. no variable is a significant causal predictor
variable_analysis(obj, gof = 0.9)

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