ci_rsquared | R Documentation |
This function calculates parametric confidence intervals for the population R-squared. It is based on confidence intervals for the non-centrality parameter Delta of the F distribution, found by test inversion. Delta values are mapped to R-squared by R-squared = Delta / (Delta + df1 + df2 + 1), where df1 and df2 are the degrees of freedom of the F test statistic. A positive lower (1-alpha)*100%-confidence limit for the R-squared goes hand-in-hand with a significant F test at level alpha.
ci_rsquared(x, df1 = NULL, df2 = NULL, probs = c(0.025, 0.975))
x |
The result of |
df1 |
The numerator degree of freedom. Only used if |
df2 |
The denominator degree of freedom. Only used if |
probs |
Error probabilites. The default c(0.025, 0.975) gives a symmetric 95% confidence interval. |
According to ?pf
, the results might be unreliable for very large F values. Note that we do not provide bootstrap confidence intervals here to keep the input interface simple.
A list with class cint
containing these components:
parameter
: The parameter in question.
interval
: The confidence interval for the parameter.
estimate
: The estimate for the parameter.
probs
: A vector of error probabilities.
type
: The type of the interval.
info
: An additional description text for the interval.
Smithson, M. (2003). Confidence intervals. Series: Quantitative Applications in the Social Sciences. New York, NY: Sage Publications.
ci_f_ncp
.
fit <- lm(Sepal.Length ~ ., data = iris) summary(fit)$r.squared ci_rsquared(fit) ci_rsquared(fit, probs = c(0.05, 1)) ci_rsquared(fit, probs = c(0, 0.95)) ci_rsquared(188.251, 5, 144)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.