




已阅读5页,还剩111页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
.,1,zTreeWorkshop:FundamentalsofzTree,JustinEsareyFloridaStateUniversityDepartmentofPoliticalScienceJuly11th,2005,.,2,WhatiszTree?,ZurichToolboxforReadymadeEconomicExperimentsConsistsoftwoprogramszTree(theprogrammingenvironmentandexperimentserver)zLeaf(theclientprogramforsubjects)Designedprimarilyforpublicgoodsgames,structuredbargainingexperiments,posted-offer-marketsanddoubleauctions,.,3,WhatYouWillNeedtoPrograminzTree,zTreeandzLeafPrograms(zTree.exeandzLeaf.exe)Availableat/faculty/Sunder/ExperimentalEconomics/ExpEcon.htmlzTreeTutorialManual(ztree21tutorial.pdf)A“guidedtour”ofzTreescapabilities;moreinstructionalzTreeReferenceManual(ztree21ref.pdf)AnorganizedreferenceofzTreecode,.,4,ReadingstoDo,TodayBasicExperimentsandQuestionnaires(Tutorialpp.7-16,77-81)TomorrowRunningExperimentsandRecoveringData(Tutorialpp.83-89)FunctionsandControlStructures(Tutorialpp.17-41),.,5,ProgrammingASimplePublicGoodsGame,RecalltheideaofaPublicGoodsGame:Somegroupofpeople,sizeN,receiveanendowmentofmoneyEverypersonchoosessomeproportionoftheirendowmenttocontributeTotalcontributionsaremultipliedbyX1,theneveryonereceivesthatamountbackTotalpayoff=(EndowmentContribution)+(X*TotalContributions)/N,.,6,OpeningzTree,Esistnichtenglisch!,.,7,Changingthelanguagesettingwillnotaffectcurrentlyopentreatments.YouneedtoopenanewtreatmenttohavethedefaultssettoEnglish.,YoumustchangethelanguagesettingeverytimeyouopenzTree,evenifyourprogramwaswrittenunderthe“English”setting,becauseotherwiseservermessageswilldisplayinGermanwhenyouruntheprogram.,.,8,SettingLanguagebyDefault,.,9,StagesofaSimplePublicGoodsGame,SubjectsarebrokenintogroupsofNSubjectsreceivetheirendowmentSubjectsmakeachoiceforcontributionCalculatethesizeofthetotalpubliccontributionandmultiplybyXReportearnings(endowmentkept+shareofthepublicgood)toallsubjects(Repeat?),.,10,Terminology,Stage:Inanexperiment,onescreendisplayonwhichasubjectcantakeoneorafewactionsTreatment:Arelatedseriesofstagesthroughwhichsubjectspass;canberepeatingSession:Aseriesoftreatmentsallperformedonthesamesubjectsinsequence,.,11,StagesofaSimplePublicGoodsGame,SubjectsarebrokenintogroupsofNSubjectsreceivetheirendowmentSubjectsmakeachoiceforcontributionCalculatethesizeofthetotalpubliccontributionandmultiplybyXReportearnings(endowmentkept+shareofthepublicgood)toallsubjects,BackgroundStage,Stage1,Stage2,.,12,MoreTerminology,Program:Asetofproceduresusedtoassignvariables,calculatepayoffs,storeinformation,etc.ActiveScreen:ThescreenonwhichsubjectsseeinformationandmakedecisionsWaitingScreen:A“placeholder”screenthatsubjectsseeaftertheymakedecisionsinastageandarewaitingforothersubjectstofinishthestage,.,13,StagesofaSimplePublicGoodsGame,SubjectsarebrokenintogroupsofNSubjectsreceivetheirendowmentSubjectsmakeachoiceforcontributionCalculatethesizeofthetotalpubliccontributionandmultiplybyXReportearnings(endowmentkept+shareofthepublicgood)toallsubjects,BackgroundStage,Stage1,Stage2,.,14,OrderofExecution,.,15,Step1:SettingtheGeneralBackgroundParameters,Double-clickonBackgroundtoshowtheGeneralParametersdialogSetNumberofSubjectstotherightsize(inthiscase,8)SetNumberofGroupstotherightsize(inthiscase,2)SetPracticePeriodsto0(wewilldiscussthislater)SetPayingPeriodsto1(norepetitionsofthetreatment),.,16,SettingtheBackgroundParameters(Continued),ExchangerateMosteconomicexperimentsinvolvesomeformofcashrewardTherewardunitwithintheprogram(ExperimentalCurrencyUnits,orECUs)canbedenominateddifferentlythanthecashrewardWeseta1ECU=$1(or“1Franc”)exchangeratesubjectsseetheirrealpayoffsduringtheexperimentLumpSumPayment:ECUsyougivethesubjectthatcanchangeduringtheexperiment(a“bankroll”)Show-upFee:Dollars/Francsthatarepaidattheendoftheexperiment(XEFSstandardis$10),.,17,Step2:SetNon-GeneralBackgroundParametersfortheExperiment,Thinkaboutwhatvariableparameterswehaveinthisexperimentthenumberofsubjects(gen.background)thenumberofperiods(gen.background)Xthe“efficiencyfactor”thesizeoftheendowment,.,18,CreateaProgramtoStoretheVariables,PlacecursoronSessionSelectNewProgramfromtheTreatmentmenu,.,19,CreatingaNewProgram,UnderTableselectSubjectsCreatetwovariablenamesforXandtheEndowmentSyntax:variablename=number;PressOK,.,20,.,21,About“Tables”ofVariables,zTreestoresvariablesinseveraldifferenttables:Subjectsholdsvariablesthatmaybedifferentbetweensubjectsandbetweenperiods(mostreliable)Globalsholdsvariablesthatwillbethesameforallsubjectsbutmaydifferbetweenperiods(havehadtroublewiththisinthepast)Summarylikethesubjectstable,butusedtodisplayrunningstatisticsofanexperimentfortheexperimenterontheserverContractsholdsbuyand/orselloffersinauctionsSessionholdsvariablesthatmaydifferacrosssubjectsbutpersistsacrosstreatmentsInmostcases,theSubjectstableisappropriate,.,22,Step3:AskSubjectsforContributions,PlacecursoronBackgroundSelectNewStagefromtheTreatmentmenu,.,23,CreatingaNewStage,Givethestageaname,like“Contribution”UndertheStartmenu,selectWaitforall(sothatallsubjectsenterstagetogether)LeaveAtmostoneunchecked(usedtomakechoicessequential)UnderLeavestageaftertimeout,selectNo(makestimelimitnon-binding)UnderTimeout,select30(seconds),.,24,CreatingaScreenforSubjectstoEnterContribution,PlacecursoronActiveScreenSelectNewBoxStandardBoxfromtheTreatmentmenu,.,25,Terminology,Box:AcontainerinwhichtextdisplaysandentrybuttonsareplacedontheActiveScreen,.,26,CreatingaNewBox,1,2,3,4,5,6,7,.,27,LegendofBoxCreationScreen,Labelofthebox(notshowntosubjects)Sizeofthebox,inpointsorpercentoftheremainingscreenDistanceawayfromthe(remaining)screenedgeinpointsorpercentAdjustmentoftheremainingbox(whetherto“cutoff”thescreenabove,below,totheleft,ortotherightofthecurrentboxDisplayCondition(ifpresent,Booleanexpressionthatmustbetrueinorderforboxtobeshown)ButtonPosition(wheretoplacebuttonsinthisbox)Arrangement(howtoarrangebuttons),.,28,.,29,FinishingCreationofTheBox,.,30,PuttinganItemintotheBox,PlacecursoronContributionEntrySelectNewItemfromtheTreatmentmenu,.,31,CreatingtheTexttoDisplay,.,32,WaystoDisplayInformationinanItem,.,33,FinishingtheItemText:ATitleBox,.,34,ANewItem:ShowingtheEndowment,.,35,TheFinalItem:AnInputBoxforContribution,.,36,AButtontoEndtheStage,PlacecursoronthelastitemunderActiveScreenSelectNewButtonfromtheTreatmentmenuSetthebuttonasshown,.,37,.,38,Step3:CalculatePublicGood,Createanewstage,callit“DisplayOutcomes”Highlightthenewstage,thencreateanewprogramEnterthiscodeintotheprogram:Pgood=Efficiencyfactor*sum(same(Group),Contribution);Notethiscommand:sum(same(Group),Contribution)thistellsthecomputertosumupthevariable“Contribution”foreveryoneinthesameGroup,.,39,MorePrograms,Createanotherprogramunderthelastone,andenterthefollowingcode:N=count(same(Group);ThiscommandtellsthecomputertocountthenumberofpeoplewiththesamegroupnumberCreateanewprogramunderthelastone,andenterthiscodein:Profit=Pgood/N+(EndowmentContribution);Note:ProfitisareservedvariablenamethatzTreeusestorecordtheamountpaidtoasubject(inECUs)ineveryperiodProgramsMUSTbeseparate:youcannotuseavariablecreatedbyaprograminanotherexpressionuntiltheprogramhasbeencompletelyexecuted,.,40,.,41,Step4:DisplayOutcomes,CreateanewStandardbox,callit“FinalOutcome”SettheboxtotakeuptheentirescreenAdditemstothebox:PlaceatitleontheresultsDisplaytheamountthesubjectkeptDisplaytheamountofthesubjectsowncontributionDisplaythetotalcontributionofthegroupDisplaythesubjectsshareofthecontributionDisplaythefinalearningsofthesubjectPutabuttonintoleavethestage,.,42,.,43,SetGroupMatchingProtocol,SelectTreatmentParameterTableSelectallofthecellscorrespondingtothedifferentsubjectsinPeriod1,SelectTreatmentMatchingStranger,.,44,ThatsIt!,SavethefileusingFileSaveWearenowreadytorunanexperiment,.,45,SuggestedHomework,Trymodifyingtodaysprogramintoa“CommonPoolResource”Game(Ostrometal.APSRarticle,“CovenantsWithandWithoutaSword”)8agentshaveagivennumberofworkhoursinaday(say,10)andcanallocatethembetweenharvestingacommonpoolresource(x)andleisure(10-x)CPRyieldsdiminishingreturnstoincreasinglyintenseharvestingPayoff=x*(23X-0.25X2)+5(10-x),whereX=sum(x)overallsubjects,.,46,Questionnaires,.,47,Questionnaires,YoumustrunaquestionnaireattheendofanexperimentinordertoretrievethedatafromthatexperimentQuestionnairescanbesimple,justnamesandsocialsecuritynumbers,orinvolvemorecomplicatedsurveysToday,wewilldoasimpleexampleofaquestionnaireandshowmorecomplicatedexampleslater,.,48,CreateaQuestionnaire,GotoFileNewQuestionnaireDouble-clickon“Adress”(theGermanspellingofAddress,Ithink),.,49,BasicQuestionsinQuestionnaire,Questionsleftblankwillnotbeaskedtothesubjects.,Labelonthe“OK”Button,Whatyouenterintotheblankwillcorrespondtowhattheheaderontheanswerblankwillread;forexample,youcanusethe“PostalCode”blanktogatherinformationaboutSocialSecurityNumbers,.,50,AddingaFinalDisplayScreen,Select(single-click)“Adress”,thengotoQuestionnaireNewQuestionFormYoucanadditemstothisquestionform,justlikeyoudowithaboxinanormaltreatmentTypicalitemstodisplaymightinclude:ThevariableFinalProfittotalearningsfromtheexperiment,notincludingtheshow-upfeeThevariableShowUpFeeCreateitems(withlabels)todisplaythesevariables,.,51,TheFinalQuestionnaire,.,52,RunningaSession,.,53,RunninganExperiment,OpenzTreeandTreatmentFilesontheExperimenterServerMakesurelanguageissetcorrectlySetMatchingprotocol(ifnecessary)OpenzLeafoneverySubjectcomputerMakesurelanguageandnamesaresetupcorrectlyonzLeafprogramsChecktomakesureclientsareconnectedRunexperimenttreatmentsMonitorSubjectstableandClientstableRunquestionnaire;readPaymentfilesCollectdataandsplittables,.,54,zTreesAdvantage:EasyNetworking,AllyouneedtodoisopenzTreeontheexperimenterPCfirst,thenopenzLeafoneachclientPCMakesurethat,inthesamedirectoryaszLeaf,thereisanotepadfilecalledserver.eecwiththeIPaddressoftheservercomputeronit,.,55,SettingLanguageandNameonzLeaf,CreateashortcuttothezLeafoneachSubjectclientIntheTargetblank,putin:/NamePutinadifferentnameforeachSubjectclientcomputersothatyoucantellthemapart,.,56,VerifyingthatClientsareConnected:TheClientsTable,.,57,EightClients(NamedCorrectly)AreConnectedtothisServer,.,58,StartingtheTreatment,.,59,MonitorSubjectProgress,TheClientstableandtheSubjectstableprovidemostoftheimportantinformation,.,60,OpeningtheSubjectsTable,.,61,CurrentStagethatSubjectisin,TimeRemaininginStage,VariableValuesforEachSubject,InformationinClientandSubjectTables,.,62,StartingtheQuestionnaire,.,63,The“Adress”FormShown,.,64,ThePaymentFile,Onceeverysubjecthasfinishedthequestionnaire(asyoucanmonitorintheClientstable)apaymentfilewillbewrittenOpenthisfileinExceltoseepayoffs,.,65,PaymentFileDetails,.,66,CollectingandOrganizingtheData,zTreenamesfilesaccordingtodateplusarandomcode:YYMMDDCC.xxxY=Year,M=Month,D=Day,C=codeSeveralfilesareofinterestSubjectfile:.sbj(Questionnaireanswersstoredhere)Gamesafe:.gsf(InternalzTreeStorage)CollectedTables:.xls(VariablesfromTreatment),.,67,SplitTables/TreatmentsApart,ClosezTreeMakesurezTreeisreallyclosed(useCtrl-Alt-DeleteandcloseanyinstancesofzTreeRe-openzTree,selectToolsSeparateTables,Selectthe.xlsfilefromthelasttreatment,.,68,NewFilesCreated,TreatmentNumber,TableName,.,69,SampleTreatmentRun,Onyourdesktop,createashortcuttozLeafCallit/Name,whereIgiveyouthenumber,.,70,Howcanyoutestprogramsonyourown?,OpenyourtreatmentwithzTreeOpenasmanyzLeafShortcutsonyourowncomputerasnecessarytorunthetreatmentNamethemdifferentlytohelpdifferentiatethemRuntreatmentinzTreeasnormal,switchingamongzLeafs(usingAlt-Tab)tomakeentries,.,71,MoreComplicatedPrograms:FunctionsandSimpleControlStatements,.,72,GuesstheSineFunction,.,73,zTreeImplementsManyMathematicalFunctions,.,74,zTreealsoImplementsMany“Table”Functions,.,75,AnotherExample:A“GuesstheAverage”Game,.,76,TheScopeOperatorWithinTables,.,77,TheScopeOperatorBetweenTables,SupposethattheaboveprogramisbeingexecutedintableA,andthatthereisavariablevpresentintablesA,B,andCNotethatthesyntaxB.function()executedintableAdrawsvariablesfromtableBforexecution;thescopeoperatormovestheexecutiontothenexthighertable,.,78,Techniques:RankingSubjects,Givesubjectsaranktiesgotoalowernumber,Givesubjectsaranktiesgotoahighernumber,Inthecaseofatie,rewardsubjectaccordingtotheir“average”rank,.,79,RankingSubjectsboxesintheContainerdividethecolumnintocells;oneitemisplacedintoeachbox,Example:UsingContainerBoxes,.,103,MoreComplicatedPrograms:ArraysandIterators,.,104,StoringVectors,zTreecanstorevectorsofvaluesbycreatingarrayobjectsValuesforelementsofthearrayareassignedusingthissyntax:arraynamei=1;,.,105,ArraysandIteratorFunctions,ArrayscanbeusedinconjunctionwithiteratorfunctionsinordertoquicklyassignaseriesofvaluesIteratorsrepeatedlyexecuteaportionofaprogram,incrementingthevalueofavariableasitgoesIteratorstatementsmustbeappendedtootherfunctions,like“sum”or“do”usingasyntaxlikeiterator(i,10).sum(arraynamei,v),.,106,ExampleofIteratorSyntaxUsedwithArrays,.,107,ThingszTreeCannotdoWithArrays,Storematrices(orarraysthathaveotherarraysaselements)Domatrixmultiplicationorothermatrixoperations,.,108,MoreComplicatedP
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 北京版小学一班级上册 走
- 2025年电子商务运营专员面试模拟题集与解析
- 2025年焊接技术实战模拟题集含钎焊部分及答案详解
- 【2025-2月更新】《新课标体育与健康》水平二 篮球大单元教案(共18课时)
- 2025年注册会计师考试CPA备考攻略与模拟题解析
- 2025年高级工职业技能鉴定备考指南与模拟试题详解灌区管理篇
- 2025年财务分析师招聘面试模拟题及应对技巧
- 2025学年安徽省皖东名校中考化学二模试卷
- 2025年物联网技术前沿知识中级工程师面试题集
- 2025年电力行业技术规范与安全培训试题及答案解析
- 教师薪酬与考核 新东方
- 人教版一年级上册数学全册教学课件(2022年12月修订)
- 国际贸易术语课件详解
- 一个华为客户经理回忆录资料讲解
- 2-2《大战中的插曲》课件28张-统编版高中语文选择性必修上册
- 中国文学理论批评史全套教学课件
- 《专题地图设计与编制实验》课程教学大纲
- 新人教版九年级下册初中化学全册课前预习单
- 质量成长记-过程模式作业表
- 工厂规章制度员工守则.doc
- 医疗质量与安全分析报告范文
评论
0/150
提交评论