getting your data into sas 2 - kocwcontents.kocw.net/kocw/document/2014/gacheon/kimnamh... · 2016....

Post on 05-Mar-2021

0 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Getting Your Data into SAS_2

Statistical Data Analysis 1

Namhyoung Kim

Dept. of Applied Statistics

Gachon University

nhkim@gachon.ac.kr

1

SAS library and Viewtable

2

Reading a permanent SAS data set

DATA=library.data_set_name; Proc Step

Data Step

3

Reading files with the Import Wizard

4

Reading files with the Import Wizard

5

Reading files with the Import Wizard

6

Reading files with the Import Wizard

7

Reading files with the Import Wizard

8

Using IMPORT procedure

PROC IMPORT DBMS=EXCELDATAFILE="D:\SAS_Programming\Raw_Data\기업이미

지.xls"OUT=mysas.company

REPLACE;

RANGE="Sheet1$";

RUN;

PROC IMPORT DBMS=SPSSDATAFILE="D:\SAS_Programming\Raw_Data\기업이미

지.sav"OUT=mysas.company

REPLACE;

FMTLIB=mysas.company_formats;

RUN;

9

Internal Raw Data

CARDS statements

10

Entering Data with the ViewtableWindow

11

Practice

Drink 데이터셋을 생성하기 위하여 다음을 수행하여 보아라 텍스트파일 ‘음료수.txt’를 이용하여 mysas.drink 데이

터셋을 생성하여라 Excel 파일 ‘음료수.xls’를 이용하여 mysas.drink 데이

터셋을 생성하여라 SPSS 파일 ‘음료수.sav'를 이용하여 mysas.drink 데

이터셋을 생성하여라

12

Practice

아래 자료를 텍스트 파일로 저장하고, 이 텍스트파일을 INFILE 명령문을 이용하여 SAS 데이터셋으로 저장하여라

13

1 Monona Steve 322 Milwaukee Tom 443 Madison Kim 25

변수 내용 열 번호

Obs 고객 번호 1-2

City 도시 3-12

Name 성명 13-18

Age 나이 19-20

<텍스트 자료> <코드북>

SAS library and Viewtable

14

Reading a permanent SAS data set

DATA=library.data_set_name; Proc Step

Data Step

15

Reading files with the Import Wizard

16

Reading files with the Import Wizard

17

Reading files with the Import Wizard

18

Reading files with the Import Wizard

19

Reading files with the Import Wizard

20

Using IMPORT procedure

PROC IMPORT DBMS=EXCELDATAFILE="D:\SAS_Programming\Raw_Data\기업이미

지.xls"OUT=mysas.company

REPLACE;

RANGE="Sheet1$";

RUN;

PROC IMPORT DBMS=SPSSDATAFILE="D:\SAS_Programming\Raw_Data\기업이미

지.sav"OUT=mysas.company

REPLACE;

FMTLIB=mysas.company_formats;

RUN;

21

Internal Raw Data

CARDS statements

22

Entering Data with the ViewtableWindow

23

Practice

Drink 데이터셋을 생성하기 위하여 다음을 수행하여 보아라 텍스트파일 ‘음료수.txt’를 이용하여 mysas.drink 데이

터셋을 생성하여라 Excel 파일 ‘음료수.xls’를 이용하여 mysas.drink 데이

터셋을 생성하여라 SPSS 파일 ‘음료수.sav'를 이용하여 mysas.drink 데

이터셋을 생성하여라

24

Practice

아래 자료를 텍스트 파일로 저장하고, 이 텍스트파일을 INFILE 명령문을 이용하여 SAS 데이터셋으로 저장하여라

25

1 Monona Steve 322 Milwaukee Tom 443 Madison Kim 25

변수 내용 열 번호

Obs 고객 번호 1-2

City 도시 3-12

Name 성명 13-18

Age 나이 19-20

<텍스트 자료> <코드북>

Practice

‘C:\’ 에 example 폴더를 생성하고 이 폴더를 ‘ex’라는 이름의 SAS 라이브러리로 생성하여라. 생성한 ‘ex’ 라이브러리에 문제 2-6번의 데이터를저장하여 보아라.

26

Practice

아래의 데이터셋을 엑셀 파일로 저장하고IMPORT 프로시저와 데이터 가져오기 마법사를각각 이용하여 저장한 엑셀 파일을 SAS 데이터셋으로 변환하여라.

27

Region State Month Expenses Revenue

Southern GA JAN2001 2000 8000

Southern GA FEB2001 1200 6000

Southern FL FEB2001 8500 11000

Northern NY FEB2001 3000 4000

Northern NY MAR2001 6000 5000

Southern FL MAR2001 9800 13500

Northern MA MAR2001 1500 1000

top related