General Linear ModelWord格式.docx
- 文档编号:18854521
- 上传时间:2023-01-01
- 格式:DOCX
- 页数:11
- 大小:68.44KB
General Linear ModelWord格式.docx
《General Linear ModelWord格式.docx》由会员分享,可在线阅读,更多相关《General Linear ModelWord格式.docx(11页珍藏版)》请在冰豆网上搜索。
Amajorsubthemeistoshowthattheanalysisofvariance,theanalysisofcovariance,theanalysisofmultipleregression,andawholebunch(host)ofotherthingsarejustvariationsonacommontheme.
Iwantstudentstounderstandthebasicideaofcoding(dummy)variables,butthespecifics(details)arenotimportant.
Example
IamgoingtouseoneofthesmokingexamplesfromSpilichthatwehaveseeninothercontexts.Thedatafile(Spilich.sav)containsdataonallgroups,butweareonlygoingtolookatthegroupthatwasgivenastandardrecalltask--acognitivetask.
Threebasicgroups.
∙Nonsmokers(peoplewhoneversmoked)
∙Delayedsmokers(Smokerswhohadnothadacigaretteforseveralhours)
∙Activesmokers(Smokerswhosmokedduringthetask.)
Thedependentvariablewasthenumberoferrorsmadeduringtherecalltask.
StandardAnalysisofVariance:
DescriptiveStatistics
Grandmean=38.778
Plot
Plotwitherrorbars(barsrepresent95%CI)
Anova
Itisclearthattherearesignificantdifferencesbetweengroups.IwillevengoaheadandcomparetheNon-smokerswiththecombinedsmokinggroups,andthenthetwosmokinggroupswitheachother.Thisisforcomparisonpurposeslater.
Ididthiswiththeone-wayprocedureandstandardcontrasts.
HerewecanseethatNon-smokersdifferfromsmokers,butthatthetwosmokinggroupsdonotdifferbetweenthemselves.
TheGLMapproach
FirstweneedtocodethedatatoindicateGroups.
∙WealreadyhaveGroupsas1,2,and3,butwearegoingtodoitdifferently.
oThereasonthatwehavetodoitdifferentlyisduetothefactthatourcodingiscompletelyarbitrary.Wecouldhavecodedthemas2,1,and3.Anyregressionagainstgroupmembershipwouldbeentirelydependentontheorderinwhichwecoded--that'
sabadthing..
∙WewillsetupdummyvariablesthattelluswhetherasubjectisinGroup1ornot,andwhetherhe/sheisinGroup2ornot.
oIhavecalledthesenewvariablesNonSmokeandDelayed,becausetheyidentifythosewhoareinthosetwogroups.
∙Wedon'
tneedtocodeforGroup3,becauseifyou'
renotin1or2,youmustbein3.
∙The"
filter"
variablebelowjustselectedtheCognitivetask,andignoredtheothertwotasks.
Task
Group
Errors
distract
filter
NonSmoke
Delayed
2.00
1.00
27.00
126.00
1
.00
34.00
154.00
19.00
113.00
omitted
2.00
48.00
.00
1.00
29.00
100.00
114.00
3.00
108.00
-1.00
-1.00
65.00
191.00
55.00
112.00
omitted
(ExplainwhyIused-1foreachdummyvariableforpeopleinthelastgroup.
Thismakestheinterceptcomeouttobethegrandmean,andexpressestheresultsindistancefromthegrandmean,ratherthandistancefromthemeanofsomearbitrarygroup.
Thisideaisimportant,becauseifwearen'
tcarefulitiseasytogetanswerstotellusaboutdeviationsfromsomesinglegroup,andthatusuallyisn'
twhatweareafter.
Herewecometothefirstimportantidea.Ihavetakenacategoricalvariablewith3(k)levelsandturneditinto2(k-1)
newvariables.Thesetwovariablescarryalltheinformationthatthesinglevariabledid,andaremoreuseful.
RegressionApproachusingDummyVariables
IwillnowsimplypredictErrorsusingNonsmokeandDelayedasmypredictorvariables.Thisisastandardmultipleregression.
LookfirstattheAnovatestfortheregression
F=4.744,p=.014
ThisisexactlythesameresultwegotwhenweranthetraditionalAnova.
Explainwhythisshouldbe.
LooknextattheR2value=.184.Thisisnothingbuteta-squared
GotothetableheadedCoefficients
Thefollowing(uptothenextmajorheading)ismaterialthatIfindimportantandhelpful,butifitaddstoinformationoverload,setitasidefornow.
NotethattheIntercept=38.778.Thisisexactlyequaltothegrandmeanofallthegroups.Interceptequalsgrandmean.
NotethattheslopeforNonsmoke=-9.911.ThisisexactlyequaltothedifferencebetweentheNonsmokemeanandthegrandmean.
NotethattheslopeforDelayed=1.157.ThisisthedifferencebetweentheDelayedmeanandthegrandmean.Slopeequalsdifferencebetweencorrespondingpredictormeanandgrandmean.
WhynothaveaslopeforActive?
?
Itwouldberedundant(excessive)--ifweknowthegrandmeanandthedeviationoftheothertwogroups,wecancomputethedeviationofthe3rdgroup.
Thesumofthedeviationsfromthemean=0.So,thedeviationofthethirdgroupis0-(-9.911)-1.156=8.755
IfIhadcodedforActiveandDelayed,andleftoutNonSmoke,Iwouldgetaninterceptof38.778,slopeforactive=8.755,slopeforDelayed=1.157,andcouldcomputeslopeforNonSmoke=-9.911.Thisillustratesthatthechoiceisarbitraryandunimportant.
TestingContrasts
Iforgottodooneadditionalthing,soIwentbackanddidit.IaskedSPSStocompute"
deviationcontrasts"
whenitrantheAnova.
Deviationcontrastsarecomparisonsofeachmeanwiththegrandmean.(Again,itdoesn'
tdoallthree--itleavesoutone,whichinthiscasewasthelastone.)
Outputbelow:
Notethatthetestsandtheprobabilitiesareexactlythesameasthetests(andprobabilities)ontheregressionequation.
Whyshouldthisbe?
Whatisallofthisabout?
IwanttoshowthatAnovaandRegressionarebasicallythesameprocedure.Theonlydifferenceherebetweenthisregressionandstandardmultipleregressionistheuseofdummyvariables.
Therearealotofimportantthingshere,buttheirimportancedoesn'
tshowupuntilwemovetomorecomplexanalyses.
GLMandFactorialAnova
Nowthingsgetinteresting.
First,wewilltakethesameexample,butwithallthreetasks,andcreatedummyvariablesforthedifferenttasksaswell.(Again,wecreatedummyvariablesforonlytwoofthetasks.)
Thenwecreateinteractiondummyvariablesbymultiplyingourdummiestogethertocreate4newvariables.
Nonsmoke*Patrec,Nonsmoke*Cogit,Delayed*Patrec,andDelayed*Cognit
TheoverallFactorialAnovafollows:
Regressionapproach
Wewillstartwiththecompletemultipleregressionusingalldummyvariablesaspredictors.Herewearetryingtoexplainvarianceinerrorsasafunctionofeverythingweknowaboutgroups,tasks,andtheirinteractions.
Regression
CommentonSSregressionasbeingequivalentto"
Model"
inregularAnova(Explainwhy8df.)10-2=8
Commentontheerrorterm.
Thiserrortermisallofthevariancein"
errors"
thancannotbeexplainedonthebasisofgroups,tasks,ortheirinteractions.Thisisthestandarderrorterminthefactorialanalysisofvariance.
NowstudentsshouldunderstandwhySPSSpresentstheAnovasummarytablethewayitdoes,evenifthatisaconfusingwaytohavechosentopresentit.
RemovingtheInteractionTermsgives:
ThedifferenceintheSSregressionis31744.726-29016.074=2728.652.
ThisistheSSfortheinteractiontermintheAnova.
RemovingtheTaskTerms(afterreplacinginteraction)gives:
IfwesubtractthisSSregressionfromtheSSregressioninfullmodel,weget
31744.726-3083.200=28661.526
ThisistheeffectofTask
Lastly,lookatthemodelwithdummyvariablesforTaskandInteraction,butnodummyvariablesforCondition
Herethedifferencebetweenthefullandreducedmodelsis
31744.726-31390.178=354.548
ThisistheeffectofCondition.
Noticethateachofthisisbasicallywhatwecalledahierarchicalmodelearlier.Thedifferencebetweenthefullmodelandareducedmodeliswhattheextravariable(s)explainoveranabove(controllingfor)theothervariables.
FromhereIgetthefollowingmodels:
Model
SSreg
Difference
SSerror
Effect
Full
31744.726
13587.200
Error
Maineffects
29016.174
2728.652
Interaction
Task.+Interaction
31390.178
354.548
Condition
Cond+Interaction
3083.200
28661.526
Task
Butwearen'
tdone.
Yesweareforclass.Ihavelefttherest
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- General Linear Model