SAS프로그램짜기 2
본 자료는 9페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
해당 자료는 9페이지 까지만 미리보기를 제공합니다.
9페이지 이후부터 다운로드 후 확인할 수 있습니다.

목차

1. INPUT - advanced (list, column, formatted, named)
1.1 Named input
1.2 Pointer control

2. 자료입출력형식
2.1 INFORMAT/FORMAT
2.2 표준 data 값/비표준 data 값
2.3 많이 쓰이는 SAS Informat
2.4 Informat name 사용법
2.5 많이 쓰이는 SAS format
2.6 Format name 사용법
2.7 일시적/영구적으로 format을 바꾸는 방법

3. SAS DATE/TIME
3.1 Date 와 Time을 표현하는 방법
3.2 SAS DATE value
3.3 SAS TIME/DATE value
3.4. SAS DATE/TIME value 생성방법
3.5 Y2K problem
3.6 DATE/TIME 사용형식
3.7 DATE/TIME format, Informat name 종류
3.8 DATE/TIME 함수

4. Report Writing PUT, FILE

5. ARRAY
1차원
다차원

본문내용

text p82 예 4.1.1
data score;
input name $ math stat eng kor art;
array tscore[5] math stat eng kor art; { } ( )
do i=1 to 5;
if tscore(i)=9 then tscore(i)=.;
end;
datalines;
김철수 5 5 1 2 1
최민지 9 3 1 4 5
이영희 1 5 3 2 9
오인수 4 1 2 4 9
proc print; run;
- without array statement
예) text p88 연습문제 #7
1) array x[10] x1-x10; array x(10);
2) array grade[*] x1-x20;
3) array y{*} _numeric_;
4) data all;
array all[20] x1-x10 y1-y10;
array new[10] z1-z10;
input id x1-x10 y1-y10;
do i=1 to 10;
new(i)=all(i) + all(i+1);
end;
datalines;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
proc print; run;
Q) 변수 T1, T2, T3, T4의 1차원 배열의 ARRAY 문은?
__________________________
실습) 다음 SAS 문장을 array를 사용하여 다시 작성하시오.
data oldmiss;
input a b c x1-x3 y1-y3;
if a=999 then a=.;
if b=999 then b=.;
if c=999 then c=.;
if x1=999 then x1=.;
if x2=999 then x2=.;
if x3=999 then x3=.;
if y1=777 then y1=.;
if y2=777 then y2=.;
if y3=777 then y3=.;
datalines;
1 777 3 4 5 6 7 8 999
999 4 999 999 5 999 777 7 7
;
실습) 아래 SAS program을 돌리면 SAS data set SPEED가 만들어진다. SPEED 로부터 새로운 SAS data set SPEED2를 아래 방법으로 변수 변환하여 생성하라. (array 문 사용)
LX1-LX5 는 X1-X5의 자연 로그(natural log)로, SY1-SY3는 Y1-Y3의 제곱근(square root)로 바꿀 것. (SQRT(arg))
data speed;
input x1-x5 y1-y3;
datalines;
1 2 3 4 5 4 16 25
10 22 33 44 55 121 225 10000
;
run;
다차원 배열(Multidimensional array)
syntax
array new(#r,#c) elements;
예) 다차원 배열
array new(3,4) x1-x12;
new(2,3)=0;
array new(3,4) x1 x2 x3 x4 ... x12;
x1 x2 x3 x4
x5 x6 x7 x8
x9 x10 x11 x12
array m(4,3) month1-month12;
array compare(2,3) high1-high3 low1-low3;
input category high1-high3 / low1-low3;
array qua(4); array qua(4) qua1-qua4;
do i=1 to 4;
do j=1 to 3;
qua(i) + m(i,j);
end;
end;
run;
실습)
1. hrd.survey에 들어있는 item1-item18은 아래 3group으로 나눌 수 있다.
Eating: item1-itme6
Exercise: item7-item12
Stress: item13-item18
각 group의 평균을 구하는 program을 작성하라.
item1-item18을 위해 1차원 table을 group을 위해 2차원 table을 사용하라.
name item1-item18
Alicia 4 3 5 4 3 4 1 2 2 3 1 2 2 3 1 1 2 3
Bernard 2 1 4 3 1 2 5 4 5 2 5 3 4 5 5 3 4 5
Betsy 5 3 4 5 5 4 4 4 3 5 4 3 4 2 3 5 2 3
Carmela 4 5 4 2 3 5 2 1 2 3 2 3 1 2 3 1 4 2
First
Obs Name eating exercise stress
1 Alicia 3.83333 1.83333 2.00000
2 Bernard 2.16667 4.00000 4.33333
3 Betsy 4.33333 3.83333 3.16667
4 Carmela 3.83333 2.16667 2.16667
SAS IML handout
http://www.biostat.harvard.edu/courses/individual/bio271/fall2001/lectures/L12/sasiml.pdf
Thank you for registering for the free online
version of SAS OnlineDoc, Version 8.
Now you can access, browse, and search
SAS OnlineDoc, Version 8, from our Web site.
Please save this e-mail. You will need the following userid
and password to access SAS OnlineDoc each time
you open a new browser session.
Userid onlinedoc
Password sas
http://v8doc.sas.com/sashtml
SAS is providing password-protected access to
SAS OnlineDoc as a result of customer feedback.
We're listening!
Cordially,
SAS Publishing
1-800-727-3228
service@sas.com
http://www.sas.com/pubs
  • 가격1,000
  • 페이지수28페이지
  • 등록일2003.12.17
  • 저작시기2003.12
  • 파일형식한글(hwp)
  • 자료번호#238986
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니