[Show all top banners]

blackfox
Replies to this thread:

More by blackfox
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 brother need help with c++
[VIEWED 7409 TIMES]
SAVE! for ease of future access.
Posted on 05-06-09 11:10 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

brothers in sajha,,,iam taking c++ class n having a hard time with my assignment,,,iam supose to make a program regarding linear regression,,,my teacher send me this help but iam still confused.


           any help will be appreciated ,,,plz dont make a funny coments,,iam dam serious right now.


                                                                                                                      jai nepal


 


Regression Tutorial
Regression Definition:
A regression is a statistical analysis assessing the association between two variables. It is used to find the relationship between two variables.


Regression Formula:
Regression Equation(y) = a + bx
Slope(b) = (NΣXY - (ΣX)(ΣY)) / (NΣX2 - (ΣX)2)
Intercept(a) = (ΣY - b(ΣX)) / N


where
x and y are the variables.
b = The slope of the regression line
a = The intercept point of the regression line and the y axis.
N = Number of values or elements
X = First Score
Y = Second Score
ΣXY = Sum of the product of first and Second Scores
ΣX = Sum of First Scores
ΣY = Sum of Second Scores
ΣX2 = Sum of square First Scores


 


Regression Example: To find the Simple/Linear Regression of


X Values Y Values
60 3.1
61 3.6
62 3.8
63 4
65 4.1



To find regression equation, we will first find slope, intercept and use it to form regression equation..


Step 1: Count the number of values.
N = 5


Step 2: Find XY, X2
See the below table


X Value Y Value X*Y X*X
60 3.1 60 * 3.1 = 186 60 * 60 = 3600
61 3.6 61 * 3.6 = 219.6 61 * 61 = 3721
62 3.8 62 * 3.8 = 235.6 62 * 62 = 3844
63 4 63 * 4 = 252 63 * 63 = 3969
65 4.1 65 * 4.1 = 266.5 65 * 65 = 4225


 


Step 3: Find ΣX, ΣY, ΣXY, ΣX2.
ΣX = 311
ΣY = 18.6
ΣXY = 1159.7
ΣX2 = 19359


Step 4: Substitute in the above slope formula given.
Slope(b) = (NΣXY - (ΣX)(ΣY)) / (NΣX2 - (ΣX)2)
= ((5)*(1159.7)-(311)*(18.6))/((5)*(19359)-(311)2)
= (5798.5 - 5784.6)/(96795 - 96721)
= 13.9/74
= 0.19


Step 5: Now, again substitute in the above intercept formula given.
Intercept(a) = (ΣY - b(ΣX)) / N
= (18.6 - 0.19(311))/5
= (18.6 - 59.09)/5
= -40.49/5
= -8.098


Step 6: Then substitute these values in regression equation formula
Regression Equation(y) = a + bx
= -8.098 + 0.19x.


Suppose if we want to know the approximate y value for the variable x = 64. Then we can substitute the value in the above equation.


Regression Equation(y) = a + bx
= -8.098 + 0.19(64).
= -8.098 + 12.16
= 4.06


This example will guide you to find the relationship between two variables by calculating the Regression from the above steps.


 
Posted on 05-06-09 11:13 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Yo! I will see ...


 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
Conservative discussions
सालीको चाक
TPS for Nepal likely to extend next week
I hope all the fake Nepali refugee get deported
Venezuela TPS lawuit
Homeland Security revokes temporary status for 532,000 Cubans, Haitians, Nicaraguans and Venezuelans
Embassy of Nepal might be able to help extend TPS for Nepal
TPS for Venezuela is terminated, only 60 days extension for transition period
महँगो अण्डाको पिकल्प : कुखुरा र खोर भाडामा लिने
ICE kidnapping people off the streets over op eds
Democrat lies revealed
रबि लामिछानेको दाहिने हात ICE को हिरासतमा
Trump admin revokes 18 months TPS extension for Venezuelans
US citizen Petitioning my wife who was out of status when she was in H1B. What to do ?
नेपालको TPS र USAID यसकारण बन्द हुन जरुरि छ
What is the purpose of an F1 student visa in the U.S.?
Why some Nepali people pull each other's legs???
TPS
#MAGA#FAFO is delicious
Good News for Nepalese TPS Holders!!!
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters