You are on page 1of 4

Good morning ever(yone I'm Marcus Jay Pastorfide together with Andrei Bagaindoc, we're going to

discuss about the Simple Linear Regression.

So Andrei what is Linear Regression?

(ANDREI"S TURN)

-----PURPOSE OF LINEAR REGRESSION-----

So andrei told us what linear regression is, alamin naman natin ngayon kung para san ba sya ginagamit
or its purpose.

so pwedeng i-apply ang linear regression sa maraming aspeto like predicting sales based on advertising
spending. Maaari rin syang gamitin para mapredict yung weight ng isang tao based on his or her height
and age. So ang mga nabanggit ko ay ilan lamang sa mga examples na pwedeg i-apply ang linear
regression. So napakalaking tulong nito sa pag analyze ng data and sa paggawa ng mga predictions
based on patterns in the given data.

Ang linear regression ay may dalawang uri ito yung simple linear regression and the other one is
multiple linear regression. Ang pagkakaiba lang nito is yung simple linear regression has only one x and
one y or one independent and one dependent variable. Ang multiple linear regression naman has one y
and two or more x variables.

so for example, kapag nagpredict ng renta ng isang building and yung basis is only based on square feet
that is what we called simple linear regression. kasi may isang x and y variable lang tayo. Yung
independent variable dun is yung square feet and sya yung tinatawag nating x variable. Yung dependent
variable naman is yung price ng renta or yung y variable. kaya dependent variable yung price ng renta
kasi magbabago yun depende sa laki ng building or depende sa square feet ng building.

On the other hand, sa multiple linear regression naman. Example nito is kapag nag predict ng rent based
on square feet and age of the building. So mas dumami yung independent variable or yung x variable,
which are the square feet and age ng building.

Now, let's move forward to our main agenda which is on how to compute the simple linear regression.
so this are the formulas that we need in order to get the simple linear regression.

yung pinaka formula talaga is the Y prime is equal to A plus Bx

so para macompute yan kailangan muna nating kuhanin yung value ni A and ni B. Before ako mag
example let’s know first the meaning of each variables in the formula. So katulad nga ng sinabi ko kanina
yung Y is the dependent variable sya yung predicted value. Next, X is the independent variable or yung
predictor. B is the slope of the line and A is the value of y-intercept.

So let’s have an example. Professor Almira wants to see how the number of absences of student affects
the student’s final grade.

Nest slide,

So ito yung data natin, the x variable which is the independent variable ay yung Number of absences and
then the Final grade is our y variable or the dependent variable because yung final grade ay
magdedepende kung gano karami yung absences ng students.

So ayan yung sa first student may 9 absences ang kanyang final grade is 65 sa isang student naman may
11 absences may final grade na 70, 3 absences has 90 final grade, yung student na walang absences ay
may final grade na 92, student 5 has 7 absences and he/she got 75 final grade, lastly, 4 absences got 84
final grade.

So ilalapat lang natin sya vertically para mas mavisualize natin once we already computed the simple
linear regression.

So ayun kinuha ko na rin yung summation ng bawat variables and needed values para sa ating formula.
Next slide please.

So the first thing we have to do is to get the xy and x squared values, as well as the summation of every
variables. Kasi kailangan yun sa formula para makuha yung value ni B.

So dito explain ko lang sa pagkuha ng xy ipagmumultiply lang yung x and y variable, example is x is 9, y is
65 therefore 9 times 65 is equals to 585. So same process lang ditto sa iba pang values ng x and y. So sa
pagkuha naman ng x squared lam naman na natin yan times by itself. Example sa first value ng x is 9 so 9
times 9 is equals to 81. So same procedure hanggang sa makuha yung xy and x squared sa lahat ng given
values.

Sa summation naman is ipag-a-add lang yung lahat ng values ng x, y, xy, and x squared.

After that cocompute na natin si B.

Uunahin natin yung pagcompute kay B kasi sa formula ni A kailangan yung value ni B.
To compute B the formula is

B is equals to N times summation of xy minus summation of x multiply to summation of y

All over N times summation of x squared minus summation of x squared.

So diba nacompute na natin yung mga values kanina na kailangan sa formula ni B, kaya ngayon
isusubstittute na lang natin to.

So yung N natin is 6 because we have 6 given data for x and y. 2,486 is the summation of xy then minus
sa 34 which is the summation of x multiply kay 476 which is yung summation of y

All over 6 times 276 which is the summation of x squared and then minus sa squared of summation of x

And then uunahin natin yung mga nakaparenthesis because of the PEMDAS na rule. So ipagmumultiply
muna yung 6 and 2,486 which is equals to 14,916. Ganon din sa 34 multiply kay 476 which is equals to
16,184 sa denominator naman we have to multiple 6 and 276 which is equals to 1,656 imaminus sa
squared ng 34 which is 1,156

After that ipagsusubtract na natin. 14,916 minus 16,184 is equals to negative 1,268 sa denominator
naman let’s subtract 1,656 and 1,156 which is equals to 500

So let’s simplify or divide negative 1,268 to 500

Now, we have got the value of B which is negative 2.536

After makuha yung value ni B, let’s get the value of A naman. The formula for A is

A is equals to summation of y minus B time summation of x all over N

So, substitute lang ulit. Summation of Y is 476 ima-minus natin sa pinagmultiply na value ni B and
summation of x. Ang value ni B is negative 2.536 imumultiply kay summation of x which is 34. aAnd then
substitute lang yung value of N which is 6.

So the product of b and summation of x is negative 86.224 and then negative sign times negative is
equals to positive kaya naging plus sign na sya

So we have here, 476 plus 86.224 all over 6

Therefore, we’ve come up to the value of A which is 93.704

Ngayong nakuha na natin yung value ni A and B pwede na natin computin yung Simple linear regression
para mapredict yung possible Final grade depending on number of absences.

So y prime is equals to a plus b x, substitute lang ulit. A is 93.704 plus B which is negative 2.536 times X

Simplify and then we have y prime is equals to 93.704 – 2.536x . Naging negative sign kasi positive times
negative is negative sign.

Now, Andrei will discuss further about the computation in predicting the other possible values for our y
variable and plotting the regression line.

You might also like