x <- array(list(1
,1
,1
,41
,41
,38
,38
,13
,12
,12
,14
,14
,12
,12
,53
,53
,1
,2
,2
,39
,39
,32
,32
,16
,11
,11
,18
,18
,11
,11
,83
,83
,1
,3
,3
,30
,30
,35
,35
,19
,15
,15
,11
,11
,14
,14
,66
,66
,1
,4
,4
,31
,31
,33
,33
,15
,6
,6
,12
,12
,12
,12
,67
,67
,1
,5
,5
,34
,34
,37
,37
,14
,13
,13
,16
,16
,21
,21
,76
,76
,1
,6
,6
,35
,35
,29
,29
,13
,10
,10
,18
,18
,12
,12
,78
,78
,1
,7
,7
,39
,39
,31
,31
,19
,12
,12
,14
,14
,22
,22
,53
,53
,1
,8
,8
,34
,34
,36
,36
,15
,14
,14
,14
,14
,11
,11
,80
,80
,1
,9
,9
,36
,36
,35
,35
,14
,12
,12
,15
,15
,10
,10
,74
,74
,1
,10
,10
,37
,37
,38
,38
,15
,9
,9
,15
,15
,13
,13
,76
,76
,1
,11
,11
,38
,38
,31
,31
,16
,10
,10
,17
,17
,10
,10
,79
,79
,1
,12
,12
,36
,36
,34
,34
,16
,12
,12
,19
,19
,8
,8
,54
,54
,1
,13
,13
,38
,38
,35
,35
,16
,12
,12
,10
,10
,15
,15
,67
,67
,1
,14
,14
,39
,39
,38
,38
,16
,11
,11
,16
,16
,14
,14
,54
,54
,1
,15
,15
,33
,33
,37
,37
,17
,15
,15
,18
,18
,10
,10
,87
,87
,1
,16
,16
,32
,32
,33
,33
,15
,12
,12
,14
,14
,14
,14
,58
,58
,1
,17
,17
,36
,36
,32
,32
,15
,10
,10
,14
,14
,14
,14
,75
,75
,1
,18
,18
,38
,38
,38
,38
,20
,12
,12
,17
,17
,11
,11
,88
,88
,1
,19
,19
,39
,39
,38
,38
,18
,11
,11
,14
,14
,10
,10
,64
,64
,1
,20
,20
,32
,32
,32
,32
,16
,12
,12
,16
,16
,13
,13
,57
,57
,1
,21
,21
,32
,32
,33
,33
,16
,11
,11
,18
,18
,9.5
,9.5
,66
,66
,1
,22
,22
,31
,31
,31
,31
,16
,12
,12
,11
,11
,14
,14
,68
,68
,1
,23
,23
,39
,39
,38
,38
,19
,13
,13
,14
,14
,12
,12
,54
,54
,1
,24
,24
,37
,37
,39
,39
,16
,11
,11
,12
,12
,14
,14
,56
,56
,1
,25
,25
,39
,39
,32
,32
,17
,12
,12
,17
,17
,11
,11
,86
,86
,1
,26
,26
,41
,41
,32
,32
,17
,13
,13
,9
,9
,9
,9
,80
,80
,1
,27
,27
,36
,36
,35
,35
,16
,10
,10
,16
,16
,11
,11
,76
,76
,1
,28
,28
,33
,33
,37
,37
,15
,14
,14
,14
,14
,15
,15
,69
,69
,1
,29
,29
,33
,33
,33
,33
,16
,12
,12
,15
,15
,14
,14
,78
,78
,1
,30
,30
,34
,34
,33
,33
,14
,10
,10
,11
,11
,13
,13
,67
,67
,1
,31
,31
,31
,31
,31
,31
,15
,12
,12
,16
,16
,9
,9
,80
,80
,1
,32
,32
,27
,27
,32
,32
,12
,8
,8
,13
,13
,15
,15
,54
,54
,1
,33
,33
,37
,37
,31
,31
,14
,10
,10
,17
,17
,10
,10
,71
,71
,1
,34
,34
,34
,34
,37
,37
,16
,12
,12
,15
,15
,11
,11
,84
,84
,1
,35
,35
,34
,34
,30
,30
,14
,12
,12
,14
,14
,13
,13
,74
,74
,1
,36
,36
,32
,32
,33
,33
,10
,7
,7
,16
,16
,8
,8
,71
,71
,1
,37
,37
,29
,29
,31
,31
,10
,9
,9
,9
,9
,20
,20
,63
,63
,1
,38
,38
,36
,36
,33
,33
,14
,12
,12
,15
,15
,12
,12
,71
,71
,1
,39
,39
,29
,29
,31
,31
,16
,10
,10
,17
,17
,10
,10
,76
,76
,1
,40
,40
,35
,35
,33
,33
,16
,10
,10
,13
,13
,10
,10
,69
,69
,1
,41
,41
,37
,37
,32
,32
,16
,10
,10
,15
,15
,9
,9
,74
,74
,1
,42
,42
,34
,34
,33
,33
,14
,12
,12
,16
,16
,14
,14
,75
,75
,1
,43
,43
,38
,38
,32
,32
,20
,15
,15
,16
,16
,8
,8
,54
,54
,1
,44
,44
,35
,35
,33
,33
,14
,10
,10
,12
,12
,14
,14
,52
,52
,1
,45
,45
,38
,38
,28
,28
,14
,10
,10
,15
,15
,11
,11
,69
,69
,1
,46
,46
,37
,37
,35
,35
,11
,12
,12
,11
,11
,13
,13
,68
,68
,1
,47
,47
,38
,38
,39
,39
,14
,13
,13
,15
,15
,9
,9
,65
,65
,1
,48
,48
,33
,33
,34
,34
,15
,11
,11
,15
,15
,11
,11
,75
,75
,1
,49
,49
,36
,36
,38
,38
,16
,11
,11
,17
,17
,15
,15
,74
,74
,1
,50
,50
,38
,38
,32
,32
,14
,12
,12
,13
,13
,11
,11
,75
,75
,1
,51
,51
,32
,32
,38
,38
,16
,14
,14
,16
,16
,10
,10
,72
,72
,1
,52
,52
,32
,32
,30
,30
,14
,10
,10
,14
,14
,14
,14
,67
,67
,1
,53
,53
,32
,32
,33
,33
,12
,12
,12
,11
,11
,18
,18
,63
,63
,1
,54
,54
,34
,34
,38
,38
,16
,13
,13
,12
,12
,14
,14
,62
,62
,1
,55
,55
,32
,32
,32
,32
,9
,5
,5
,12
,12
,11
,11
,63
,63
,1
,56
,56
,37
,37
,35
,35
,14
,6
,6
,15
,15
,14.5
,14.5
,76
,76
,1
,57
,57
,39
,39
,34
,34
,16
,12
,12
,16
,16
,13
,13
,74
,74
,1
,58
,58
,29
,29
,34
,34
,16
,12
,12
,15
,15
,9
,9
,67
,67
,1
,59
,59
,37
,37
,36
,36
,15
,11
,11
,12
,12
,10
,10
,73
,73
,1
,60
,60
,35
,35
,34
,34
,16
,10
,10
,12
,12
,15
,15
,70
,70
,1
,61
,61
,30
,30
,28
,28
,12
,7
,7
,8
,8
,20
,20
,53
,53
,1
,62
,62
,38
,38
,34
,34
,16
,12
,12
,13
,13
,12
,12
,77
,77
,1
,63
,63
,34
,34
,35
,35
,16
,14
,14
,11
,11
,12
,12
,80
,80
,1
,64
,64
,31
,31
,35
,35
,14
,11
,11
,14
,14
,14
,14
,52
,52
,1
,65
,65
,34
,34
,31
,31
,16
,12
,12
,15
,15
,13
,13
,54
,54
,1
,66
,66
,35
,35
,37
,37
,17
,13
,13
,10
,10
,11
,11
,80
,80
,1
,67
,67
,36
,36
,35
,35
,18
,14
,14
,11
,11
,17
,17
,66
,66
,1
,68
,68
,30
,30
,27
,27
,18
,11
,11
,12
,12
,12
,12
,73
,73
,1
,69
,69
,39
,39
,40
,40
,12
,12
,12
,15
,15
,13
,13
,63
,63
,1
,70
,70
,35
,35
,37
,37
,16
,12
,12
,15
,15
,14
,14
,69
,69
,1
,71
,71
,38
,38
,36
,36
,10
,8
,8
,14
,14
,13
,13
,67
,67
,1
,72
,72
,31
,31
,38
,38
,14
,11
,11
,16
,16
,15
,15
,54
,54
,1
,73
,73
,34
,34
,39
,39
,18
,14
,14
,15
,15
,13
,13
,81
,81
,1
,74
,74
,38
,38
,41
,41
,18
,14
,14
,15
,15
,10
,10
,69
,69
,1
,75
,75
,34
,34
,27
,27
,16
,12
,12
,13
,13
,11
,11
,84
,84
,1
,76
,76
,39
,39
,30
,30
,17
,9
,9
,12
,12
,19
,19
,80
,80
,1
,77
,77
,37
,37
,37
,37
,16
,13
,13
,17
,17
,13
,13
,70
,70
,1
,78
,78
,34
,34
,31
,31
,16
,11
,11
,13
,13
,17
,17
,69
,69
,1
,79
,79
,28
,28
,31
,31
,13
,12
,12
,15
,15
,13
,13
,77
,77
,1
,80
,80
,37
,37
,27
,27
,16
,12
,12
,13
,13
,9
,9
,54
,54
,1
,81
,81
,33
,33
,36
,36
,16
,12
,12
,15
,15
,11
,11
,79
,79
,1
,82
,82
,35
,35
,37
,37
,16
,12
,12
,15
,15
,9
,9
,71
,71
,1
,83
,83
,37
,37
,33
,33
,15
,12
,12
,16
,16
,12
,12
,73
,73
,1
,84
,84
,32
,32
,34
,34
,15
,11
,11
,15
,15
,12
,12
,72
,72
,1
,85
,85
,33
,33
,31
,31
,16
,10
,10
,14
,14
,13
,13
,77
,77
,1
,86
,86
,38
,38
,39
,39
,14
,9
,9
,15
,15
,13
,13
,75
,75
,1
,87
,87
,33
,33
,34
,34
,16
,12
,12
,14
,14
,12
,12
,69
,69
,1
,88
,88
,29
,29
,32
,32
,16
,12
,12
,13
,13
,15
,15
,54
,54
,1
,89
,89
,33
,33
,33
,33
,15
,12
,12
,7
,7
,22
,22
,70
,70
,1
,90
,90
,31
,31
,36
,36
,12
,9
,9
,17
,17
,13
,13
,73
,73
,1
,91
,91
,36
,36
,32
,32
,17
,15
,15
,13
,13
,15
,15
,54
,54
,1
,92
,92
,35
,35
,41
,41
,16
,12
,12
,15
,15
,13
,13
,77
,77
,1
,93
,93
,32
,32
,28
,28
,15
,12
,12
,14
,14
,15
,15
,82
,82
,1
,94
,94
,29
,29
,30
,30
,13
,12
,12
,13
,13
,12.5
,12.5
,80
,80
,1
,95
,95
,39
,39
,36
,36
,16
,10
,10
,16
,16
,11
,11
,80
,80
,1
,96
,96
,37
,37
,35
,35
,16
,13
,13
,12
,12
,16
,16
,69
,69
,1
,97
,97
,35
,35
,31
,31
,16
,9
,9
,14
,14
,11
,11
,78
,78
,1
,98
,98
,37
,37
,34
,34
,16
,12
,12
,17
,17
,11
,11
,81
,81
,1
,99
,99
,32
,32
,36
,36
,14
,10
,10
,15
,15
,10
,10
,76
,76
,1
,100
,100
,38
,38
,36
,36
,16
,14
,14
,17
,17
,10
,10
,76
,76
,1
,101
,101
,37
,37
,35
,35
,16
,11
,11
,12
,12
,16
,16
,73
,73
,1
,102
,102
,36
,36
,37
,37
,20
,15
,15
,16
,16
,12
,12
,85
,85
,1
,103
,103
,32
,32
,28
,28
,15
,11
,11
,11
,11
,11
,11
,66
,66
,1
,104
,104
,33
,33
,39
,39
,16
,11
,11
,15
,15
,16
,16
,79
,79
,1
,105
,105
,40
,40
,32
,32
,13
,12
,12
,9
,9
,19
,19
,68
,68
,1
,106
,106
,38
,38
,35
,35
,17
,12
,12
,16
,16
,11
,11
,76
,76
,1
,107
,107
,41
,41
,39
,39
,16
,12
,12
,15
,15
,16
,16
,71
,71
,1
,108
,108
,36
,36
,35
,35
,16
,11
,11
,10
,10
,15
,15
,54
,54
,1
,109
,109
,43
,43
,42
,42
,12
,7
,7
,10
,10
,24
,24
,46
,46
,1
,110
,110
,30
,30
,34
,34
,16
,12
,12
,15
,15
,14
,14
,85
,85
,1
,111
,111
,31
,31
,33
,33
,16
,14
,14
,11
,11
,15
,15
,74
,74
,1
,112
,112
,32
,32
,41
,41
,17
,11
,11
,13
,13
,11
,11
,88
,88
,1
,113
,113
,32
,32
,33
,33
,13
,11
,11
,14
,14
,15
,15
,38
,38
,1
,114
,114
,37
,37
,34
,34
,12
,10
,10
,18
,18
,12
,12
,76
,76
,1
,115
,115
,37
,37
,32
,32
,18
,13
,13
,16
,16
,10
,10
,86
,86
,1
,116
,116
,33
,33
,40
,40
,14
,13
,13
,14
,14
,14
,14
,54
,54
,1
,117
,117
,34
,34
,40
,40
,14
,8
,8
,14
,14
,13
,13
,67
,67
,1
,118
,118
,33
,33
,35
,35
,13
,11
,11
,14
,14
,9
,9
,69
,69
,1
,119
,119
,38
,38
,36
,36
,16
,12
,12
,14
,14
,15
,15
,90
,90
,1
,120
,120
,33
,33
,37
,37
,13
,11
,11
,12
,12
,15
,15
,54
,54
,1
,121
,121
,31
,31
,27
,27
,16
,13
,13
,14
,14
,14
,14
,76
,76
,1
,122
,122
,38
,38
,39
,39
,13
,12
,12
,15
,15
,11
,11
,89
,89
,1
,123
,123
,37
,37
,38
,38
,16
,14
,14
,15
,15
,8
,8
,76
,76
,1
,124
,124
,36
,36
,31
,31
,15
,13
,13
,15
,15
,11
,11
,73
,73
,1
,125
,125
,31
,31
,33
,33
,16
,15
,15
,13
,13
,11
,11
,79
,79
,1
,126
,126
,39
,39
,32
,32
,15
,10
,10
,17
,17
,8
,8
,90
,90
,1
,127
,127
,44
,44
,39
,39
,17
,11
,11
,17
,17
,10
,10
,74
,74
,1
,128
,128
,33
,33
,36
,36
,15
,9
,9
,19
,19
,11
,11
,81
,81
,1
,129
,129
,35
,35
,33
,33
,12
,11
,11
,15
,15
,13
,13
,72
,72
,1
,130
,130
,32
,32
,33
,33
,16
,10
,10
,13
,13
,11
,11
,71
,71
,1
,131
,131
,28
,28
,32
,32
,10
,11
,11
,9
,9
,20
,20
,66
,66
,1
,132
,132
,40
,40
,37
,37
,16
,8
,8
,15
,15
,10
,10
,77
,77
,1
,133
,133
,27
,27
,30
,30
,12
,11
,11
,15
,15
,15
,15
,65
,65
,1
,134
,134
,37
,37
,38
,38
,14
,12
,12
,15
,15
,12
,12
,74
,74
,1
,135
,135
,32
,32
,29
,29
,15
,12
,12
,16
,16
,14
,14
,85
,85
,1
,136
,136
,28
,28
,22
,22
,13
,9
,9
,11
,11
,23
,23
,54
,54
,1
,137
,137
,34
,34
,35
,35
,15
,11
,11
,14
,14
,14
,14
,63
,63
,1
,138
,138
,30
,30
,35
,35
,11
,10
,10
,11
,11
,16
,16
,54
,54
,1
,139
,139
,35
,35
,34
,34
,12
,8
,8
,15
,15
,11
,11
,64
,64
,1
,140
,140
,31
,31
,35
,35
,11
,9
,9
,13
,13
,12
,12
,69
,69
,1
,141
,141
,32
,32
,34
,34
,16
,8
,8
,15
,15
,10
,10
,54
,54
,1
,142
,142
,30
,30
,37
,37
,15
,9
,9
,16
,16
,14
,14
,84
,84
,1
,143
,143
,30
,30
,35
,35
,17
,15
,15
,14
,14
,12
,12
,86
,86
,1
,144
,144
,31
,31
,23
,23
,16
,11
,11
,15
,15
,12
,12
,77
,77
,1
,145
,145
,40
,40
,31
,31
,10
,8
,8
,16
,16
,11
,11
,89
,89
,1
,146
,146
,32
,32
,27
,27
,18
,13
,13
,16
,16
,12
,12
,76
,76
,1
,147
,147
,36
,36
,36
,36
,13
,12
,12
,11
,11
,13
,13
,60
,60
,1
,148
,148
,32
,32
,31
,31
,16
,12
,12
,12
,12
,11
,11
,75
,75
,1
,149
,149
,35
,35
,32
,32
,13
,9
,9
,9
,9
,19
,19
,73
,73
,1
,150
,150
,38
,38
,39
,39
,10
,7
,7
,16
,16
,12
,12
,85
,85
,1
,151
,151
,42
,42
,37
,37
,15
,13
,13
,13
,13
,17
,17
,79
,79
,1
,152
,152
,34
,34
,38
,38
,16
,9
,9
,16
,16
,9
,9
,71
,71
,1
,153
,153
,35
,35
,39
,39
,16
,6
,6
,12
,12
,12
,12
,72
,72
,1
,154
,154
,38
,38
,34
,34
,14
,8
,8
,9
,9
,19
,19
,69
,69
,1
,155
,155
,33
,33
,31
,31
,10
,8
,8
,13
,13
,18
,18
,78
,78
,1
,156
,156
,36
,36
,32
,32
,17
,15
,15
,13
,13
,15
,15
,54
,54
,1
,157
,157
,32
,32
,37
,37
,13
,6
,6
,14
,14
,14
,14
,69
,69
,1
,158
,158
,33
,33
,36
,36
,15
,9
,9
,19
,19
,11
,11
,81
,81
,1
,159
,159
,34
,34
,32
,32
,16
,11
,11
,13
,13
,9
,9
,84
,84
,1
,160
,160
,32
,32
,38
,38
,12
,8
,8
,12
,12
,18
,18
,84
,84
,1
,161
,161
,34
,34
,36
,36
,13
,8
,8
,13
,13
,16
,16
,69
,69
,0
,162
,0
,27
,0
,26
,0
,13
,10
,0
,10
,0
,24
,0
,66
,0
,0
,163
,0
,31
,0
,26
,0
,12
,8
,0
,14
,0
,14
,0
,81
,0
,0
,164
,0
,38
,0
,33
,0
,17
,14
,0
,16
,0
,20
,0
,82
,0
,0
,165
,0
,34
,0
,39
,0
,15
,10
,0
,10
,0
,18
,0
,72
,0
,0
,166
,0
,24
,0
,30
,0
,10
,8
,0
,11
,0
,23
,0
,54
,0
,0
,167
,0
,30
,0
,33
,0
,14
,11
,0
,14
,0
,12
,0
,78
,0
,0
,168
,0
,26
,0
,25
,0
,11
,12
,0
,12
,0
,14
,0
,74
,0
,0
,169
,0
,34
,0
,38
,0
,13
,12
,0
,9
,0
,16
,0
,82
,0
,0
,170
,0
,27
,0
,37
,0
,16
,12
,0
,9
,0
,18
,0
,73
,0
,0
,171
,0
,37
,0
,31
,0
,12
,5
,0
,11
,0
,20
,0
,55
,0
,0
,172
,0
,36
,0
,37
,0
,16
,12
,0
,16
,0
,12
,0
,72
,0
,0
,173
,0
,41
,0
,35
,0
,12
,10
,0
,9
,0
,12
,0
,78
,0
,0
,174
,0
,29
,0
,25
,0
,9
,7
,0
,13
,0
,17
,0
,59
,0
,0
,175
,0
,36
,0
,28
,0
,12
,12
,0
,16
,0
,13
,0
,72
,0
,0
,176
,0
,32
,0
,35
,0
,15
,11
,0
,13
,0
,9
,0
,78
,0
,0
,177
,0
,37
,0
,33
,0
,12
,8
,0
,9
,0
,16
,0
,68
,0
,0
,178
,0
,30
,0
,30
,0
,12
,9
,0
,12
,0
,18
,0
,69
,0
,0
,179
,0
,31
,0
,31
,0
,14
,10
,0
,16
,0
,10
,0
,67
,0
,0
,180
,0
,38
,0
,37
,0
,12
,9
,0
,11
,0
,14
,0
,74
,0
,0
,181
,0
,36
,0
,36
,0
,16
,12
,0
,14
,0
,11
,0
,54
,0
,0
,182
,0
,35
,0
,30
,0
,11
,6
,0
,13
,0
,9
,0
,67
,0
,0
,183
,0
,31
,0
,36
,0
,19
,15
,0
,15
,0
,11
,0
,70
,0
,0
,184
,0
,38
,0
,32
,0
,15
,12
,0
,14
,0
,10
,0
,80
,0
,0
,185
,0
,22
,0
,28
,0
,8
,12
,0
,16
,0
,11
,0
,89
,0
,0
,186
,0
,32
,0
,36
,0
,16
,12
,0
,13
,0
,19
,0
,76
,0
,0
,187
,0
,36
,0
,34
,0
,17
,11
,0
,14
,0
,14
,0
,74
,0
,0
,188
,0
,39
,0
,31
,0
,12
,7
,0
,15
,0
,12
,0
,87
,0
,0
,189
,0
,28
,0
,28
,0
,11
,7
,0
,13
,0
,14
,0
,54
,0
,0
,190
,0
,32
,0
,36
,0
,11
,5
,0
,11
,0
,21
,0
,61
,0
,0
,191
,0
,32
,0
,36
,0
,14
,12
,0
,11
,0
,13
,0
,38
,0
,0
,192
,0
,38
,0
,40
,0
,16
,12
,0
,14
,0
,10
,0
,75
,0
,0
,193
,0
,32
,0
,33
,0
,12
,3
,0
,15
,0
,15
,0
,69
,0
,0
,194
,0
,35
,0
,37
,0
,16
,11
,0
,11
,0
,16
,0
,62
,0
,0
,195
,0
,32
,0
,32
,0
,13
,10
,0
,15
,0
,14
,0
,72
,0
,0
,196
,0
,37
,0
,38
,0
,15
,12
,0
,12
,0
,12
,0
,70
,0
,0
,197
,0
,34
,0
,31
,0
,16
,9
,0
,14
,0
,19
,0
,79
,0
,0
,198
,0
,33
,0
,37
,0
,16
,12
,0
,14
,0
,15
,0
,87
,0
,0
,199
,0
,33
,0
,33
,0
,14
,9
,0
,8
,0
,19
,0
,62
,0
,0
,200
,0
,26
,0
,32
,0
,16
,12
,0
,13
,0
,13
,0
,77
,0
,0
,201
,0
,30
,0
,30
,0
,16
,12
,0
,9
,0
,17
,0
,69
,0
,0
,202
,0
,24
,0
,30
,0
,14
,10
,0
,15
,0
,12
,0
,69
,0
,0
,203
,0
,34
,0
,31
,0
,11
,9
,0
,17
,0
,11
,0
,75
,0
,0
,204
,0
,34
,0
,32
,0
,12
,12
,0
,13
,0
,14
,0
,54
,0
,0
,205
,0
,33
,0
,34
,0
,15
,8
,0
,15
,0
,11
,0
,72
,0
,0
,206
,0
,34
,0
,36
,0
,15
,11
,0
,15
,0
,13
,0
,74
,0
,0
,207
,0
,35
,0
,37
,0
,16
,11
,0
,14
,0
,12
,0
,85
,0
,0
,208
,0
,35
,0
,36
,0
,16
,12
,0
,16
,0
,15
,0
,52
,0
,0
,209
,0
,36
,0
,33
,0
,11
,10
,0
,13
,0
,14
,0
,70
,0
,0
,210
,0
,34
,0
,33
,0
,15
,10
,0
,16
,0
,12
,0
,84
,0
,0
,211
,0
,34
,0
,33
,0
,12
,12
,0
,9
,0
,17
,0
,64
,0
,0
,212
,0
,41
,0
,44
,0
,12
,12
,0
,16
,0
,11
,0
,84
,0
,0
,213
,0
,32
,0
,39
,0
,15
,11
,0
,11
,0
,18
,0
,87
,0
,0
,214
,0
,30
,0
,32
,0
,15
,8
,0
,10
,0
,13
,0
,79
,0
,0
,215
,0
,35
,0
,35
,0
,16
,12
,0
,11
,0
,17
,0
,67
,0
,0
,216
,0
,28
,0
,25
,0
,14
,10
,0
,15
,0
,13
,0
,65
,0
,0
,217
,0
,33
,0
,35
,0
,17
,11
,0
,17
,0
,11
,0
,85
,0
,0
,218
,0
,39
,0
,34
,0
,14
,10
,0
,14
,0
,12
,0
,83
,0
,0
,219
,0
,36
,0
,35
,0
,13
,8
,0
,8
,0
,22
,0
,61
,0
,0
,220
,0
,36
,0
,39
,0
,15
,12
,0
,15
,0
,14
,0
,82
,0
,0
,221
,0
,35
,0
,33
,0
,13
,12
,0
,11
,0
,12
,0
,76
,0
,0
,222
,0
,38
,0
,36
,0
,14
,10
,0
,16
,0
,12
,0
,58
,0
,0
,223
,0
,33
,0
,32
,0
,15
,12
,0
,10
,0
,17
,0
,72
,0
,0
,224
,0
,31
,0
,32
,0
,12
,9
,0
,15
,0
,9
,0
,72
,0
,0
,225
,0
,34
,0
,36
,0
,13
,9
,0
,9
,0
,21
,0
,38
,0
,0
,226
,0
,32
,0
,36
,0
,8
,6
,0
,16
,0
,10
,0
,78
,0
,0
,227
,0
,31
,0
,32
,0
,14
,10
,0
,19
,0
,11
,0
,54
,0
,0
,228
,0
,33
,0
,34
,0
,14
,9
,0
,12
,0
,12
,0
,63
,0
,0
,229
,0
,34
,0
,33
,0
,11
,9
,0
,8
,0
,23
,0
,66
,0
,0
,230
,0
,34
,0
,35
,0
,12
,9
,0
,11
,0
,13
,0
,70
,0
,0
,231
,0
,34
,0
,30
,0
,13
,6
,0
,14
,0
,12
,0
,71
,0
,0
,232
,0
,33
,0
,38
,0
,10
,10
,0
,9
,0
,16
,0
,67
,0
,0
,233
,0
,32
,0
,34
,0
,16
,6
,0
,15
,0
,9
,0
,58
,0
,0
,234
,0
,41
,0
,33
,0
,18
,14
,0
,13
,0
,17
,0
,72
,0
,0
,235
,0
,34
,0
,32
,0
,13
,10
,0
,16
,0
,9
,0
,72
,0
,0
,236
,0
,36
,0
,31
,0
,11
,10
,0
,11
,0
,14
,0
,70
,0
,0
,237
,0
,37
,0
,30
,0
,4
,6
,0
,12
,0
,17
,0
,76
,0
,0
,238
,0
,36
,0
,27
,0
,13
,12
,0
,13
,0
,13
,0
,50
,0
,0
,239
,0
,29
,0
,31
,0
,16
,12
,0
,10
,0
,11
,0
,72
,0
,0
,240
,0
,37
,0
,30
,0
,10
,7
,0
,11
,0
,12
,0
,72
,0
,0
,241
,0
,27
,0
,32
,0
,12
,8
,0
,12
,0
,10
,0
,88
,0
,0
,242
,0
,35
,0
,35
,0
,12
,11
,0
,8
,0
,19
,0
,53
,0
,0
,243
,0
,28
,0
,28
,0
,10
,3
,0
,12
,0
,16
,0
,58
,0
,0
,244
,0
,35
,0
,33
,0
,13
,6
,0
,12
,0
,16
,0
,66
,0
,0
,245
,0
,37
,0
,31
,0
,15
,10
,0
,15
,0
,14
,0
,82
,0
,0
,246
,0
,29
,0
,35
,0
,12
,8
,0
,11
,0
,20
,0
,69
,0
,0
,247
,0
,32
,0
,35
,0
,14
,9
,0
,13
,0
,15
,0
,68
,0
,0
,248
,0
,36
,0
,32
,0
,10
,9
,0
,14
,0
,23
,0
,44
,0
,0
,249
,0
,19
,0
,21
,0
,12
,8
,0
,10
,0
,20
,0
,56
,0
,0
,250
,0
,21
,0
,20
,0
,12
,9
,0
,12
,0
,16
,0
,53
,0
,0
,251
,0
,31
,0
,34
,0
,11
,7
,0
,15
,0
,14
,0
,70
,0
,0
,252
,0
,33
,0
,32
,0
,10
,7
,0
,13
,0
,17
,0
,78
,0
,0
,253
,0
,36
,0
,34
,0
,12
,6
,0
,13
,0
,11
,0
,71
,0
,0
,254
,0
,33
,0
,32
,0
,16
,9
,0
,13
,0
,13
,0
,72
,0
,0
,255
,0
,37
,0
,33
,0
,12
,10
,0
,12
,0
,17
,0
,68
,0
,0
,256
,0
,34
,0
,33
,0
,14
,11
,0
,12
,0
,15
,0
,67
,0
,0
,257
,0
,35
,0
,37
,0
,16
,12
,0
,9
,0
,21
,0
,75
,0
,0
,258
,0
,31
,0
,32
,0
,14
,8
,0
,9
,0
,18
,0
,62
,0
,0
,259
,0
,37
,0
,34
,0
,13
,11
,0
,15
,0
,15
,0
,67
,0
,0
,260
,0
,35
,0
,30
,0
,4
,3
,0
,10
,0
,8
,0
,83
,0
,0
,261
,0
,27
,0
,30
,0
,15
,11
,0
,14
,0
,12
,0
,64
,0
,0
,262
,0
,34
,0
,38
,0
,11
,12
,0
,15
,0
,12
,0
,68
,0
,0
,263
,0
,40
,0
,36
,0
,11
,7
,0
,7
,0
,22
,0
,62
,0
,0
,264
,0
,29
,0
,32
,0
,14
,9
,0
,14
,0
,12
,0
,72
,0)
,dim=c(16
,264)
,dimnames=list(c('Pop'
,'t'
,'Pop_t'
,'Connected'
,'Connected_p'
,'Separate'
,'Separate_p'
,'Learning'
,'Software'
,'Software_p'
,'Happiness'
,'Happiness_p'
,'Depression'
,'Depression_p'
,'Belonging'
,'Belonging_p')
,1:264))
y <- array(NA,dim=c(16,264),dimnames=list(c('Pop','t','Pop_t','Connected','Connected_p','Separate','Separate_p','Learning','Software','Software_p','Happiness','Happiness_p','Depression','Depression_p','Belonging','Belonging_p'),1:264))
for (i in 1:dim(x)[1])
{
for (j in 1:dim(x)[2])
{
y[i,j] <- as.numeric(x[i,j])
}
}
par3 = 'No Linear Trend'
par2 = 'Do not include Seasonal Dummies'
par1 = '8'
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
postscript(file="/var/wessaorg/rcomp/tmp/1jtww1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/2ipon1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/3wfjj1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/49y2w1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/546w61352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
postscript(file="/var/wessaorg/rcomp/tmp/6tzyi1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/71prw1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/8o5ab1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
postscript(file="/var/wessaorg/rcomp/tmp/9ljtz1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
postscript(file="/var/wessaorg/rcomp/tmp/10m1xc1352148033.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
#Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/wessaorg/rcomp/createtable")
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/111mux1352148033.tab")
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/12xred1352148033.tab")
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/13gk6d1352148033.tab")
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/14ycox1352148033.tab")
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/157lsz1352148033.tab")
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/wessaorg/rcomp/tmp/16bmyo1352148033.tab")
}
try(system("convert tmp/1jtww1352148033.ps tmp/1jtww1352148033.png",intern=TRUE))
try(system("convert tmp/2ipon1352148033.ps tmp/2ipon1352148033.png",intern=TRUE))
try(system("convert tmp/3wfjj1352148033.ps tmp/3wfjj1352148033.png",intern=TRUE))
try(system("convert tmp/49y2w1352148033.ps tmp/49y2w1352148033.png",intern=TRUE))
try(system("convert tmp/546w61352148033.ps tmp/546w61352148033.png",intern=TRUE))
try(system("convert tmp/6tzyi1352148033.ps tmp/6tzyi1352148033.png",intern=TRUE))
try(system("convert tmp/71prw1352148033.ps tmp/71prw1352148033.png",intern=TRUE))
try(system("convert tmp/8o5ab1352148033.ps tmp/8o5ab1352148033.png",intern=TRUE))
try(system("convert tmp/9ljtz1352148033.ps tmp/9ljtz1352148033.png",intern=TRUE))
try(system("convert tmp/10m1xc1352148033.ps tmp/10m1xc1352148033.png",intern=TRUE))