R package for computing confidence curves, confidence intervals and
p-values for correlation coefficients corrected for attenuation due
package implements the methods described in
Run the following in
R to install the current CRAN release of the
devtools to install the development version.
# install.packages("devtools") devtools::install_github("JonasMoss/attenuation")
cc to calculate a confidence curve and
plot to plot it.
library("attenuation") r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) curve = cc(r, N) plot(curve, level = 0.90)
Confidence sets can be calculated with
ci. NB: These sets are not
necessarily intervals. They can be either the disjoint union of two
intervals or empty.
ci(r, N) #>  -0.1647174 0.9958587
To find the p-value for the null hypothesis of a specific rho, use the
p_value(rho = 0, r, N) #> #> p-value for corrected correlation coefficients #> #> Arguments #> Sample correlations: 0.2 0.671 0.742 #> Sample sizes: 100 100 100 #> #> Hypothesis test #> rho = 0 #> p-value: 0.263 method: corr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.