Description Usage Arguments Details Value Author(s) Examples
This function calculates leave-multiple-out (LMO) p-values for an increasing number of data points and identifies those resulting in "significance reversal" of the model, i.e. in the slope's p-value traversing the user-defined α-level.
1 2 |
model |
the linear model of class |
max |
the maximum number of points to eliminate. |
n |
the number of samples to draw for each 1... |
alpha |
the α-level to use as the threshold border. |
method |
select either parametric ( |
verbose |
logical. If |
The algorithm
1) calculates the p-value of the full model (all data points),
2) calculates a LMO-p-value for all n
sampled groups of 1...max
points removed,
3) checks for significance reversal in the resulting model and
4) returns all n
samples and the corresponding p-values.
A list with the following items:
sample |
a matrix with all |
stat |
for each 1... |
Andrej-Nikolai Spiess
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Example with single influencers and insignificant model (p = 0.115).
set.seed(123)
a <- 1:20
b <- 5 + 0.08 * a + rnorm(20, 0, 1)
LM1 <- lm(b ~ a)
res1 <- lmMult(LM1)
multPlot(res1)
stability(res1)
## Large example with 100 data points and highly significant model (p = 6.72E-8).
## No significance reversal up to the elimination of 20 points.
set.seed(123)
a <- 1:100
b <- 5 + 0.08 * a + rnorm(100, 0, 5)
LM2 <- lm(b ~ a)
res2 <- lmMult(LM2, max = 20)
multPlot(res2)
stability(res2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.