{"title":"A remark on efficient simulations in SAS","authors":"I. Novikov","doi":"10.1111/1467-9884.00343","DOIUrl":null,"url":null,"abstract":"Summary. SAS software is often used for statistical simulations. The paper demonstrates a simple and effective approach for performing simulations in SAS. The method that is usually used generates data sets and performs the calculations sequentially in time, using the macro %DO loop to execute each cycle. The more efficient approach is to generate one large data set that includes all the individual data sets from each cycle as subsets and to perform the calculations on each subset in one pass, using the BY command. The paper presents an example of both methods of simulation, with their SAS codes. Both programs give the same numerical results, but the BY approach is 80 times faster than the macro %DO approach.","PeriodicalId":83973,"journal":{"name":"The Statistician : journal of the Institute of Statisticians","volume":"72 1","pages":"83-86"},"PeriodicalIF":0.0000,"publicationDate":"2003-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"The Statistician : journal of the Institute of Statisticians","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1111/1467-9884.00343","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6
Abstract
Summary. SAS software is often used for statistical simulations. The paper demonstrates a simple and effective approach for performing simulations in SAS. The method that is usually used generates data sets and performs the calculations sequentially in time, using the macro %DO loop to execute each cycle. The more efficient approach is to generate one large data set that includes all the individual data sets from each cycle as subsets and to perform the calculations on each subset in one pass, using the BY command. The paper presents an example of both methods of simulation, with their SAS codes. Both programs give the same numerical results, but the BY approach is 80 times faster than the macro %DO approach.