在SAS中格式化MMSS

时间:2015-11-18 23:40:00

标签: sas

DATA USCFootballStatsProject;
INPUT OPPONENT $ 1-12 WINORLOSS 13-14 TIMEOFPOSSESSION 15-19 THIRDDOWNCONVERSIONPERCENTAGE 21-26 RUSHINGYARDS;
FORMAT TIMEOFPOSSESSION MMSS.;
CARDS;
UCF         1 24:30 0.125 32
GEORGIA     0 26:59 0.333 43
ALABAMA     0 22:53 0.333 71
TROY        1 31:47 0.333 116
AUBURN      0 28:51 0.167 70
KENTUCKY    1 29:11 0.636 139
VANDERBILT  1 24:50 0.333 132
TENNESSEE   1 32:08 0.353 65
ARKANSAS    1 27:53 0.429 45
FLORIDA     1 25:50 0.300 120
CLEMSON     0 28:12 0.250 167
MISSOURI    0 31:19 0.316 142
MISSSTATE   1 32:39 0.231 81
GEORGIA     0 29:08 0.364 35
WOFFORD     1 24:21 0.417 165
FLOATLANTIC 1 32:39 0.429 200
AUBURN      0 30:20 0.462 109
KENTUCKY    1 31:07 0.538 190
VANDERBILT  1 30:54 0.727 194
TENNESSEE   0 31:33 0.417 165
ARKANSAS    0 23:06 0.333 51
FLORIDA     0 30:31 0.500 135
MTENNESSEE  1 28:17 0.778 154
CLEMSON     1 32:57 0.600 208
HOUSTON     1 33:19 0.500 189
LOUISLFY    1 31:38 0.538 195
GEORGIA     1 30:34 0.091 140
SCSTATE     1 26:53 0.364 223
LSU         0 27:09 0.500 17
MISSSTATE   1 29:39 0.500 123
KENTUCKY    1 29:57 0.462 86
NCAROLINA   1 25:56 0.083 110
VANDERBILT  0 26:36 0.083 26
TENNESSEE   0 36:25 0.438 39
ARKANSAS    0 30:55 0.400 125
FLORIDA     0 25:39 0.167 68
CLEMSON     0 21:23 0.375 80
NCSTATE     1 34:15 0.357 171
VANDERBILT  0 29:58 0.400 92
GEORGIA     0 24:47 0.417 18 
WOFFORD     1 31:07 0.636 172
UAB         1 34:59 0.500 158
OLEMISS     1 31:21 0.538 78
KENTUCKY    1 30:43 0.471 74
LSU         0 25:28 0.111 39
TENNESSEE   1 32:30 0.500 101
ARKANSAS    1 29:06 0.417 132
FLORIDA     0 29:50 0.067 53
CLEMSON     0 27:13 0.471 92
IOWA        0 24:06 0.455 43
NCSTATE     1 32:25 0.333 108
GEORGIA     0 34:21 0.353 114
FLOATLANTIC 1 27:50 0.300 287
OLEMISS     1 33:35 0.375 65
SCSTATE     1 27:13 0.538 213
KENTUCKY    1 29:17 0.500 128
ALABAMA     0 31:43 0.474 64
VANDERBILT  1 32:22 0.375 119
TENNESSEE   0 26:35 0.267 65
ARKANSAS    0 27:37 0.500 53
FLORIDA     0 31:21 0.250 61
CLEMSON     1 36:31 0.375 223
CONN        0 24:32 0.200 76
SOUTHERMISS 1 28:52 0.400 224
GEORGIA     1 35:15 0.643 189
FURMAN      1 33:30 0.600 182
AUBURN      0 28:52 0.500 79
ALABAMA     1 27:33 0.545 110
KENTUCKY    0 25:13 0.500 90
VANDERBILT  1 37:21 0.529 129
TENNESSEE   1 28:28 0.538 212
ARKANSAS    0 25:40 0.417 105
FLORIDA     1 40:46 0.500 239
TROY        1 30:49 0.455 212
CLEMSON     1 34:43 0.333 95
AUBURN      0 28:59 0.417 156
FLORIDAST   0 26:32 0.500 139
ECU         1 30:02 0.500 220
GEORGIA     1 29:02 0.286 253
NAVY        1 31:15 0.556 254
VANDERBILT  1 34:08 0.526 131
AUBURN      0 24:13 0.200 129
KENTUCKY    1 38:37 0.500 288
MISSSTATE   1 32:34 0.200 110
TENNESSEE   1 36:18 0.556 231
ARKANSAS    0 29:05 0.667 79
FLORIDA     1 32:04 0.214 215
CITADEL     1 26:44 0.667 256
CLEMSON     1 37:17 0.444 210
NEBRASKA    1 29:11 0.308 121
VANDERBILT  1 31:36 0.250 205
ECU         1 28:42 0.533 131
UAB         1 23:47 0.500 179
MISSOURI    1 32:33 0.500 144
KENTUCKY    1 31:17 0.500 200
GEORGIA     1 33:13 0.417 230
LSU         0 23:03 0.231 34
FLORIDA     0 24:32 0.214 36
TENNESSEE   1 35:22 0.400 147
ARKANSAS    1 31:45 0.538 104
WOFFORD     1 29:11 0.538 171
CLEMSON     1 39:58 0.524 134
MICHIGAN    1 22:01 0.300 85
NCAROLINA   1 29:33 0.357 228
GEORGIA     0 24:58 0.455 226
VANDERBILT  1 37:10 0.647 220
UCF         1 30:49 0.556 225
KENTUCKY    1 29:45 0.556 178
ARKANSAS    1 43:25 0.563 277
TENNESSEE   0 27:38 0.286 218
MISSOURI    1 34:27 0.294 75
MISSSTATE   1 26:14 0.091 160
FLORIDA     1 28:59 0.313 164
CCAROLINA   1 34:31 0.556 352
CLEMSON     1 38:09 0.526 140
WISCONSIN   1 30:34 0.444 117
TAMU        0 22:22 0.222 67
ECU         1 36:19 0.538 175
GEORGIA     1 31:27 0.222 176
VANDERBILT  1 31:02 0.583 212
MISSOURI    0 35:55 0.381 119
KENTUCKY    0 34:20 0.600 282
FURMAN      1 29:37 0.333 267
AUBURN      0 33:31 0.429 119
TENNESSEE   0 30:13 0.462 248
FLORIDA     1 31:30 0.471 95
SALABAMA    1 24:12 0.400 210
CLEMSON     0 31:20 0.400 63
MIAMI       1 28:50 0.467 60
;
PROC PRINT DATA = USCFootballStatsProject;
RUN;

目前的情况是,它不会在TIMEOFPOSSESSION列中打印任何时间,但它正在打印其他所有内容。有关为什么不打印该列的任何想法?我正在使用FORMAT TIMEOFPOSSESSION MMSS .;

我计划使用WINORLOSS作为响应变量进行逻辑回归,但我想确保正确读取数据。

感谢。

1 个答案:

答案 0 :(得分:2)

因为您告诉它将第15至19列作为数字读取,但该值中包含冒号。您需要使用格式化输入。

input ... @15 TIMEOFPOSSESSION STIMER5. ... ;

或使用带有附加INFORMAT的列表模式输入。

informat TIMEOFPOSSESSION stimer5.;
input ... @15 TIMEOFPOSSESSION ... ;