没有合适的资源?快使用搜索试试~ 我知道了~
首页SAS EG 用户手册与说明
资源详情
资源评论
资源推荐
1
Paper 109-31
Introduction to SAS® Enterprise Guide® 4.1 for Statistical Analysis
Charles Hallahan, Economic Research Service, USDA
Linda Atkinson, Economic Research Service, USDA
ABSTRACT
The workshop begins with a tour through Enterprise Guide (EG) as a menu-based interface to SAS
®
procedures. Emphasis in
this workshop will be on the statistical capabilities of EG. A set of data, put together using features of the query builder task,
serves as a case study for a statistical analysis. The workshop will show how code that’s generated by SAS Enterprise Guide
can be customized, stored, and re-run, and custom reports saved with Report Controls Integration.
INTRODUCTION
The SAS System provides a powerful framework for statistical analysis. It has extensive data manipulation capabilities to
prepare for analytic and modeling work. It has reporting tools for presenting results. However, for a new user, learning how to
write code and run the appropriate procedures can be daunting. Enterprise Guide enables you to get answers without having
to write programs, through a point-and-click interface making selections from a series of menus. As a benefit even for
experienced SAS programmers, EG provides a framework within which to organize the data, tasks, and results involved in
performing a statistical analysis, through the creation and maintenance of “projects”. In this workshop, a set of data will serve
as a case study for a statistics exercise. Along the way, we will review the code generated automatically by EG, and
demonstrate how it can be customized, stored, and rerun. We’ll also “put it all together” by collecting results and generating
custom reports through a tool called the Document Builder and also with Report Controls Integration.
CREATING A PROJECT
When you first bring up Enterprise Guide, you’ll be asked whether you’d like to create a new project or open an existing one.
Click on New Project under New.
Alternatively, at any time while in Enterprise Guide, you can click on the File → New pulldown menus to indicate you’d like to
open a new project. There’s also a New button on the toolbar to accomplish the same function.
Hands-on Worksho
p
s
SUGI 31
2
You’ll see a tree view of the Project in the Project Explorer at the left of the EG workspace, a Process Flow view in the middle
of the screen (where Results will also be viewed), a Task List window that pulls in from the right when you mouse over it, and
a Task Status window at the bottom of the workspace. Any of these windows can be closed to give you more space.
Let’s give the Project a better name. Click on File, Save Project As…, click on Local Computer when asked where to save
the project to, and type “SUGI31” in the File name: box. Enterprise Guide will append the extension .egp. Navigate to the
c:\workshop\ws109 directory and click Save.
Besides organizing your work handily, Enterprise Guide also provides opportunity for customizing your work environment.
Let’s take a look at specifying how we would like our results presented. Click on Tools → Options from the pulldown menu.
Select Results General. Be sure that both HTML and SAS Report are checked, then click on the OK button (you can click in
the other areas to see what types of things EG gives you control over).
ACCESSING DATA
The first step in an analysis is to get some data to work with. Click on File, Open, Data. Select Local Computer as the
location to open the data from. Navigate to the c:\workshop\ws109 directory and select macro.sas7bdat, which contains
macroeconomic variables for the analysis. Click on Open.
Hands-on Worksho
p
s
SUGI 31
3
Enterprise Guide reads the data and brings it up in a Data Viewer. You can scroll down to see more observations, or with a
larger data set, right and left to view additional variables. If you need to modify a data value, EG will ask you if you’d like to
switch to Update mode. Note the entry for macro in the Project Explorer window. An icon indicates that this object is a data
table. We can close the data viewer by clicking on the X on the right. At any time when you’d like to view the data again,
double-click on the data table icon.
These data represent time series of monthly observations beginning in January 1980, but there isn’t an explicit date variable
on the data set. We’ll create one that we can use later in the statistical exercise. Using the pull-down menus, click on
Analyze, Time Series, Prepare Time Series Data.
Hands-on Worksho
p
s
SUGI 31
4
Click and drag NewTimeID to the Task role of Time ID variable. We’ll use the default interval of Monthly, and change the
starting date to 1/1/1980. Then give it a name by typing Date in the Name: box. Click on Run.
The data viewer shows the modified data table with the new variable that’s been created. Closing the views of the original and
new tables, we can see in the Process Flow window the steps of the project so far.
Some of the information we need for this analysis (specific sales data) is stored in a spreadsheet file. Click on File, Open,
Data again, select Local Computer, click on sales.xls and Open. Select the Sales$ spreadsheet from within the workbook
(which represents the entire sheet, whereas the file without the $ at the end represents a range of cells within the sheet). Click
on Open. You are prompted to choose how you would like to add the file to your project. For this example, choose the second
option to create a SAS data set, which will give us more control over making modifications or additions to it. By default, SAS
converts the date in the Excel spreadsheet to a datetime variable; we’re going to control this so that it is treated as a date
variable. Click on Column options on the left. Select the Month variable and click in the field for the Read-in format to get
further options (click on the box with …).
In the Date category, select the Informat ANYDTDTEw. and click on OK. Change the
display format to DDMMYYw.d (again, in the Date category). Click OK and then Run.
The spreadsheet is added to the project (with a different icon indicating that it is an Excel file), and the data are brought up in a
viewer again as the SAS data set was.
Hands-on Worksho
p
s
SUGI 31
5
We currently have two sources of data in the project: a SAS data set with general macroeconomic variables, and an Excel
spreadsheet with the sales variables. For subsequent analysis, we’ll want to put them together. Click on the icon for the
Modified Time Series version of the macro data set to make it the active data source. From the pull-down menu, select
Data, Filter and Query. Click on the Add Tables… button. Click on Project in response to the question about where to open
the data from, select the SASUSER.IMPW data created from the sales spreadsheet and click on OK. We get a message that
we’ll need to join the tables manually. This is because we don’t have a variable name in common to the data sources to match
on. We want to join observations by time period, but in the macro data set the identifying variable is called date, whereas in
the sales data it’s called Month. We’ll have to tell Enterprise Guide how we want this done.
Click on OK in the message box. Click on Date in the data source created from the macro data set, hold down the left mouse
button and drag the cursor to point at Month in the IMPW data source created from the sales spreadsheet. Release the
mouse button. A symbol indicates how the two sets of data will be joined. Close this window.
We’re going to use all the columns in the two data sources in our combined table, so click on the icon for the macro data set,
drag it into the Select Data area, and do the same for the sales spreadsheet. In the box for Query name:, type Combine
macro and sales variables. Click on the Change… button to give the resulting data table a better output name. Replace the
default name shown with SalesData. Click on Save, then Run to run the query and generate the combined data table.
Hands-on Worksho
p
s
SUGI 31
剩余21页未读,继续阅读
hyy19830322
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论3