作者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/cn.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