Lab 1: Replica-ng Oneal and Russe4 (2005) Linear - - PowerPoint PPT Presentation

lab 1 replica ng oneal and russe4 2005
SMART_READER_LITE
LIVE PREVIEW

Lab 1: Replica-ng Oneal and Russe4 (2005) Linear - - PowerPoint PPT Presentation

Lab 1: Replica-ng Oneal and Russe4 (2005) Linear probability model Logis-c regression R-help If you would like extra help with R, come and


slide-1
SLIDE 1

Lab ¡1: ¡Replica-ng ¡Oneal ¡and ¡ Russe4 ¡(2005) ¡

Linear ¡probability ¡model ¡ ¡ Logis-c ¡regression ¡

slide-2
SLIDE 2

R-­‑help ¡

  • If ¡you ¡would ¡like ¡extra ¡help ¡with ¡R, ¡come ¡and ¡ask ¡ques-ons ¡during ¡
  • ffice ¡hours. ¡
  • Room ¡141, ¡Manor ¡Road ¡Building. ¡

– Week ¡4 ¡

  • Tuesday ¡10.30 ¡-­‑ ¡12.30 ¡[A. ¡Murr] ¡
  • Wednesday ¡14.00 ¡-­‑ ¡15.30 ¡[S. ¡Kosmidis] ¡
  • There ¡are ¡also ¡great ¡resources ¡online: ¡e.g. ¡swirl ¡(package) ¡

– h4ps://www.rstudio.com/resources/training/online-­‑learning/ #R ¡ ¡ – h4ps://www.coursera.org/course/rprog ¡ – ¡h4ps://www.r-­‑project.org/mail.html ¡ – h4p://www.statmethods.net ¡ ¡ – h4p://stackoverflow.com ¡ – Google! ¡

¡

slide-3
SLIDE 3

Assessment ¡

  • essay ¡of ¡no ¡more ¡than ¡2000 ¡words ¡for ¡each ¡

core ¡subject ¡you ¡are ¡taking. ¡

  • due ¡on ¡WebLearn ¡by ¡noon ¡on ¡Friday ¡of ¡week ¡2 ¡
  • f ¡Hilary ¡Term ¡ ¡
  • Choose ¡an ¡empirical ¡finding ¡that ¡appears ¡in ¡an ¡

ar-cle ¡from ¡the ¡reading ¡list ¡of ¡your ¡core ¡

  • paper. ¡

– Introduce, ¡replicate, ¡discuss/present ¡alterna-ve ¡

  • pera-onaliza-ons, ¡include ¡a ¡figure ¡
slide-4
SLIDE 4

Pre-­‑lab ¡Assignment ¡

  • You ¡are ¡expected ¡to ¡complete ¡this ¡before ¡each ¡

lab ¡and ¡must ¡read ¡the ¡paper ¡to ¡answer ¡the ¡ ques-ons! ¡ ¡

  • This ¡is ¡important ¡– ¡before ¡conduc-ng ¡any ¡

sta-s-cal ¡analysis, ¡you ¡should ¡always ¡understand ¡ the ¡relevant ¡theory, ¡hypotheses, ¡and ¡causal ¡

  • mechanisms. ¡Otherwise, ¡you ¡risk ¡was-ng ¡-me ¡or ¡

reaching ¡inaccurate ¡conclusions ¡

  • You ¡have ¡5 ¡minutes ¡to ¡discuss, ¡and ¡then ¡we ¡will ¡

go ¡through ¡it ¡together ¡

slide-5
SLIDE 5
  • What ¡is ¡the ¡liberal ¡democra-c ¡peace? ¡

¡

  • What ¡is ¡Oneal/Russe4’s ¡contribu-on? ¡

¡

  • We ¡will ¡be ¡focusing ¡on ¡cri-cisms ¡1 ¡and ¡3. ¡ ¡What ¡are ¡they? ¡ ¡

And ¡how ¡do ¡the ¡authors ¡address ¡them? ¡ ¡

  • What ¡is ¡Oneal ¡and ¡Russe4’s ¡argument ¡about ¡the ¡liberal ¡

democra-c ¡peace ¡(i.e. ¡what ¡is ¡their ¡key ¡contribu-on ¡to ¡this ¡ debate)? ¡ ¡

  • What ¡is ¡the ¡unit ¡of ¡analysis ¡in ¡the ¡study ¡(e.g. ¡country, ¡

country-­‑year, ¡etc.)? ¡

slide-6
SLIDE 6

What ¡is ¡the ¡liberal ¡democra-c ¡peace? ¡

  • Idea ¡that ¡the ¡classical ¡liberals ¡were ¡right ¡– ¡

economic ¡interdependence ¡and ¡democracy ¡à ¡

  • peace. ¡This ¡is ¡related ¡to ¡the ¡democra-c ¡peace ¡
  • theory. ¡
  • Democra-c ¡peace ¡theory ¡or ¡hypothesis? ¡
slide-7
SLIDE 7

Oneal ¡& ¡Russe4 ¡

  • They ¡argue ¡for ¡the ¡liberal ¡democra-c ¡peace ¡
  • In ¡their ¡book ¡“Triangula-ng ¡Peace” ¡(2001), ¡Oneal ¡

and ¡Russe4 ¡argue ¡that ¡democracy, ¡economic ¡ interdependence ¡(trade), ¡and ¡membership ¡in ¡ IGOs ¡à ¡peace ¡(think ¡Kant). ¡They ¡also ¡contend ¡ that ¡peace ¡à ¡these ¡three ¡x ¡variables. ¡This ¡is ¡their ¡ key ¡contribu-on ¡to ¡the ¡debate. ¡

  • In ¡this ¡paper, ¡they ¡refute ¡the ¡idea ¡that ¡parsimony ¡

is ¡the ¡gold ¡star ¡in ¡quan-ta-ve ¡papers ¡(they ¡prefer ¡ controlling ¡for ¡other ¡explana-ons). ¡

slide-8
SLIDE 8

Main ¡Cri-cisms ¡

1. Ray ¡claims ¡that ¡the ¡causes ¡of ¡war ¡and ¡of ¡militarized ¡disputes ¡are ¡

  • different. ¡

2. He ¡ques-ons ¡the ¡robustness ¡of ¡the ¡evidence ¡that ¡has ¡been ¡presented ¡for ¡ the ¡conflict ¡reducing ¡effect ¡of ¡economic ¡interdependence, ¡arguing ¡that ¡ these ¡results ¡depend ¡upon ¡a ¡par2cular, ¡complex ¡specifica-on ¡that ¡is ¡

  • inappropriate. ¡

3. He ¡argues ¡that ¡our ¡efforts ¡to ¡test ¡liberal ¡and ¡realist ¡theories ¡generally ¡ produce ¡meaningless ¡results ¡because ¡of ¡the ¡complexity ¡of ¡our ¡ regression ¡analyses. ¡ 4. He ¡presents ¡results ¡indica-ng ¡that ¡the ¡effects ¡of ¡the ¡liberal ¡(and ¡realist) ¡ variables ¡in ¡our ¡model ¡differ ¡when ¡es-mated ¡with ¡informa-on ¡from ¡ 2me ¡series ¡rather ¡than ¡cross ¡sec2onal ¡varia2on. ¡ 5. He ¡suggests ¡that ¡the ¡pacific ¡benefits ¡of ¡democracy ¡and ¡ interdependence ¡are ¡spurious ¡and ¡their ¡conflict-­‑reducing ¡effects ¡are ¡ probably ¡a;ributable ¡to ¡economic ¡development, ¡though ¡he ¡gives ¡no ¡ evidence ¡for ¡this ¡claim. ¡

slide-9
SLIDE 9

What ¡is ¡the ¡author’s ¡strategy ¡for ¡ dealing ¡with ¡them ¡(1 ¡& ¡3 ¡specifically)? ¡ ¡

  • 1. ¡Oneal/Russe4 ¡test ¡the ¡cri-que ¡and ¡present ¡

results ¡sugges-ng ¡the ¡causes ¡of ¡these ¡different ¡ dispute ¡types ¡are ¡the ¡same. ¡

  • 3. ¡Oneal/Russe4 ¡perform ¡another ¡analysis ¡of ¡

fatal ¡disputes, ¡including ¡all ¡4 ¡controls ¡from ¡ tables ¡3 ¡and ¡4 ¡as ¡well ¡as ¡all ¡the ¡possible ¡ combina-ons ¡of ¡the ¡variables ¡of ¡theore-cal ¡ interest ¡ ¡– ¡the ¡results ¡are ¡not ¡all ¡presented ¡in ¡ the ¡paper ¡

slide-10
SLIDE 10

What ¡is ¡the ¡unit ¡of ¡analysis? ¡

  • ¡The ¡Oneal/Russe4 ¡data ¡is ¡dyad-­‑year. ¡This ¡

means ¡it ¡looks ¡at ¡pairs ¡of ¡states ¡over ¡-me. ¡ ¡

  • Dyadic ¡vs. ¡monadic ¡analysis: ¡ ¡

– dyadic ¡research ¡design ¡has ¡the ¡benefit ¡of ¡shiling ¡ the ¡focus ¡onto ¡the ¡interdependence ¡that ¡exists ¡ between ¡states ¡ – i.e. ¡it’s ¡not ¡state ¡A’s ¡level ¡of ¡democracy ¡that ¡ ma4ers, ¡but ¡the ¡rela-onship ¡between ¡state ¡A ¡and ¡ state ¡B’s ¡level ¡of ¡democracy ¡

slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13

Now ¡to ¡R, ¡but ¡first ¡things ¡first… ¡

  • It’s ¡also ¡important ¡to ¡save ¡your ¡work ¡

– Click ¡“file” ¡à ¡“save”, ¡if ¡it ¡asks ¡about ¡encoding, ¡use ¡ the ¡default ¡and ¡ignore ¡the ¡warnings! ¡

  • It’s ¡a ¡good ¡habit ¡to ¡start ¡fresh, ¡especially ¡on ¡

shared ¡computers ¡

– Click ¡the ¡broom ¡(top ¡right) ¡to ¡clear ¡the ¡workspace ¡ before ¡star-ng ¡

R ¡

slide-14
SLIDE 14

Exercise ¡1: ¡Loading ¡& ¡Examining ¡Data ¡

  • Explore ¡and ¡manipulate ¡the ¡data: ¡

– View ¡(), ¡str ¡(), ¡summary ¡(), ¡table ¡(), ¡sum ¡(), ¡length ¡(), ¡unique ¡(), ¡head ¡(), ¡ typeof ¡(), ¡class ¡(), ¡names ¡(), ¡prop.table ¡( ¡table ¡()), ¡c(), ¡fix ¡() ¡ – you ¡can ¡search ¡help ¡in ¡the ¡lower-­‑right ¡corner ¡or ¡by ¡typing ¡?str, ¡for ¡ example ¡

  • How ¡many ¡dyad-­‑years ¡have ¡a ¡MID ¡onset? ¡ ¡Fatal ¡MID ¡onset? ¡ ¡War ¡
  • nset? ¡
  • How ¡many ¡years ¡are ¡in ¡the ¡dataset? ¡
  • How ¡many ¡countries ¡are ¡analyzed? ¡– ¡see ¡e.g. ¡below ¡

– A ¡<-­‑ ¡unique(oneal$abb_a) ¡# ¡how ¡many ¡unique ¡states ¡in ¡A ¡ – B ¡<-­‑ ¡unique(oneal$abb_b) ¡# ¡how ¡many ¡unique ¡states ¡in ¡B ¡ – C ¡<-­‑ ¡c(A,B) ¡# ¡combine ¡the ¡2 ¡ – country_count ¡<-­‑ ¡unique(C) ¡# ¡how ¡many ¡total ¡(this ¡is ¡your ¡answer) ¡ – setdiff(A, ¡B) ¡# ¡you ¡can ¡check ¡which ¡don't ¡overlap ¡

àR ¡

slide-15
SLIDE 15

Linear ¡Probability ¡Model ¡(LPM) ¡

  • OLS ¡can ¡have ¡binary ¡independent ¡(x) ¡variables ¡but ¡is ¡
  • len ¡not ¡used ¡with ¡binary ¡dependent ¡(y) ¡variables ¡ ¡
  • When ¡it ¡is ¡happens, ¡it ¡is ¡called ¡a ¡LPM ¡
  • Pr(Y ¡= ¡1) ¡= ¡b0+b1x1+b2x2+·√·√·√+bkxk ¡

– Here, ¡the ¡coefficient ¡expresses ¡the ¡change ¡in ¡probability ¡ that ¡Y ¡= ¡1 ¡(i.e. ¡event ¡occurs) ¡associated ¡with ¡a ¡unit ¡ change ¡in ¡Xn, ¡all ¡else ¡equal. ¡ ¡ – E.g. ¡Say ¡having ¡a ¡“majpower” ¡in ¡the ¡dyad ¡increases ¡the ¡ probability ¡of ¡an ¡MID ¡by ¡3 ¡percentage ¡points ¡(If ¡the ¡coeff. ¡ is ¡0.03) ¡

R ¡

slide-16
SLIDE 16

Exercise ¡2: ¡Replicate ¡Table ¡1 ¡(LPM) ¡

  • Replicate ¡Table ¡1 ¡(albeit ¡with ¡LPM, ¡not ¡logit… ¡

for ¡now) ¡

  • Focus ¡on ¡interpre-ng ¡the ¡coefficients ¡
  • Check ¡your ¡answers ¡with ¡a ¡partner! ¡

¡

  • Only ¡if ¡you ¡have ¡-me: ¡

– Answer ¡the ¡China ¡ques-on ¡(but ¡do ¡think ¡about ¡it) ¡

àR ¡

slide-17
SLIDE 17

What ¡we’ve ¡all ¡been ¡wai-ng ¡for ¡-­‑ ¡ Logis-c ¡Regression ¡

  • Logis-c ¡regression ¡is ¡generally ¡used ¡when ¡the ¡

dependent ¡variable ¡(y) ¡is ¡binary ¡(coded ¡0/1) ¡

  • part ¡of ¡the ¡GLM ¡family ¡(generalized ¡linear ¡

models) ¡

  • GLMs ¡are ¡used ¡when ¡the ¡dependent ¡variable ¡

does ¡not ¡follow ¡a ¡normal ¡distribu-on. ¡

slide-18
SLIDE 18

Logis-c ¡Regression ¡

  • The ¡lel ¡hand ¡side ¡of ¡the ¡equa-on ¡(logit) ¡is ¡

now ¡the ¡“log ¡of ¡the ¡odds ¡that ¡y ¡= ¡1” ¡instead ¡of ¡ “y”. ¡

  • 0.75/(1-­‑0.75) ¡à ¡3:1 ¡odds ¡à ¡log ¡(3)=1.01 ¡log ¡
  • dds ¡
  • The ¡rela-onship ¡between ¡the ¡logit ¡and ¡

predictors ¡(right ¡side ¡of ¡the ¡equa-on) ¡is ¡linear. ¡ ¡

m mx

b x b x b a y y + + + + = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = − = ... ) 1 Pr( 1 ) 1 Pr( ln

2 2 1 1

slide-19
SLIDE 19

Logis-c ¡Regression ¡Interpreta-on ¡

  • ¡The ¡coefficient ¡(bn) ¡in ¡logis-c ¡regression ¡is ¡

now ¡a ¡log ¡odds ¡ra4o. ¡ ¡

– If ¡you ¡have ¡a ¡coeff. ¡of ¡1.51 ¡for ¡variable ¡x, ¡a ¡one-­‑ unit ¡increase ¡in ¡x ¡à ¡an ¡increase ¡of ¡1.51 ¡in ¡the ¡log ¡

  • dds ¡of ¡y ¡
  • What ¡does ¡this ¡even ¡mean? ¡ ¡
slide-20
SLIDE 20

m mx

b x b x b a y y + + + + = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = − = ... ) 1 Pr( 1 ) 1 Pr( ln

2 2 1 1

slide-21
SLIDE 21

More ¡on ¡odds ¡ra-os ¡

  • Coefficients ¡(log ¡odds) ¡vary ¡from ¡(-­‑∞, ¡∞), ¡ ¡
  • Odds ¡(ra-os) ¡vary ¡from ¡0 ¡to ¡∞, ¡ ¡
  • probability ¡varies ¡from ¡[0, ¡1] ¡
  • Odds ¡ra-o ¡are ¡never ¡nega-ve ¡(nega-ve ¡coefficients ¡à ¡

an ¡odds ¡ra-o ¡between ¡0 ¡& ¡1). ¡ ¡

  • E.g. ¡say ¡variable ¡Xn ¡has ¡a ¡coefficient ¡of ¡-­‑3 ¡in ¡your ¡logit ¡

model, ¡what ¡happens ¡when ¡Xn ¡increases ¡by ¡1? ¡

– à ¡e-­‑3 ¡à ¡= ¡ ¡0.05, ¡i.e. ¡odds ¡get ¡about ¡95 ¡percent ¡smaller. ¡ ¡

  • E.g. ¡coefficient ¡of ¡0? ¡à ¡odds ¡ra-o ¡of ¡1 ¡ ¡

– independent ¡variable ¡does ¡not ¡affect ¡the ¡odds ¡of ¡outcome. ¡

slide-22
SLIDE 22

Logis-c ¡interpreta-on ¡prac-ce ¡

  • Coefficient ¡of ¡1.51? ¡
  • e1.51 ¡= ¡4.53 ¡ ¡… ¡in ¡R, ¡exp ¡(1.51) ¡

– increase ¡of ¡1 ¡unit ¡in ¡x, ¡makes ¡the ¡odds ¡of ¡the ¡ event ¡4.5 ¡-mes ¡greater, ¡all ¡else ¡equal. ¡ ¡

  • Coefficient ¡of ¡0.01? ¡ ¡

– exp(0.01) ¡= ¡odds ¡ra-o ¡effect ¡of ¡1.01 ¡ – i.e. ¡1 ¡unit ¡increase ¡in ¡x ¡variable ¡is ¡associated ¡with ¡ 1 ¡percent ¡increase ¡in ¡the ¡odds ¡of ¡the ¡event, ¡all ¡ else ¡equal. ¡ ¡

slide-23
SLIDE 23

Exercise ¡3(a): ¡Logit ¡

  • Try ¡out ¡the ¡three ¡simple ¡logits ¡on ¡the ¡

handout, ¡and ¡we’ll ¡interpret ¡them ¡together ¡

– mzmid1 ¡~ ¡lndstab ¡ – mzmid1 ¡~ ¡allies ¡ – mzmid1 ¡~ ¡lndstab ¡+ ¡allies ¡

R ¡

slide-24
SLIDE 24

Exercise ¡3(b): ¡Table ¡1 ¡Replica-on ¡

  • Replicate ¡Table ¡1 ¡with ¡logit ¡and ¡interpret ¡your ¡

results ¡

– Do ¡we ¡s-ll ¡get ¡the ¡expected ¡results? ¡

  • Focus ¡especially ¡on ¡smldem ¡and ¡smldep. ¡ ¡

– Are ¡they ¡significant? ¡ ¡What ¡do ¡their ¡coefficients ¡ mean ¡in ¡odds ¡ra-os? ¡ ¡Given ¡the ¡variance ¡of ¡the ¡ independent ¡variables ¡they’re ¡a4ached ¡to? ¡

  • Check ¡with ¡your ¡partner ¡

àR ¡

slide-25
SLIDE 25

If ¡we ¡have ¡-me… ¡

  • You ¡can ¡get ¡all ¡the ¡odds ¡ra-os ¡at ¡once ¡using: ¡

– exp ¡(cbind ¡(OR ¡= ¡coef ¡(mylogit), ¡confint ¡(mylogit))) ¡ ¡

  • Try ¡making ¡a ¡subset ¡of ¡the ¡data ¡using ¡the ¡subset ¡
  • command. ¡
  • Discuss: ¡

– What ¡are ¡the ¡benefits ¡associated ¡with ¡including ¡“-me” ¡in ¡a ¡ regression ¡analysis ¡(hint: ¡think ¡of ¡how ¡we ¡try ¡establish ¡ causality ¡in ¡social ¡science ¡research)? ¡ ¡ – Could ¡this ¡research ¡have ¡been ¡done ¡in ¡a ¡cross-­‑sec-onal ¡ format ¡(i.e. ¡all ¡variables ¡measured ¡at ¡same ¡-me ¡instead ¡of ¡

  • ver ¡-me)? ¡

– What ¡are ¡the ¡benefits ¡and ¡drawbacks ¡of ¡parsimonious ¡ sta-s-cal ¡models? ¡ ¡