Skip to content

correlation formatting doesn't apply digits to the CI formatting #337

@DominiqueMakowski

Description

@DominiqueMakowski

Received by email:

However, I noticed that when one changes the number-of-digits display using the digits argument, that the display for the Pearson’s r value and for the associated t statistic are changed, but the confidence interval limits stay at 2-digits status regardless of the argument value.

CI stays with 2 digits (but it works in parameters)

correlation::correlation(iris, digits=1)
#> # Correlation Matrix (pearson-method)
#> 
#> Parameter1   |   Parameter2 |    r |         95% CI | t(148) |         p
#> ------------------------------------------------------------------------
#> Sepal.Length |  Sepal.Width | -0.1 | [-0.27,  0.04] |   -1.4 | 0.152    
#> Sepal.Length | Petal.Length |  0.9 | [ 0.83,  0.91] |   21.6 | < .001***
#> Sepal.Length |  Petal.Width |  0.8 | [ 0.76,  0.86] |   17.3 | < .001***
#> Sepal.Width  | Petal.Length | -0.4 | [-0.55, -0.29] |   -5.8 | < .001***
#> Sepal.Width  |  Petal.Width | -0.4 | [-0.50, -0.22] |   -4.8 | < .001***
#> Petal.Length |  Petal.Width |  1.0 | [ 0.95,  0.97] |   43.4 | < .001***
#> 
#> p-value adjustment method: Holm (1979)
#> Observations: 150

parameters::parameters(lm(Sepal.Length ~ Sepal.Width, data=iris), digits=1)
#> Parameter   | Coefficient |  SE |      95% CI | t(148) |      p
#> ---------------------------------------------------------------
#> (Intercept) |         6.5 | 0.5 | [ 5.6, 7.5] |   13.6 | < .001
#> Sepal Width |        -0.2 | 0.2 | [-0.5, 0.1] |   -1.4 | 0.152
#> 
#> Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed
#>   using a Wald t-distribution approximation.

Created on 2025-01-19 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions