?
Solved

making a correlation coefficient for two arrays of size 20 using c

Posted on 2011-04-20
4
Medium Priority
?
916 Views
Last Modified: 2012-05-11
I am really a beginner in c language.
I want to generate a correlation coefficient for two arrays of size 20 using c

Thanks

A
0
Comment
Question by:Anthony Matovu
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 35433578
Is this an assignment that you were given ?

Can you post what you tried, and explain where you got stuck with this ?
0
 
LVL 35

Accepted Solution

by:
sarabande earned 2000 total points
ID: 35433916
the correleation coefficient is defined as

(n*sum(x_i * y_i) - sum(x_i) * sum(y_i))
----------------------------------------------------------------------------------------------------
(sqrt(n*sum(x_i ^2) - sum(x_i)^2) * sqrt(n*sum(y_i ^2) - sum(y_i)^2)

so, you would calculate all those sums in a loop and finally calculate the above quotient.

Sara
0
 
LVL 1

Author Comment

by:Anthony Matovu
ID: 35434338
Thanks Sara
0
 
LVL 35

Expert Comment

by:sarabande
ID: 35434527
i would be very glad if you could post your code as asked for by infinity08.

that way our solution database would be much more informative. we also could help you with the code if there are still things open.

thanks.

Sara
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question