Title: | Correcting for Attenuation Due to Measurement Error |
---|---|
Description: | Confidence curves, confidence intervals and p-values for correlation coefficients corrected for attenuation due to measurement error. Implements the methods described in Moss (2019, <arxiv:1911.01576>). |
Authors: | Jonas Moss [aut, cre] |
Maintainer: | Jonas Moss <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-02-09 02:58:43 UTC |
Source: | https://github.com/jonasmoss/attenuation |
Confidence curves for attenuated correlation coefficients.
cc(r, N, lower = -1, upper = 1, by = 0.001, method = "corr", k = NULL)
cc(r, N, lower = -1, upper = 1, by = 0.001, method = "corr", k = NULL)
r |
Numeric vector of three elements in [-1,1]. |
N |
Numeric vector of three positive integers. |
lower |
Lower bound for the curve. Defaults to -1. |
upper |
Upper bound for the curve. Defaults to 1. |
by |
Increment of the sequence from |
method |
The type of confidence curve. Can be |
k |
Numeric vector of two positive integers. |
An object of class ccaf
.
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) plot(cc(r, N))
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) plot(cc(r, N))
Calculate a confidence interval for an attenuated correlation coefficient.
ci(r, N, level = 0.95, method = "corr", k = NULL)
ci(r, N, level = 0.95, method = "corr", k = NULL)
r |
Numeric vector of three elements in [-1,1]. |
N |
Numeric vector of three positive integers. |
level |
Numeric in [0, 1]. Confidence level of the interval. Defaults to 0.95. |
method |
The type of confidence curve. Can be |
k |
Numeric vector of two positive integers. |
Numeric in [0, 1]. The p-value under null-hypothesis rho.
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) ci(r, N) # Calculates 95% confidence set for rho.
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) ci(r, N) # Calculates 95% confidence set for rho.
Add a plot a confidence curve of attenuated correlation coefficients.
## S3 method for class 'ccaf' lines(x, type = "l", col = "red3", lwd = 2, ...)
## S3 method for class 'ccaf' lines(x, type = "l", col = "red3", lwd = 2, ...)
x |
An object of class |
type |
The type of plot. |
col |
The color of the curve. |
lwd |
The thickness of the curve. |
... |
Passed to |
An invisible copy of x
.
This function calculates four types of p-values for correlations coefficients
corrected for attenuation, chosen in "method". The different p-values
are described in Moss (2019). "corr"
is the correlation based
p-value, "cronbach"
is the Cronbach alpha based p-value,
"HS"
is the Hunter-Schmidt p-value, while "free"
is the
correlation based p-value without positive constraints.
p_value(rho, r, N, method = "corr", k = NULL)
p_value(rho, r, N, method = "corr", k = NULL)
rho |
Numeric vector in [-1,1]. The correlation under the null hypothesis. |
r |
Numeric vector of three elements in [-1,1]. |
N |
Numeric vector of three positive integers. |
method |
The type of p-value. Can be |
k |
Numeric vector of two positive integers. |
Numeric in [0, 1]. The p-value under the null-hypothesis that the true correlation is rho.
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) p_value(rho = 0, r, N) # Tests rho = 0.
r = c(0.20, sqrt(0.45), sqrt(0.55)) N = c(100, 100, 100) p_value(rho = 0, r, N) # Tests rho = 0.
Plot a confidence curve of attenuated correlation coefficients.
## S3 method for class 'ccaf' plot(x, y, level = 0.95, ...)
## S3 method for class 'ccaf' plot(x, y, level = 0.95, ...)
x |
An object of class |
y |
Ignored; supported for compatibility with the |
level |
Level to highlight. Defaults to 0.95. If |
... |
Passed to |
An invisible copy of x
.
ccaf
Print method for ccaf
## S3 method for class 'ccaf' print(x, digits = 3, ...)
## S3 method for class 'ccaf' print(x, digits = 3, ...)
x |
Object of class |
digits |
Passed to |
... |
Ignored. |
Invisible copy of x
.