Skip to contents

Slope, intercept, correlation and slope t-test computed exactly as Weisburd et al. (2022) equations 2.2 to 2.6. Mirrors morie.fn ca2e1 to ca2e6.

Usage

morie_ols_simple(x, y)

Arguments

x

Numeric predictor vector.

y

Numeric response vector, same length as x.

Value

List with b1, b0, r, se_b1, t, t_from_r, df, n.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_ols_simple(V, V)
#> $b1
#> [1] 1
#> 
#> $b0
#> [1] 0
#> 
#> $r
#> [1] 1
#> 
#> $se_b1
#> [1] 0
#> 
#> $t
#> [1] Inf
#> 
#> $t_from_r
#> [1] Inf
#> 
#> $df
#> [1] 6
#> 
#> $n
#> [1] 8
#>