Introduction to SAS EG4.1 for Statistical Analysis

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

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

1 / 22
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功