lab 4 regression

Upload: yogi-tresno-patriatama

Post on 02-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Lab 4 Regression

    1/6

    Statistics Spring 2008

    Lab #4 Regression

    Defined: A model for predicting one variable from other variable(s).Variables: Vs is contin!o!s" DV is contin!o!s

    #elationship: #elationship amongst variables

    $%ample: &an 'e predict height from 'eight (or 'eight from height" or 'eight from m!ltiple variables" etc).Ass!mptions: ormalit. *inearit. +!lticollinearit

    1. Graphing - Scatterplot ,he first step of an statistical analsis is to first graphicall plot the data.

    n terms of regression" if o! are onl cond!cting bivariate regression" then the scatterplot 'ill be the same

    for correlation. ,h!s" see -*ab &orrelation/ for ho' to cond!ct a scatter plot. f o! have three variables" o! can cond!ct a D scatterplot. ,he instr!ctions belo' are for a D scatterplo

    f o! have more than three variables" o! cant cond!ct a scatterplot beca!se it is impossible to see a

    scatterplot in 1D or D or 3D or so forth 4o' do graph a scatterplot5

    6. Select Graphs77> Legacy Dialogs77>Scatter

    2. &lic -D Scatter/" and -Define/. +ove appropriate variables into the -9 a%is/ and - a%is/ and -; a%is/

    1. &lic

  • 8/11/2019 Lab 4 Regression

    2/6

    2. ssu!ptions" or!ality$ Linearity$ %ulticollinearity >or -ormalit/ and -*inearit/" see -*ab &orrelation/.

    >or +!lticollinearit" see belo'.

    =$$? +D ,4A, +@*,& is greater than 60 or an average m!ch greater than 6. n this case" therenot m!lticollinearit.

    &. 'i(ariate Regression Hivariate regression prod!ces the same res!lt as bivariate correlation.

    >or e%ample" in o!r dataset 'e have a variable called -threshold6/ 'hich ass: n order to convict a person

    a crime" I!rors sho!ld feel that it is at least JJJJJK liel that the defendant is g!ilt of the crime. s -age/ related to this C!estion5

    A correlational analsis prod!ces the o!tp!t belo'" r L .603" p L .0E

    o'" letMs ans'er the same C!estion !sing regression

    6. Select naly)e77> Regression77>Linear2. +ove -threshold6/ into the DV bo%G move -age/ into the V bo%.

  • 8/11/2019 Lab 4 Regression

    3/6

    . &lic

  • 8/11/2019 Lab 4 Regression

    4/6

    d. After testing o!r hpothesis" you can also ,o eploratory3 analysisto loo at differentperm!tations of the variables. ts called -e%plorator/ analsis beca!se o! are e%ploring the data

    beond o!r initial hpothesis. >or o!r e%ample" 'ant to loo at the predictors of -threshold6/. am going to !se three predictors: age" se

    and -commit6/.

    a. -age/ is a predictor beca!se 'ant to see if the older the age" the higher the probabilit of g!ilt peop

    believe is necessar convict a person.b. -se%/ is a predictor beca!se 'ant to sho' o! that o! can enter -categorical/ variables into the

    analsis. 4o'ever" eep in mind that the categorical variables need be to dichotomo!s. f o! have a

    categorical variable 'ith more than 2 categories" o! need to create -d!mm codings/ 'hich red!cethe categorical variable into a series of dichotomo!s variables. e%plain later in this doc!ment ho' t-d!mm code/" b!t for right no' 'ant to incl!de -se%/ as a predictor to sho' o! ho' o! can en

    both contin!o!s and dichotomo!s variables into the same analsis.

    c. -commit6/ is a predictor beca!se it is theoreticall interesting to see ho' -commit6/ is related to-threshold6/.

    +!ltiple #egression

    6. Select naly)e77> Regression77>Linear

    2. +ove -threshold6/ into the DV bo%" and move the three predictors into the V bo%. &lic -Statistics/ and -collinearit diagnostics/.

    1. &lic

  • 8/11/2019 Lab 4 Regression

    5/6

    B#,$7@?:

    a. +!ltiple regression analsis 'as cond!cted to predict the percentage of g!ilt I!rors feel is necessar

    convict a defendant. ,hree predictors 'ere entered sim!ltaneo!sl into the analsis: age" gender" and

    C!estion asing 'hat percent of defendants bro!ght to trial did in fact commit the crime. ,he overalvariance e%plained b the three predictors 'as 3.6K. $ach predictor 'as positivel related to the

    o!tcome variable" s!ch as age (L .66" pL .01)" gender (L .6" pL .002)" and percent bro!ght to

    trial that are in fact g!ilt (L .6" pL .06).

    $VA*@A,

  • 8/11/2019 Lab 4 Regression

    6/6

    >or the second dichotomo!s variable" assign -0/ to the baseline gro!p" and -6/ to the second gro!p o! 'an

    to compare to the baseline" 'hich in o!r case is 6Ldemocrat. >or that dichotomo!s variable" the other

    categories are assigned -0/" so 0Lrep!blican" 0Lother. >or the third dichotomo!s variable" assign -0/ to the baseline gro!p" and -6/ to the third gro!p o! 'ant to

    compare to the baseline" 'hich in o!r case is 6Lother. >or that dichotomo!s variable" the other categories arassigned -0/" so 0Lrep!blican" 0Ldemocrat.

    4ere is ho' it is coded:

    #ep!blican Democrat