Skip to content

coludeyi/Obese-income-correlation

 
 

Repository files navigation

Objective: Find Correlation between Average Income and Obesity rate in all USA states.

Programming language: Java

Statistical Analysis: Pearson correlation

Source file: Obesity prevelance rate.csv

Class Diagram: doc/model.png

Author: Cornelius Oludeyi, Mshari Algazlan and Hongbin Sun.

Data Structure:

  1. List
  2. Arrays

Class:

  1. Data class
  2. obeseincome class
  3. ObesityIncomeCorrelation class

Methods:

  • we() - returns List

  • getState() - returns String state

  • getWhite() - returns obesity rate of white ethnic group in a state

  • getBlack() - returns obesity rate of black ethnic group in a state

  • getHispanic() - returns obesity rate of Hispanic group in a state

  • getOverall() - returns average obesity rate of all the ethnic groups in a state

  • getIncome() - returns average income in a state in a state

  • getPearsonCorrelation() - returns Pearson correlation value as double

  • setState() - sets the name of a state

  • setWhite() - sets the obesity rate of white ethnic group in a state

  • setBlack() - sets the obesity rate of Black ethnic group in a state

  • setHispanic() - sets the obesity rate of Hispanic think group in a state

  • setOverall - sets the average obesity rate in a state

  • setIncome - sets the average income in a state

  • Result() - displays the result of Pearson correlation

Download:

junit-4.10.jar - used for unit testing

Unit Testing:

junit-4.10.jar was used for unit testing in NetBeans. The test class was named JUnitTest.java which is in Test packages folder. Unit test was implemented for all get methods in Data class.

  1. testGetState()
  2. testGetWhite()
  3. testGetBlack()
  4. testGetHispanic()
  5. testGetOverall()
  6. testGetIncome()
  7. testListSize()

All 6 tests passed in 0.535 seconds.

Software:

  1. NetBeans IDE 8.0.2
  2. Eclipses

IDE:

  1. JavaFX
  2. ObjectAid for class diagram

Doc Folder:

  1. Obesity prevalence rate.cvs (data)
  2. model.png (class diagram)

Conclusion:

Obesity rate tends to increase with Average Income.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 63.6%
  • HTML 36.4%