Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • S s2dverification
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 65
    • Issues 65
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • s2dverification
  • Issues
  • #244
Closed
Open
Issue created Jan 16, 2020 by aho@ahoMaintainer

Corr(): different formula of p-value between Corr() and .Corr()

In Corr(), the formula to calculate p-value is:

 t <- qt(siglev, eno - 2)
 p_val <- sqrt((t * t) / ((t * t) + eno - 2))

which returns the same value for all correlations as long as eno are the same.

But in its inner function .Corr(), the formula is:

  if (pval && (method == "pearson")) {
    t <-sqrt(CORR * CORR * (eno - 2) / (1 - (CORR ^ 2)))
    p_val <- pt(t, eno - 2, lower.tail = FALSE)
  } 

Another problem here is, only when method == 'pearson' will the function return p_val (and also conf). In Corr(), with whichever methods, the function returns p_val and conf.

Assignee
Assign to
Time tracking