作者AmigoSafin ()
看板Statistics
標題[程式] SAS 輸入的資料有空格
時間Mon May 7 00:06:35 2018
[軟體程式類別]:
SAS
[程式問題]:
資料處理
[軟體熟悉度]:
請把以下不需要的部份刪除
新手
[問題敘述]:
大家好
想請教一下簡單的SAS資料輸入 但因為似乎是空格的問題(某一個變數是male and female
有空格 所以資料產出就跟另一欄位的資料有點mix up
想請大家幫忙 謝謝大家
[程式範例]:
data sasuser.pain;
input center 1-2 status 3-4 count 5-7 gender $ 9-14 treat $ 15-17 ;
/*pain=1*/
datalines;
1 1 1 male P
1 1 2 male A
1 1 0 male B
1 1 0 male AB
1 1 6 female P
1 1 6 female A
1 1 3 female B
1 1 0 female AB
2 1 2 male P
2 1 0 male A
2 1 0 male B
2 1 0 male AB
2 1 7 female P
2 1 3 female A
2 1 0 female B
2 1 0 female AB
3 1 5 male P
3 1 1 male A
3 1 3 male B
3 1 0 male AB
3 1 6 female P
3 1 4 female A
3 1 5 female B
3 1 3 female AB
4 1 1 male P
4 1 0 male A
4 1 0 male B
4 1 1 male AB
4 1 4 female P
4 1 0 female A
4 1 0 female B
4 1 1 female AB
1 0 17 male P
1 0 16 male A
1 0 19 male B
1 0 19 male AB
1 0 20 female P
1 0 22 female A
1 0 25 female B
1 0 26 female AB
2 0 18 male P
2 0 19 male A
2 0 20 male B
2 0 20 male AB
2 0 19 female P
2 0 23 female A
2 0 26 female B
2 0 26 female AB
3 0 18 male P
3 0 21 male A
3 0 23 male B
3 0 25 male AB
3 0 16 female P
3 0 18 female A
3 0 21 female B
3 0 23 female AB
4 0 18 male P
4 0 19 male A
4 0 20 male B
4 0 20 male AB
4 0 12 female P
4 0 22 female A
4 0 22 female B
4 0 21 female AB
;
run;
proc print data=sasuser.pain;
run;
--
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 66.66.198.92
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Statistics/M.1525622800.A.59A.html
1F:推 melodyheyhey: Input gender那邊改成gender $ :6. 看看~ 05/08 23:56
2F:→ AmigoSafin: OK will give a try thanks:) 05/11 08:36