MRQAP tutorial for newbies
-
Upload
fariba-karimi -
Category
Education
-
view
1.213 -
download
2
Transcript of MRQAP tutorial for newbies
Mul=pleRegressionQuadra=cAssignmentProcedure
Whyregressioninnetworkanalysis?
• Inferen=alsta=s=cshaveproventohaveveryusefulapplica=onstosocialnetworkanalysis.Atamostgenerallevel,theques=onof"inference"is:howmuchconfidencecanIhavethatthepa6ernIseeinthedataI'vecollectedisactuallytypicalofsomelargerpopula?on,orthattheapparentpa6ernisnotreallyjustarandomoccurrence?
OLS(OrdinaryLeastSquare)
Y = β0 +β1X1 +β2X2 +...+ε
Dependentvariable
coefficients
Explanatory/independentvariables
residual
OLS(OrdinaryLeastSquare)-test
null-hypothesisàSmallp-valuesuggeststhatcoefficientsaresignificant.E.g.p-value0.01meansthatcoefficientsaresignificantwith99%confidenceinterval.
Y = β0 +β1X1 +β2X2 +...+εβ = 0
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
Problem
• Observa=onsarenotindependentofeachother.IfAareconnectedtoBandBisconnectedC,itmaybelikelythatAisconnectedtoC.
• Repea=ngobserva=onsàerrorcorrelatedwitheachother.Observa=onsinrowsandcolumnstendtobehighlycorrelatedwhichinfluencethestandarderror.
Problem
• Repea=ngobserva=onsàerrorcorrelatedwitheachother.Observa=onsinrowsandcolumnstendtobehighlycorrelatedwhichinfluencethestandarderror.
WhatdoesQAPdo?
• Essen=ally,whattheQAPdoesisto“scramble”thedependentvariabledatathroughseveralpermuta?ons.Bytakingthedata,and“scrambling”itrepeatedly,resul=nginmul=plerandomdatasetswiththedependentvariable—andthenmul=pleanalysescanbeperformed.
• Thosedatasetsandanalysesformanempiricalsamplingdistribu=on,andwecancompareourcoefficientwiththissamplingdistribu?onofcoefficientsfromallthepermuteddatasets.
Inotherwords…
• Wearepreservingthedependencewithinrows/columns—butremovingtherela=onshipbetweenthedependentandindependentvariables.
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
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
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
QAPprocess–graphrepresenta=on
��
�
�
�
��
�
��
��
��
��
��
��
��
���
�
�
�
�
��
�
��
��
��
��
��
��
��
��
��
�
��
�
�
�
����
��
��
����
��
��
before reshuffling ajer
Availablefunc=ons
• UCINET:tools->tes=nghypothesis->dyadic->regression(QAP)
• R:library(statnet)->netlm• c/python?
Example1–thereisnocorrela=on
Example1–thereisnocorrela=on
Example2–thereisacorrela=on
Example2–thereisacorrela=on
Recap
• QAPisusefulwhenwehavedyadicrela=onshipinthedata.
• Usenetlmfunc=oninRfortheregressionanalysis.
• Disadvantage:itisslowforlargenetworksize
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