您好,欢迎访问三七文档
1Paper109-31IntroductiontoSAS®EnterpriseGuide®4.1forStatisticalAnalysisCharlesHallahan,EconomicResearchService,USDALindaAtkinson,EconomicResearchService,USDAABSTRACTTheworkshopbeginswithatourthroughEnterpriseGuide(EG)asamenu-basedinterfacetoSAS®procedures.EmphasisinthisworkshopwillbeonthestatisticalcapabilitiesofEG.Asetofdata,puttogetherusingfeaturesofthequerybuildertask,servesasacasestudyforastatisticalanalysis.Theworkshopwillshowhowcodethat’sgeneratedbySASEnterpriseGuidecanbecustomized,stored,andre-run,andcustomreportssavedwithReportControlsIntegration.INTRODUCTIONTheSASSystemprovidesapowerfulframeworkforstatisticalanalysis.Ithasextensivedatamanipulationcapabilitiestoprepareforanalyticandmodelingwork.Ithasreportingtoolsforpresentingresults.However,foranewuser,learninghowtowritecodeandruntheappropriateprocedurescanbedaunting.EnterpriseGuideenablesyoutogetanswerswithouthavingtowriteprograms,throughapoint-and-clickinterfacemakingselectionsfromaseriesofmenus.AsabenefitevenforexperiencedSASprogrammers,EGprovidesaframeworkwithinwhichtoorganizethedata,tasks,andresultsinvolvedinperformingastatisticalanalysis,throughthecreationandmaintenanceof“projects”.Inthisworkshop,asetofdatawillserveasacasestudyforastatisticsexercise.Alongtheway,wewillreviewthecodegeneratedautomaticallybyEG,anddemonstratehowitcanbecustomized,stored,andrerun.We’llalso“putitalltogether”bycollectingresultsandgeneratingcustomreportsthroughatoolcalledtheDocumentBuilderandalsowithReportControlsIntegration.CREATINGAPROJECTWhenyoufirstbringupEnterpriseGuide,you’llbeaskedwhetheryou’dliketocreateanewprojectoropenanexistingone.ClickonNewProjectunderNew.Alternatively,atanytimewhileinEnterpriseGuide,youcanclickontheFile→Newpulldownmenustoindicateyou’dliketoopenanewproject.There’salsoaNewbuttononthetoolbartoaccomplishthesamefunction.Hands-onWorkshopsSUGI312You’llseeatreeviewoftheProjectintheProjectExplorerattheleftoftheEGworkspace,aProcessFlowviewinthemiddleofthescreen(whereResultswillalsobeviewed),aTaskListwindowthatpullsinfromtherightwhenyoumouseoverit,andaTaskStatuswindowatthebottomoftheworkspace.Anyofthesewindowscanbeclosedtogiveyoumorespace.Let’sgivetheProjectabettername.ClickonFile,SaveProjectAs…,clickonLocalComputerwhenaskedwheretosavetheprojectto,andtype“SUGI31”intheFilename:box.EnterpriseGuidewillappendtheextension.egp.Navigatetothec:\workshop\ws109directoryandclickSave.Besidesorganizingyourworkhandily,EnterpriseGuidealsoprovidesopportunityforcustomizingyourworkenvironment.Let’stakealookatspecifyinghowwewouldlikeourresultspresented.ClickonTools→Optionsfromthepulldownmenu.SelectResultsGeneral.BesurethatbothHTMLandSASReportarechecked,thenclickontheOKbutton(youcanclickintheotherareastoseewhattypesofthingsEGgivesyoucontrolover).ACCESSINGDATAThefirststepinananalysisistogetsomedatatoworkwith.ClickonFile,Open,Data.SelectLocalComputerasthelocationtoopenthedatafrom.Navigatetothec:\workshop\ws109directoryandselectmacro.sas7bdat,whichcontainsmacroeconomicvariablesfortheanalysis.ClickonOpen.Hands-onWorkshopsSUGI313EnterpriseGuidereadsthedataandbringsitupinaDataViewer.Youcanscrolldowntoseemoreobservations,orwithalargerdataset,rightandlefttoviewadditionalvariables.Ifyouneedtomodifyadatavalue,EGwillaskyouifyou’dliketoswitchtoUpdatemode.NotetheentryformacrointheProjectExplorerwindow.Aniconindicatesthatthisobjectisadatatable.WecanclosethedataviewerbyclickingontheXontheright.Atanytimewhenyou’dliketoviewthedataagain,double-clickonthedatatableicon.ThesedatarepresenttimeseriesofmonthlyobservationsbeginninginJanuary1980,butthereisn’tanexplicitdatevariableonthedataset.We’llcreateonethatwecanuselaterinthestatisticalexercise.Usingthepull-downmenus,clickonAnalyze,TimeSeries,PrepareTimeSeriesData.Hands-onWorkshopsSUGI314ClickanddragNewTimeIDtotheTaskroleofTimeIDvariable.We’llusethedefaultintervalofMonthly,andchangethestartingdateto1/1/1980.ThengiveitanamebytypingDateintheName:box.ClickonRun.Thedataviewershowsthemodifieddatatablewiththenewvariablethat’sbeencreated.Closingtheviewsoftheoriginalandnewtables,wecanseeintheProcessFlowwindowthestepsoftheprojectsofar.Someoftheinformationweneedforthisanalysis(specificsalesdata)isstoredinaspreadsheetfile.ClickonFile,Open,Dataagain,selectLocalComputer,clickonsales.xlsandOpen.SelecttheSales$spreadsheetfromwithintheworkbook(whichrepresentstheentiresheet,whereasthefilewithoutthe$attheendrepresentsarangeofcellswithinthesheet).ClickonOpen.Youarepromptedtochoosehowyouwouldliketoaddthefiletoyourproject.Forthisexample,choosethesecondoptiontocreateaSASdataset,whichwillgiveusmorecontrolovermakingmodificationsoradditionstoit.Bydefault,SASconvertsthedateintheExcelspreadsheettoadatetimevariable;we’regoingtocontrolthissothatitistreatedasadatevariable.ClickonColumnoptionsontheleft.SelecttheMonthvariableandclickinthefieldfortheRead-informattogetfurtheroptions(clickontheboxwith…).IntheDatecategory,selecttheInformatANYDTDTEw.andclickonOK.ChangethedisplayformattoDDMMYYw.d(again,intheDatecategory).ClickOKandthenRun.Thespreadsheetisaddedtotheproject(withadi
本文标题:Introduction to SAS EG4.1 for Statistical Analysis
链接地址:https://www.777doc.com/doc-6131193 .html