Unformatted text preview:

Two Quantitative Variables September 13, 20061Two Quantitative VariablesCorrelation and RegressionSimple Scatter Plot0 20 40 60 80 100FT Bush (after)0 20 40 60 80 100FT Liberal s (after)Scatter Plot with Jitter0 20 40 60 80 100FT Bush (after)0 20 40 60 80 100FT Liberals (after)Two Quantitative Variables September 13, 20062Scatter Plot with Line0 20 40 60 80 100FT Bush (After)0 20 40 60 80 100FT Liberals (after)Scatter Plot with Control0 20 40 60 80 100FT Bush (After)0 20 40 60 80 100FT Liberals (after)Side by Side Scatter Plots0 50 1000 50 100 0 50 1001. male 2. femaleFT Bush (after)FT Liberals (after)Graphs by hhlisting.9a. respondent genderTwo Quantitative Variables September 13, 20063Mean Plot20 40 60 80ftb_bush_means0 2 4 6 8Ideology (before)Lowess Smoother0 20 40 60 80 100FT Bush (after)0 20 40 60 80 100FT Liberals (after)bandwidth = .8Lowess smootherFitted Means0 20 40 60 80 100FT Bush (before)0 2 4 6 8ideology(before)18.382.779.168.552.733.325.8Two Quantitative Variables September 13, 20064Eta2error baselineerror fitted -error baseline PRE =baselinefittedbaseline2SSDSSD - SSD eta =326.1075480.07 351237.341075480.07 724242.725-1075480.07 eta2===SSDbaseline= 1075480.07 SSDfitted= 724242.725571. eta =Fitted Straight Liney= -0.26 + 13.10x0 20 40 60 80 100FT Bush (before)0 2 4 6 8ideology (before)r2baselinefittedbaseline2SSDSSD - SSD =r318.1075480.07 732909.48-1075480.07 2==r()1075480.07SSD2baseline=−=∑yyi()732909.48ˆSSD2fitted=−=∑iiyyiibxay +=ˆ564. ±=rTwo Quantitative Variables September 13, 20065Means vs. Straight Line0 20 40 60 80 100FT Bush (before)0 2 4 6 8ideology (before)326. eta2=318. 2=rFitted Straight Line 20 20 40 60 80 100FT Bush (After)0 20 40 60 80 100FT Liberals (after)y = 89.9 - 0.59xr2baselinefittedbaseline2SSDSSD - SSD =r134.1122395.56 971862.96-1122395.56 2==rSSDbaseline= 1122395.56 SSDfitted= 971862.96366.−=rTwo Quantitative Variables September 13, 20066Product Moment Correlation⎟⎟⎠⎞⎜⎜⎝⎛−⎟⎟⎠⎞⎜⎜⎝⎛−−=∑yixisyysxxnr11()()()()∑∑∑−−−−=22yyxxyyxxriiiiyxiiiiSSDSSDnyxyxr⋅−=∑∑∑yxxySSDSSDSCP⋅=Computing a Correlation434258.34101356118-35430742==xSSD1122395.64101358042-44480362==ySSD-255676.3510135804256118-2959725=⋅=xySCP366.1122395.64434258.34255676.35-−=⋅=rFitting a Linebxay +=iibxay +=ˆ()∑−iiyyˆmin∑−iiyyˆminiiyyˆ−() ( )222minˆminmin∑∑∑−−=−=iiiiibxayyye()2min∑erroriiiebxay++=Two Quantitative Variables September 13, 20067Y = 4 + 2XXY-4 -4-3 -2-2 0-1 2041628310412-5051015-6 -4 -2 0 2 4 6XYStraight LineY = 1 + 2X + X205101520-9 -4 1 6XYXY-5 16-4 9-3 4-2 1-1 0011429316Nonlinear ExampleDerivatives-Simple EquationpkXY =)1( −×=pkXpdXdY22021401110=+=×+×=−−XXdXdY102424XXXY +=+=XY 24 +=Two Quantitative Variables September 13, 20068Derivatives-Less Simple Equation210212121XXXXXY ++=++=pkXY =)1( −×=pkXpdXdYXXXXdXdY22122110121110+=×+×+×=−−−()22211 XXXY ++=+=MinimizationXdxdy22+=X220 +=22 =−X1−=XMinimum (or maximum) when slope = 0Partial Derivatives3221ZXXZY +++=XZXY22 +=∂∂232 ZXZY+=∂∂21031)2()1( XXZXZY +++=31021)2()1( ZZXZX +++=Two Quantitative Variables September 13, 20069Deriving Least Square∑∑∑∑∑∑∑∑+−−++=−−=iiiiiiiiixabxybyaxbaybxaye222)(222222∑∑∑∑∑∑∑∑∑∑∑∑∑∑+−=++−=∂∂++−+−=iiiiiiiiiiiixbyaaxbyaeaxabyaxbxybye22222222)2(222222∑∑∑∑∑∑∑∑∑∑∑+−=∂∂+−++−=222222222222)2(iiiiiiiiiiiixbxyxabexbxybxabayayeNormal Equations()()00002=−−=−−=−−=−−∑∑∑∑∑∑∑∑iiiiiiiiiiibxayxxbxaxybxayxbaySolving for a and b002=−−=−−∑∑∑∑∑∑iiiiiixbxaxyxbayTwo equations in two unknownsTwo Quantitative Variables September 13, 200610Solve for a0=−−∑∑∑iixbay∑∑−=⋅iixbyanxbynxbnyaii−=−=∑∑Solve for b02=−−∑∑∑iiiixbxaxynxbnyaii∑∑−=02=−⎟⎟⎠⎞⎜⎜⎝⎛−−∑∑∑∑∑iiiiiixbxnxbnyxySolve for b, continued02=−+−∑∑∑∑∑∑iiiiiiixbnxxbnyxxynyxxynxxbxbiiiiiii∑∑∑∑∑∑−=−2()nyxxynxxbiiiiii∑∑∑∑∑−=⎟⎟⎠⎞⎜⎜⎝⎛−22Two Quantitative Variables September 13, 200611Solve for b, continued()nyxxynxxbiiiiii∑∑∑∑∑−=⎟⎟⎠⎞⎜⎜⎝⎛−22nyxxySCPiiiixy∑∑∑−=()nxxSSDiix22∑∑−=xyxSCPSSDb =⋅()()()2∑∑−−−==xxyyxxSSDSCPbiiixxyLeast Squares Fitted Line()()()()∑∑∑∑−−−==∑∑∑∑∑=−=−=−−222xxyyxxxSSDSCPbxbynxbnyaiiinxxnyxyxiiiiiiiiComputing the Regression434258.34101356118-35430742==xSSD-255676.3510135804256118-2959725=⋅=xySCP589.434258.34255676.35-−==xxySSDSCPb91.89101356118)589.(101358042=−−=−=∑∑nxbnyaiiTwo Quantitative Variables September 13, 200612Relationship between b and ryxssbr =xyssrb =yxxySSDSSDSCPr =xxySSDSCPb =M&M’s Computation of b589.20.71533.303-0.366 −=⎟⎠⎞⎜⎝⎛⋅==xyssrbWhy Is r a PRE?()2baseline∑−== yySSDiy() () ( ) ()( )∑∑∑∑−−+−+−=−iiiiiiiyyyyyyyyyyˆˆ2ˆˆ:sum and square222()22ˆfitted∑∑−===iiierroryyeSSD()( )fittedexplainedbaselineyyyyyyiiii+=−+−=−ˆˆTwo Quantitative Variables September 13, 200613r is based on least squares()()()0:outmultiply =−−+−−+−−∑∑∑iiiiiiibxayxbbxayYbxaya()( )0ˆˆ=−−∑iiiyyyy()( )0:ˆfor substitute=−−−++∑iiiiibxayybxaybxa()()00=−−=−−∑∑iiiiibxayxbxayNormal equations:Supreme Court JusticesJustices's Values and Votes0%10%20%30%40%50%60%70%80%90%100%-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5IdeologyLiberal Voting in Civil Liberties CasesDead GrandmasTwo Quantitative Variables September 13, 200614Properties of Least Squares Residualsiiiiibxayyye −−=−=ˆ()( )0ˆ=−−=−=∑∑∑iiiiibxayyye()( )minˆ222=−−=−=∑∑∑iiiiibxayyyePlotting ResidualsProblem


View Full Document

UW-Madison PS 551 - Lecture 04

Download Lecture 04
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 04 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 04 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?