作者AmigoSafin ()
看板Statistics
标题[程式] SAS读入资料的format问题,无法正常读入
时间Sat Apr 28 23:22:46 2018
[软体程式类别]:
SAS
[程式问题]:
资料处理、回归、叙述统计、logistic、probit...等
资料处理
[软体熟悉度]:
请把以下不需要的部份删除
新手
[问题叙述]:
大家好
我现在有 ID group baseline month12 这四组资料
在group 那一组中有1和0
0代表控制组 是没有施加treatment
我想要制作diff(month12-baseline)代表contrast
然後比较group为1的contrast与group为0的contrast之间的关联度
请问我用Proc Freq是否有办法做到?
另外的问题则是
我用以下的code要读入我的资料
花了一天还是没办法顺利读入
想请教大家我是否可以如何修改?
谢谢大家了~~
[程式范例]:
%let dirdata=/folders/myfolders;
libname sasuser "&dirdata";
data sasuser.model;
input ID $ 1-3 group $ 5-6 time 7-8 baseline COMMA7.4 month12 COMMA7.4;
array change _numeric_;
do over change;
if change=. then change=0;
end;
cards;
1 1 * 10.7500 *
2 0 0 9.5000 *
3 0 0 16.0000 15.3333
4 0 0 32.5000 *
5 0 0 16.5000 23.2500
6 1 16 9.2500 6.2500
7 1 0 42.5000 51.2500
8 1 0 24.2500 25.2500
9 0 0 21.0000 15.2500
10 1 8 21.7500 1.0000
11 1 11 14.5000 2.5000
12 0 0 40.5000 28.7500
13 1 1 11.7500 13.5000
14 1 4 56.5000 *
15 0 * 11.7500 *
16 1 9 15.5000 2.7500
17 0 0 33.2500 26.7500
18 0 0 39.5000 40.0000
19 0 0 20.5000 32.7500
20 1 2 49.2500 19.5000
21 1 0 9.7500 21.5000
22 0 0 25.0000 *
23 0 * 26.2500 *
24 1 * 35.7500 *
25 1 0 59.7500 38.0000
26 0 0 14.5000 12.5000
27 1 * 48.7500 *
28 0 0 51.2500 *
29 1 0 19.7500 18.7500
30 1 * 74.2500 *
31 0 0 43.7500 *
32 0 0 12.2500 8.5000
33 0 0 19.2500 *
34 0 0 55.7500 62.2500
35 1 8 23.5000 9.7500
36 1 0 21.0000 15.5000
37 1 0 19.0000 9.2500
38 0 0 14.7500 9.2500
39 0 0 10.0000 6.0000
40 1 12 64.7500 60.0000
41 0 0 13.5000 *
42 1 0 38.5000 28.7500
43 1 0 17.5000 23.0000
44 0 0 19.5000 3.5000
45 0 * 31.0000 *
46 1 0 48.0000 3.2500
47 1 2 45.0000 73.7333
48 0 0 32.2500 16.7500
49 1 9 26.2500 6.2500
50 0 0 30.0000 29.5000
51 0 0 21.2500 13.7500
52 1 17 35.0000 0.5000
53 0 0 24.7500 *
54 0 0 27.2500 17.0000
55 0 0 8.7500 12.7500
56 0 0 28.2500 *
57 1 * 31.2500 *
58 1 2 22.5000 7.7500
59 1 0 8.7500 1.2500
60 1 * 35.2500 *
61 0 0 13.7500 5.5000
62 0 0 44.2500 8.2500
63 1 0 33.0000 5.5000
64 1 5 19.0000 3.0000
65 0 0 19.0000 8.2500
66 0 * 29.0000 *
67 1 0 9.7500 4.7500
68 0 0 59.2500 28.2500
69 1 0 19.5000 11.7500
70 1 0 12.0000 17.0000
71 0 * 65.2500 *
72 0 0 36.2500 30.7500
73 0 0 22.2500 16.0000
74 1 0 16.2500 6.2500
75 1 * 29.7500 *
76 1 0 9.2500 8.0000
77 0 0 19.5000 8.2500
78 1 0 13.7500 13.7500
79 0 0 67.5000 79.7500
80 0 * 29.5000 *
81 1 0 21.2500 *
82 1 0 27.0000 22.5000
83 0 0 42.5000 44.7500
84 0 0 18.2500 0.2500
85 1 10 13.0000 7.0000
86 0 * 38.2500 *
87 1 13 32.0000 15.2500
88 1 * 33.2500 *
89 1 13 10.2500 16.7500
90 0 0 66.5000 29.7500
91 0 0 15.7500 17.5000
92 0 0 17.2500 13.7500
93 0 0 16.2500 7.5000
94 0 0 21.5000 15.7500
95 1 0 37.0000 25.2500
96 0 0 21.0000 26.0000
97 0 0 23.0000 7.7500
98 1 0 19.7500 9.5000
99 1 0 12.2500 2.5000
100 0 0 24.0000 11.7500
101 1 1 32.2500 14.2500
102 1 0 19.2500 *
103 1 6 9.7500 11.5000
104 1 6 17.0000 9.0000
105 1 0 37.2500 14.5000
106 0 0 19.7500 27.2500
107 1 0 10.7500 *
108 1 11 13.7500 7.2500
109 0 * 35.0000 *
110 0 0 25.7500 15.7500
111 0 0 29.0000 19.5000
112 0 0 76.2500 64.5000
113 1 0 39.2500 28.2500
114 1 * 47.0000 *
115 1 9 43.2500 31.0000
116 0 0 24.0000 20.0000
117 0 0 9.0000 12.2500
118 1 0 19.2500 27.5000
119 1 0 50.7500 47.7500
120 1 0 21.5000 24.2500
121 1 0 36.5000 *
122 0 0 6.7500 12.0000
123 1 0 18.2500 6.5000
124 0 1 20.2500 25.2500
125 0 0 32.2500 42.7500
126 0 0 15.0000 18.7500
127 1 9 74.0000 61.5000
128 0 0 70.7500 75.2500
129 1 0 23.7500 13.5000
130 1 0 20.2500 15.5000
131 1 0 35.7500 10.7500
132 1 12 38.2500 20.7500
133 0 0 19.0000 31.7500
134 1 * 14.5000 *
135 1 12 58.5000 57.7500
136 0 0 59.0000 43.7500
137 1 0 30.0000 *
138 1 0 22.2500 6.2500
139 1 0 21.2500 12.5000
140 1 0 9.5000 9.5000
141 1 0 48.5000 16.5000
142 1 0 17.0000 17.7500
143 0 * 13.7500 *
144 0 0 17.5000 19.0000
145 0 0 10.7500 *
146 0 0 10.2500 7.2500
147 1 0 41.2500 15.0000
148 1 8 9.5000 2.2500
149 0 0 16.2500 11.5000
150 1 0 22.0000 14.7500
151 0 * 24.7500 *
152 0 * 16.5000 14.0000
153 0 * 42.0000 *
154 1 * 12.2500 *
155 0 0 37.7500 28.7500
156 0 0 16.2500 28.7500
157 0 0 12.5000 25.7500
158 0 0 18.2500 14.2500
159 1 0 19.7500 12.0000
160 0 0 26.7500 13.0000
161 1 0 76.5000 *
162 1 0 17.7500 14.2500
163 0 0 13.5000 13.5000
164 0 0 57.2500 36.5000
165 1 8 11.0000 3.0000
166 1 8 27.2500 25.0000
167 0 0 28.0000 14.7500
168 0 0 13.7500 13.7500
169 0 0 19.5000 17.0000
170 1 0 12.7500 4.0000
171 0 * 40.5000 *
172 0 0 27.0000 15.7500
173 1 0 15.7500 21.5000
174 1 14 34.5000 12.0000
175 1 * 20.7500 *
176 0 * 16.2500 *
177 1 0 15.2500 3.0000
178 1 0 9.2500 23.0000
179 0 0 11.7500 15.0000
180 0 0 18.5000 9.7500
181 0 0 18.5000 25.0000
182 1 0 41.5000 41.2500
183 1 0 19.0000 24.2500
184 1 0 12.7500 9.2500
185 1 * 22.5000 *
186 1 9 12.5000 10.5000
187 0 * 13.0000 *
188 0 * 9.2500 *
189 1 0 13.2500 10.2500
190 0 * 13.0000 *
191 1 0 14.0000 16.0000
192 0 0 20.0000 19.7500
193 1 0 17.0000 7.5000
194 0 0 14.2500 10.5000
195 1 0 17.7500 16.7500
196 0 0 16.2500 18.2500
197 1 8 12.0000 7.2500
198 0 0 42.2500 9.0000
199 0 0 19.2500 11.7500
200 0 0 63.7500 71.5000
201 0 0 9.2500 5.2500
202 1 7 32.5000 9.5000
203 0 0 36.2500 46.7500
204 0 0 17.7500 7.2500
205 1 * 77.0000 *
206 1 0 13.2500 2.7500
207 1 0 11.0000 9.5000
208 1 0 39.0000 5.2500
209 0 0 38.5000 33.0000
210 1 0 9.5000 11.7500
211 0 0 12.0000 8.0000
212 1 0 16.7500 12.7500
213 0 * 9.7500 *
214 1 12 28.5000 17.2500
215 0 * 10.2500 *
216 0 0 14.5000 16.7500
217 0 0 31.7500 6.5000
218 1 0 20.7500 12.5000
219 1 5 45.5000 67.0000
220 0 2 47.5000 33.0000
221 1 0 8.7500 8.0000
222 1 8 20.0000 25.0000
223 1 9 15.0000 2.0000
224 0 * 18.7500 *
225 1 * 11.5000 *
226 1 0 11.5000 4.5000
227 1 0 24.7500 0.0000
228 0 * 29.0000 *
229 1 4 11.2500 10.0000
230 0 0 41.2500 29.0000
231 1 0 18.7500 11.0000
232 0 0 22.2500 19.7500
233 0 0 11.5000 7.5000
234 0 8 25.2500 22.7500
235 1 10 14.0000 *
236 1 0 14.2500 12.5000
237 1 0 14.0000 *
238 0 0 13.7500 16.2500
239 1 2 21.0000 11.0000
240 0 * 32.5000 *
241 0 0 11.2500 *
242 1 10 28.2500 10.0000
243 1 0 16.5000 *
244 1 * 18.5000 *
245 1 * 17.0000 *
246 0 * 17.0000 *
247 0 0 35.5000 16.5000
248 0 0 23.5000 17.0000
249 1 * 34.0000 *
250 0 0 68.5000 73.7500
251 1 12 15.2500 8.2500
252 0 0 40.5000 26.0000
253 0 0 16.2500 12.7500
254 1 14 52.7500 17.5000
255 1 16 21.7500 6.0000
256 1 12 26.2500 16.7500
257 0 0 18.0000 15.5000
258 0 0 29.5000 28.2500
259 1 11 47.7500 47.2500
260 1 0 22.5000 11.7500
261 1 10 16.2500 19.7500
262 0 0 13.0000 2.7500
263 1 0 9.7500 11.7500
264 0 * 9.2500 *
265 0 * 21.2500 *
266 0 0 9.2500 2.0000
267 1 0 18.0000 *
268 1 14 24.5000 *
269 0 0 25.7500 40.0000
270 0 0 9.2500 17.5000
271 1 0 20.5000 12.7500
272 0 0 39.2500 32.0000
273 1 0 24.7500 27.0000
274 1 0 11.0000 18.7500
275 1 0 31.5000 22.7500
276 0 * 64.5000 *
277 1 0 44.5000 34.7500
278 0 0 16.0000 8.2500
279 1 0 61.7500 27.2500
280 1 0 30.0000 4.5000
281 0 0 31.0000 *
282 1 * 17.6667 *
283 1 0 9.5000 14.2500
284 0 0 18.2500 9.5000
285 1 2 26.2500 9.0000
286 0 0 17.0000 4.5000
287 0 0 22.2500 15.7500
288 0 0 9.2500 7.2500
289 0 0 23.2500 16.0000
290 1 0 11.7500 3.7500
291 0 * 22.5000 *
292 0 0 57.7500 52.0000
293 1 0 15.0000 29.2500
294 1 0 9.5000 10.2500
295 0 0 37.0000 7.2500
296 0 * 58.2500 *
297 1 * 13.7500 *
298 0 * 70.0000 *
299 0 0 39.5000 38.7500
300 0 0 16.5000 13.5000
301 1 12 12.2500 7.5000
302 0 0 24.7500 *
303 1 * 26.2500 *
304 0 0 8.7500 7.7500
305 0 * 27.6667 *
306 0 0 22.2500 21.2500
307 0 0 40.2500 22.7500
308 1 0 15.2500 3.0000
309 1 8 9.5000 14.0000
310 1 3 23.0000 9.5000
311 1 0 31.0000 19.5000
312 0 * 31.7500 *
313 1 10 64.0000 8.2500
314 1 8 17.5000 22.0000
315 1 0 20.2500 7.0000
316 1 0 16.7500 8.7500
317 1 8 9.2500 19.2500
318 1 0 12.7500 41.2500
319 0 0 16.5000 3.5000
320 0 0 10.0000 10.2500
321 0 0 27.5000 *
322 0 * 50.2500 *
323 0 0 53.7500 42.2500
324 1 0 37.5000 37.5000
325 0 0 9.0000 31.7500
326 0 0 51.0000 51.7500
327 0 * 36.7500 *
328 0 0 35.0000 17.0000
329 0 * 16.7500 *
330 1 4 56.0000 11.7500
331 1 7 37.2500 23.2500
332 1 3 15.0000 5.2500
333 0 0 16.2500 *
334 1 * 22.2500 *
335 0 * 75.0000 *
336 1 0 42.0000 31.7500
337 1 * 20.7500 *
338 1 12 25.7500 9.5000
339 0 * 15.0000 *
340 1 0 26.7500 30.5000
341 1 9 12.0000 7.0000
342 0 0 10.0000 3.5000
343 1 0 16.2500 17.7500
344 0 0 16.0000 8.7500
345 0 0 38.0000 27.2500
346 1 * 13.5000 *
347 1 1 19.0000 2.0000
348 0 0 33.2500 27.5000
349 1 0 87.5000 *
350 1 6 29.0000 4.5000
351 0 0 18.0000 14.0000
352 1 0 18.5000 *
353 1 9 32.2500 24.7500
354 0 0 12.2500 6.0000
355 0 0 23.2500 31.0000
356 0 0 12.2500 17.2500
357 1 6 22.0000 10.0000
358 1 16 28.5000 22.0000
359 1 * 26.7500 *
360 1 0 10.0000 9.5000
361 0 0 53.0000 53.5000
362 1 1 27.0000 8.7500
363 1 2 26.5000 25.5000
364 1 * 17.7500 *
365 0 0 28.0000 26.0000
366 0 0 25.7500 23.0000
367 0 0 94.7500 87.2500
368 0 * 19.0000 *
369 0 0 18.7500 27.5000
370 1 5 54.7500 17.0000
371 1 * 14.5000 *
372 0 0 15.5000 22.5000
373 0 0 31.0000 40.2500
资料有点多 以下恕删
ID最多到3个字元 group就是1,0
time最多两个字元 其後两笔都是7个字元小数点後4个字元
format的部分我实在不知道如何下手修改 谢谢大家~~
--
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 66.66.198.92
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Statistics/M.1524928969.A.A3D.html