- WELCOME TO INTRODUCTION TO REGRESSION ANALYSIS.
THE GOALS OF THIS VIDEO ARE TO DEFINE REGRESSION ANALYSIS
AND ALSO TO DETERMINE HOW TO MEASURE HOW WELL A MODEL
FITS GIVEN DATA.
WE WON'T ACTUALLY PERFORM REGRESSION IN THIS VIDEO.
THERE WILL BE SEVERAL OTHER VIDEOS THAT WILL SHOW
SPECIFIC TYPES OF REGRESSION.
IN STATISTICS, REGRESSION ANALYSIS INVOLVES
ANY TECHNIQUES FOR MODELING AND ANALYZING TRENDS
BETWEEN A DEPENDENT VARIABLE,
OFTEN Y, AND AN INDEPENDENT VARIABLE, OFTEN X.
REGRESSION ANALYSIS HELPS US MAKE PREDICTIONS
OUTSIDE OF THE GIVEN DATA.
IF THE PREDICTION IS WITHIN THE RANGE OF THE GIVEN DATA,
IT'S CALLED INTERPOLATION.
AND IF THE PREDICTION IS OUTSIDE THE RANGE OF THE GIVEN DATA,
IT IS CALLED EXTRAPOLATION.
SO FOR EXAMPLE, IF WE HAVE THIS RED SET OF DATA
PLOTTED ON THE COORDINATE PLANE,
IF WE WANTED TO MAKE A PREDICTION AT LET'S SAY X = 1.2,
MAYBE SOMEWHERE IN HERE,
BECAUSE THIS WOULD BE WITHIN THE RANGE OF THE GIVEN DATA,
IT WOULD BE INTERPOLATION.
BUT IF WE WANTED TO MAKE A PREDICTION NOW LET'S SAY X = 7,
MAYBE HERE, SINCE 7 IS OUTSIDE THE RANGE OF THE GIVEN DATA,
IT WOULD BE CALLED EXTRAPOLATION.
NOW THIS VIDEO, WE'LL USE LINEAR REGRESSION
TO INTRODUCE THE CONCEPTS OF REGRESSION
AND WAYS OF MEASURING HOW WELL A GIVEN MODEL FITS THE DATA.
AS MENTIONED BEFORE, THERE ARE SEVERAL OTHER VIDEOS
THAT WILL FOCUS ON DIFFERENT TYPES OF REGRESSION MODELS.
AND THE REGRESSION MODEL CHOSEN REALLY DEPENDS
ON HOW THE GIVEN DATA BEHAVES
AS WELL AS A CERTAIN NUMBER OF ASSUMPTIONS THAT ARE MADE.
AND FOR THIS SET OF VIDEOS,
WE'LL BE USING THE TI84 GRAPHING CALCULATOR
TO PERFORM THE REGRESSION.
WE WON'T DO IT BY HAND.
WHEN ANALYZING DATA, THE FIRST STEP IS USUALLY TO CREATE
A SCATTER PLOT OR SCATTERGRAM.
AND THIS IS JUST A GRAPH USING THE COORDINATE PLANE
TO DISPLAY THE VALUES OF THE TWO VARIABLES
AS A COLLECTION OF POINTS AS WE SEE HERE AS BLUE SQUARES.
AND WHEN CREATING A SCATTER PLOT,
IT'S IMPORTANT TO REMEMBER TO LABEL THE X OR Y AXES
TO KNOW WHAT THEY REPRESENT.
SO HERE THE X AXIS REPRESENTS THE PERCENT
USING A CONTRACEPTION,
AND THE Y COORDINATE REPRESENTS THE TOTAL FERTILITY
RATE OF THE GIVEN COUNTRY.
SO IN BLUE, WE SEE THE LINE THAT WAS DETERMINED
TO BE THE BEST FIT LINE FOR THE GIVEN DATA.
AND WHAT THAT MEANS IS THIS LINE IS SUPPOSED TO REPRESENT
THE TREND OF THE DATA,
AND THEREFORE WE COULD USE THE EQUATION OF THIS LINE
TO MAKE PREDICTIONS.
WHAT I MEAN BY THAT, IF WE KNEW A GIVEN X VALUE
OR A COUNTRY'S PERCENT USING CONTRACEPTION,
WE COULD MAKE A PREDICTION FOR Y WHICH WOULD TELL US
THE TOTAL FERTILITY RATE OF THAT REGION.
AND WE COULD ALSO MAKE THE OPPOSITE PREDICTION.
IF WE KNEW THE TOTAL FERTILITY RATE OF A GIVEN REGION,
WE COULD MAKE A PREDICTION ON THE PERCENT OF PEOPLE
USING CONTRACEPTION.
SO IN GENERAL, THE IDEA WAS THAT YOU WOULD SKETCH YOUR DATA
ON THE COORDINATE PLANE AND THEN MAKE A PREDICTION
ABOUT WHAT TYPE OF FUNCTION WOULD BEST FIT THE DATA.
SO THE MORE YOU KNOW ABOUT THE BASIC TYPES OF FUNCTIONS,
THE BETTER YOU WOULD BE AT DETERMINING
WHAT TYPE OF REGRESSION TO PERFORM.
AND THERE ARE ALSO WAYS TO DETERMINE
HOW WELL A MODEL FITS DATA.
SO WHEN WE'RE TALKING ABOUT LINEAR REGRESSION,
THERE'S SOMETHING CALLED THE CORRELATION COEFFICIENT,
IDENTIFIED AS A CAPITAL "R" OR LOWERCASE "r,"
AND IT'S CALL THE LINEAR CORRELATION COEFFICIENT,
AND IT MEASURES THE STRENGTH AND DIRECTION
OF THE LINEAR RELATIONSHIP BETWEEN THE TWO VARIABLES.
AND THIS IS SOMETIMES CALLED
THE PEARSON PRODUCT MOMENT CORRELATION COEFFICIENT.
AS YOU CAN SEE HERE BY THIS FORMULA,
IT CAN BE QUITE TIME CONSUMING TO CALCULATE,
ESPECIALLY IF YOU HAVE A LONG DATA SET WHERE X AND Y
ARE THE PAIRS OF DATA AND N IS THE NUMBER OF PAIRS.
SO GET A BETTER IDEA OF WHAT THIS TELLS US ABOUT THE--
SO TO GET A BETTER IDEA OF WHAT THIS TELLS US ABOUT THE MODEL,
LET'S TAKE A LOOK AT A FEW EXAMPLES.
HERE WE SEE OUR REGRESSION LINE OR LINE OF BEST FIT GRAPHED
OVER OUR SCATTER PLOT.
THIS IS AN ILLUSTRATION OF A STRONG,
POSITIVE CORRELATION BECAUSE THE POINTS
ARE TIGHTLY CLUSTERED ALONG A LINE WITH A POSITIVE SLOPE.
SO R WOULD BE CLOSE TO A VALUE OF POSITIVE 1.
POSITIVE 1 WOULD BE A PERFECT LINEAR FIT
WITH A POSITIVE SLOPE.
HERE'S AN EXAMPLE OF A STRONG NEGATIVE CORRELATION.
AND NOTICE THE POINTS ARE TIGHTLY CLUSTERED
ALONG A LINE WITH A NEGATIVE SLOPE
WHICH MEANS THAT R WOULD BE CLOSE TO THE VALUE OF -1.
AND IF THERE IS NO CORRELATION AT ALL,
WE'D HAVE AN R VALUE THAT'S CLOSE TO ZERO
AS WE SEE PICTURED HERE.
THE SECOND MEASURE OF HOW WELL A MODEL FITS THE DATA
IS THE COEFFICIENT OF DETERMINATION OR R SQUARED.
R SQUARED MEASURES THE PROPORTION OF VARIABILITY
IN THE DATA SET THAT IS ACCOUNTED FOR
BY THE STATISTICAL MODEL.
AND THERE IS A FORMULA HERE TO CALCULATE R SQUARED.
BUT FOR LINEAR REGRESSION,
R SQUARED IS JUST GOING TO BE THE SQUARE OF R.
AND THE CLOSER R SQUARED IS TO 1, THE BETTER THE MODEL.
SO IN GENERAL,
R SQUARED = 1 - THE SUM OF SQUARES OF THE RESIDUALS
DIVIDED BY THE TOTAL SUM OF SQUARES.
AND THE SUM OF THE SQUARES OF THE RESIDUALS
AS WE SEE HERE IS THE SUM OF THE SQUARES
OF THE Y VALUES - THE Y VALUES OF THE MODEL.
GEOMETRICALLY, IT WOULD BE THE AREA OF THE SQUARES
WE SEE PICTURED HERE.
AND THE TOTAL SUMS OF THE SQUARES
IS THE SUM OF THE SQUARES OF THE Y VALUES - THE AVERAGE Y VALUE.
AND WE SEE THOSE VALUES PICTURED HERE IN RED
WHERE THIS HORIZONTAL LINE HERE IS Y BAR OR THE AVERAGE Y VALUE.
AGAIN TO GET A BETTER FEEL FOR THESE TWO MEASURES,
LET'S GO AND TAKE A LOOK AT AN ANIMATION.
HERE WE HAVE A BLUE SCATTER PLOT AND OUR RED REGRESSION LINE
OR LINE OF BEST FIT.
RIGHT NOW, R IS EQUAL TO .68 AND R SQUARED IS APPROXIMATELY 47%.
SO IT HAS A POSITIVE CORRELATION
AND ROUGHLY 47% OF THE VARIABILITY
OF THE DATA SET CAN BE EXPLAINED BY THE LINEAR RELATIONSHIP,
BY THE EQUATION OF THE LINE.
AND WATCH WHAT HAPPENS AS WE INCREASE THE VALUE OF R.
THE POINTS BECOME MORE CLUSTERED AROUND THE RED LINE.
AND AS WE DO THAT, R INCREASES AND SO DOES R SQUARED.
HERE WE HAVE A VERY STRONG POSITIVE CORRELATION.
R = .99 AND R SQUARED = 98.1%.
HERE WE SEE A VERY WEAK LINEAR CORRELATION.
AND AS WE DECREASE THE VALUE OF R,
NOTICE THAT THE SLOPE TURNS NEGATIVE.
AND AS R APPROACHES -1,
THE POINTS CLUSTER AROUND THE REGRESSION LINE
WITH A NEGATIVE SLOPE.
SO HERE WE SEE R = -.99 AND R SQUARED = 98.%.
SO EVEN IN THESE EXAMPLES, WE'RE LOOKING AT LINEAR EQUATIONS.
IF WE LOOK AT DIFFERENT TYPES OF FUNCTIONS,
THE CLOSER R SQUARED IS TO 1,
THE BETTER THE MODEL FITS THE DATA.
SO I THINK WE'LL STOP HERE ON THIS VIDEO.
AGAIN IN THE NEXT SEVERAL VIDEOS,
WE'LL TAKE A LOOK AT DETERMINING A VARIETY OF REGRESSION MODELS
USING THE TI84 GRAPHING CALCULATOR
AND THEN ANSWERING A VARIETY OF QUESTIONS
BASED UPON OUR MODEL.
I HOPE YOU FOUND THIS INTRO HELPFUL.
THANK YOU FOR WATCHING.