Description Usage Arguments Value Examples
This function returns a fragility index (and accomponying information) for the one sample t test, when each patients outcome is restricted to only be modified by a certain amount. We observe the sufficiently likely convention which is described in the generalized fragility index article.
1 |
y |
a numeric vector of outcomes |
q |
a numeric for the probability of outcome changes, by default .5. Larger values of q further constrain the permitted modifications. |
mu0 |
the null mean, by default 0 |
alpha |
a numberic for the significance threshold, by default 0.05 |
verbose |
A boolean for whether to print greedy.fi steps while running, by default FALSE |
cl |
A parallel cluster for faster calculation in greedy.fi, by default NULL |
The output of greedy.fi (a list) with an additional element which has the overall data (relative) likelihood, as described in the article Generalized fragility index.
1 2 3 4 5 6 7 8 9 | set.seed(123456790)
y <- rnorm(100, mean = 0)
p.grid <- seq(.1, .9, by = .1)
#ttest.fi(y, q=.9, verbose=TRUE)$FI
fi.grid <- sapply(p.grid, function(p) unlist(ttest.fi(y, q=p)[c('FI', 'sl')]))
ggplot2::qplot(p.grid, fi.grid[1,], geom = c('point', "line"), xlim = c(min(p.grid), max(p.grid)),
xlab = "Within-patient Likelihood bound", ylab = "Fragility index", main = "t test fragility indices (n=100)")
ggplot2::qplot(log10(fi.grid[2,]), fi.grid[1,], xlab = "Full data (between-patient) Likelihood, log scale",
ylab = "Fragility index", main = "t test fragility indices (n=100)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.