mrqap tutorial for newbies

21
MRQAP tutorial Fariba Karimi [email protected] 24.11.2015

Upload: fariba-karimi

Post on 16-Apr-2017

1.216 views

Category:

Education


2 download

TRANSCRIPT

Page 1: MRQAP tutorial for newbies

MRQAPtutorial

[email protected]

24.11.2015

Page 2: MRQAP tutorial for newbies

Mul=pleRegressionQuadra=cAssignmentProcedure

Page 3: MRQAP tutorial for newbies

Whyregressioninnetworkanalysis?

•  Inferen=alsta=s=cshaveproventohaveveryusefulapplica=onstosocialnetworkanalysis.Atamostgenerallevel,theques=onof"inference"is:howmuchconfidencecanIhavethatthepa6ernIseeinthedataI'vecollectedisactuallytypicalofsomelargerpopula?on,orthattheapparentpa6ernisnotreallyjustarandomoccurrence?

Page 4: MRQAP tutorial for newbies

OLS(OrdinaryLeastSquare)

Y = β0 +β1X1 +β2X2 +...+ε

Dependentvariable

coefficients

Explanatory/independentvariables

residual

Page 5: MRQAP tutorial for newbies

OLS(OrdinaryLeastSquare)-test

null-hypothesisàSmallp-valuesuggeststhatcoefficientsaresignificant.E.g.p-value0.01meansthatcoefficientsaresignificantwith99%confidenceinterval.

Y = β0 +β1X1 +β2X2 +...+εβ = 0

Page 6: MRQAP tutorial for newbies

OLS(OrdinaryLeastSquare)-test

•  P-value:null-hypothesisà

Smallp-valuesuggeststhatcoefficientsaresignificant.E.g.p-value0.01meansthatcoefficientsaresignificantwith99%confidenceinterval.•  R-squared:quan=fyingmodelperformance.E.g.R-squared=0.4meansthatthemodelexplains40%ofthevaria=onsinthedependentvariables.

Y = β0 +β1X1 +β2X2 +...+ε

β = 0

Page 7: MRQAP tutorial for newbies

Problem

•  Observa=onsarenotindependentofeachother.IfAareconnectedtoBandBisconnectedC,itmaybelikelythatAisconnectedtoC.

•  Repea=ngobserva=onsàerrorcorrelatedwitheachother.Observa=onsinrowsandcolumnstendtobehighlycorrelatedwhichinfluencethestandarderror.

Page 8: MRQAP tutorial for newbies

Problem

•  Repea=ngobserva=onsàerrorcorrelatedwitheachother.Observa=onsinrowsandcolumnstendtobehighlycorrelatedwhichinfluencethestandarderror.

Page 9: MRQAP tutorial for newbies

WhatdoesQAPdo?

•  Essen=ally,whattheQAPdoesisto“scramble”thedependentvariabledatathroughseveralpermuta?ons.Bytakingthedata,and“scrambling”itrepeatedly,resul=nginmul=plerandomdatasetswiththedependentvariable—andthenmul=pleanalysescanbeperformed.

•  Thosedatasetsandanalysesformanempiricalsamplingdistribu=on,andwecancompareourcoefficientwiththissamplingdistribu?onofcoefficientsfromallthepermuteddatasets.

Page 10: MRQAP tutorial for newbies

Inotherwords…

•  Wearepreservingthedependencewithinrows/columns—butremovingtherela=onshipbetweenthedependentandindependentvariables.

Page 11: MRQAP tutorial for newbies

Friendship,age,class

A B C D E F G

A 0 1 0 0 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

≈ +

Friendship=e Agedifference educa=on

Page 12: MRQAP tutorial for newbies

Friendship,age,class

A B C D E F G

A 0 1 0 0 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

≈ +

Friendship=e Agedifference educa=on

Page 13: MRQAP tutorial for newbies

A B C D E F G

A 0 1 0 0 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

A B C D E F G

A 0 1 0 2 1 0 0

B 1 0 3 5 1 4 2

C 0 3 0 4 5 8 10

D 2 5 4 0 0 3 2

E 1 1 3 0 0 2 2

F 0 4 2 3 3 0 1

G 0 2 1 2 2 1 0

≈ +

Friendship=e Agedifference educa=on

•  Permutesdependentvariableslotsof=me.Measurethesamplingdistribu=onofthecoefficients.•  P-valueisapropor=onof=mesthattheobserva=onisFallingoutsidethesamplingdistribu=on.

QAPprocedure

Page 14: MRQAP tutorial for newbies

QAPprocess–graphrepresenta=on

��

��

��

��

��

��

��

��

��

���

��

��

��

��

��

��

��

��

��

��

��

����

��

��

����

��

��

before reshuffling ajer

Page 15: MRQAP tutorial for newbies

Availablefunc=ons

•  UCINET:tools->tes=nghypothesis->dyadic->regression(QAP)

•  R:library(statnet)->netlm•  c/python?

Page 16: MRQAP tutorial for newbies

Example1–thereisnocorrela=on

Page 17: MRQAP tutorial for newbies

Example1–thereisnocorrela=on

Page 18: MRQAP tutorial for newbies

Example2–thereisacorrela=on

Page 19: MRQAP tutorial for newbies

Example2–thereisacorrela=on

Page 20: MRQAP tutorial for newbies

Recap

•  QAPisusefulwhenwehavedyadicrela=onshipinthedata.

•  Usenetlmfunc=oninRfortheregressionanalysis.

•  Disadvantage:itisslowforlargenetworksize

Page 21: MRQAP tutorial for newbies

References•  Predic=ngwithnetworks:nonparametricmul=pleregressionanalysisofdyadicdata,D.Krackhardt(1981)

•  TheSNApackage,CTBuos(2014)•  hop://svitsrv25.epfl.ch/R-doc/library/sna/html/qaptest.html

•  hop://www.stata.com/mee=ng/1nasug/simpson.pdf

•  hop://www.erikgjesqeld.net/uploads/3/7/6/8/37685481/sna_code_(gjesqeld_and_phillips_2013).pdf