Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3604174
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:57:53+00:00 2026-05-18T20:57:53+00:00

I am trying to calculate Pearsons correlation between 13 variables in a tab delimited

  • 0

I am trying to calculate Pearsons correlation between 13 variables in a tab delimited text file where each column is a variable. I am using java and was hoping that somebody can give me some guidance as to which libraries or which functions I should be using. I am guessing I will first need to read the contents of the file but can’t figure out how to essentially make the program know that each column is an like an array which would than enable me to do my required calculations. I would have thought the java.io package would be the best place for me to start but just can’t figure out what classes I could use for my problem. I have also looked at http://commons.apache.org/math/ which has a function for measuring pearsons correlation but that would be too easy and as this is a Uni assignment I have to implement it form scratch. By looking at the appache pearsons correlation they seem to have approached the problem like a matrix where each column of the matrix is a variable.

Sorry for the lengthy description of my problem. If you guys know any websites or any good kewords to search for or any other information I would greatly appreciate. Thanks, Arlind.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:57:53+00:00Added an answer on May 18, 2026 at 8:57 pm

    You should be able to do this using just the standard java Math, String, File I/O libraries, and a few arrays and loops!

    Read this first to learn how to read in the file.
    http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml

    Inside the loop parse your csv file by using the String.split(String regex) method. e.g. strLine.split(“,”).

    Convert this to an array of doubles, by using Double.parseDouble for each String in the String[]

    From there you can use the
    Math.sqrt(double a) and
    Math.pow(double a, double b) functions along with some simple loops to calculate your correlation for each pair of variables.

    Hopefully that’s enough info to get you started, feel free to post back if you want more help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to calculate the distance between two map point using Google Map
I am trying to calculate the difference between two times using JavaScript. It's just
am trying to calculate mean and variance using 3X3 window over image(hXw) in opencv...here
I'm trying to calculate elapsed hours between two times. When calculating PM to AM
I'm trying to calculate the number of pairwise differences between a long list of
I am trying to calculate apk file size of the installed applications. Here is
I'm trying to calculate how many minutes have elapsed between a saved DateTime and
I'm trying to calculate the total amount won for each user_name in the For
I'm trying to calculate various time period returns (monthly, quarterly, yearly etc.) for each
Trying to calculate sum of checked tr's. var totalqt=0; totalqt=totalqt + $(this).closest(tr).find(#qt).text(); It gets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.