??? ??????? Program Design of Data Step - PowerPoint PPT Presentation

About This Presentation
Title:

??? ??????? Program Design of Data Step

Description:

... Input num x; If x – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 17
Provided by: LQ6
Category:
Tags: data | design | print | proc | program | step

less

Transcript and Presenter's Notes

Title: ??? ??????? Program Design of Data Step


1
??? ??????? Program Design of Data Step
  • ?????

2
????
  • ?????? DO ??
  • ?????? IF ??

3
??????
  • ????????????,?????????????,?????
  • Do End ??
  • ??DO I A to B by C
  • lt Loop Body gt
  • END
  • ??
  • DO?????????,???? I ???? A???? B ??? C
    ????,????? END???, ?????? ????????,???????,??????
    ??????????????DO????????????,??????????

4
  • ?1??10??
  • Data a
  • do i0 to 9
  • put i Put?????????????
  • end
  • run
  • ????????????,????????(DO END ?????)????????,????
    ??? 1?????????????????????

5
  • ????????????
  • ?2???????
  • Data a
  • Do I 1 to 9 ???? 1 ??? 9
  • Do j 1 to I ??? 1 ??????
  • S I j
  • Put I j S _at__at_ _at__at_????????
  • End
  • Put Put ??????????????
  • End
  • Run

6
?? ??? ??? ???
1 5.6 -0.6 12.4
2 9.5 5.7 0.9
3 6.0 12.8 7.0
4 8.7 4.1 3.9
5 9.2 -1.8 1.6
6 5.0 -0.1 6.4
7 3.5 6.3 3.0
8 5.8 12.7 3.9
9 8.0 9.8 2.2
10 15.5 12.6 1.1
11 11.8 2.0 2.7
12 16.3 5.6 7.8
13 11.8 7.0 6.9
14 14.6 7.9 1.5
15 4.9 4.3 9.4
16 8.1 6.4 3.8
  • ????????????
  • ??????????????,??II????????4????2???????(mmol/L),
    ??

7
  • Data a
  • Do i1 to 16
  • Do j1 to 3
  • Input x _at__at_
  • Output Output?????????????
  • End
  • End
  • Cards
  • 5.6 -0.6 12.4 9.5 5.7 0.9 6.0 12.8 7.0
  • 8.7 4.1 3.9 9.2 -1.8 1.6 5.0 -0.1 6.4
  • 3.5 6.3 3.0 5.8 12.7 3.9 8.0 9.8 2.2
  • 15.5 12.6 1.1 11.8 2.0 2.7 16.3 5.6 7.8
  • 11.8 7.0 6.9 14.6 7.9 1.5 4.9 4.3 9.4
  • 8.1 6.4 3.8
  • proc freq
  • tables ij
  • weight x
  • Proc anova

8
??????
  • ?????????????????????,????,?? IF ?????
  • IF Then / Else ??
  • ????
  • IF lt Expression gt Then lt Statement 1 gt
  • Else lt Statement 2 gt
  • ????? IF ??????(Expression)??,????????(? 0),???
    Then ??????(Statement 1),??? Else
    ??????????(0),??? Then ??,????? Else ??,????
    Else ??,???????,???? IF ?????????

9
  • ?1???????????gt280????
  • Data a
  • Input num s1-s3 _at__at_
  • Totalsum( of s1-s3)
  • If Total gt 280 then put num Total
  • Cards
  • 1001 79 96 87 1002 89 96 98 1003 87 69 81
  • Run

10
  • ?2???????????????????
  • ?????,??????0-??,1-??,2-?????,3-?????,4-???????
  • Data a
  • Input x _at__at_
  • If 1ltxlt3 Then hq1 xgt1 xlt3
  • Else hq0
  • If 3ltxlt4 Then sy1 xgt3 xlt4
  • Else sy0
  • Cards
  • 0 1 2 3 4
  • Proc print
  • Run

11
  • ?3?????????????
  • ???????????? Boy ? Girl?
  • Data boy girl
  • Input name sex age h w
  • If sex M then output boy
  • Else output girl
  • Cards
  • Zhang M 10 140 40
  • Wang F 10 142 38
  • Li M 11 150 45
  • Zhao F 11 145 42
  • Run

12
  • ?4?????????????
  • ????????????
  • Data a
  • Input num x
  • If xlt60 then delete Delete????????
  • Cards
  • 101 80
  • 102 90
  • 103 85
  • 104 50
  • 105 100
  • Proc print
  • Run

13
  • ?5Do End ???
  • ????????,????????????,?????????
  • Data a
  • Input num x
  • If xlt60 then do
  • bk1
  • put num x bk
  • End
  • Else bk0
  • Cards
  • 101 80
  • 102 90
  • 103 85
  • 104 50
  • 105 100
  • Proc means
  • Var x
  • Run

14
  • ?? IF ?????????
  • ???SAS????? IF ???????,???????????????,??????????
    ??
  • ????
  • IF lt Expression gt
  • ????????????,????????(?0),SAS????????????(0),SAS
    ???????????,??Data????,??????????????

15
  • ???Children???Baby?Girls?
  • Data Children
  • Input num sex month _at__at_
  • Cards
  • 1001 F 8 1002 M 9 1003 F 17 1004 M 14
  • Data Baby
  • Set Children
  • If monthlt12
  • Data Girls
  • Set Children
  • If sexF
  • Run

16
  • ????? Delete ????
  • Data Children
  • Input num sex month _at__at_
  • Cards
  • 1001 F 8 1002 M 9 1003 F 17 1004 M 14
  • Data Baby
  • Set Children
  • If monthgt12 then delete
  • Data Girls
  • Set Children
  • If sex ltgtF then delete
  • Run
Write a Comment
User Comments (0)
About PowerShow.com