R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(66 + ,4818 + ,4488 + ,5 + ,73 + ,68 + ,0 + ,4964 + ,1 + ,54 + ,3132 + ,2916 + ,12 + ,58 + ,54 + ,1 + ,3132 + ,1 + ,82 + ,5576 + ,3362 + ,11 + ,68 + ,41 + ,1 + ,2788 + ,1 + ,61 + ,3782 + ,2989 + ,6 + ,62 + ,49 + ,1 + ,3038 + ,1 + ,65 + ,4225 + ,3185 + ,12 + ,65 + ,49 + ,1 + ,3185 + ,1 + ,77 + ,6237 + ,5544 + ,11 + ,81 + ,72 + ,1 + ,5832 + ,1 + ,66 + ,4818 + ,5148 + ,12 + ,73 + ,78 + ,1 + ,5694 + ,1 + ,66 + ,4224 + ,3828 + ,7 + ,64 + ,58 + ,0 + ,3712 + ,1 + ,66 + ,4488 + ,3828 + ,8 + ,68 + ,58 + ,1 + ,3944 + ,1 + ,48 + ,2448 + ,1104 + ,13 + ,51 + ,23 + ,1 + ,1173 + ,1 + ,57 + ,3876 + ,2223 + ,12 + ,68 + ,39 + ,1 + ,2652 + ,1 + ,80 + ,4880 + ,5040 + ,13 + ,61 + ,63 + ,1 + ,3843 + ,1 + ,60 + ,4140 + ,2760 + ,12 + ,69 + ,46 + ,1 + ,3174 + ,1 + ,70 + ,5110 + ,4060 + ,12 + ,73 + ,58 + ,1 + ,4234 + ,1 + ,85 + ,5185 + ,3315 + ,11 + ,61 + ,39 + ,0 + ,2379 + ,1 + ,59 + ,3658 + ,2596 + ,12 + ,62 + ,44 + ,0 + ,2728 + ,1 + ,72 + ,4536 + ,3528 + ,12 + ,63 + ,49 + ,1 + ,3087 + ,1 + ,70 + ,4830 + ,3990 + ,12 + ,69 + ,57 + ,1 + ,3933 + ,1 + ,74 + ,3478 + ,5624 + ,11 + ,47 + ,76 + ,0 + ,3572 + ,1 + ,70 + ,4620 + ,4410 + ,13 + ,66 + ,63 + ,0 + ,4158 + ,1 + ,51 + ,2958 + ,918 + ,9 + ,58 + ,18 + ,1 + ,1044 + ,1 + ,70 + ,4410 + ,2800 + ,11 + ,63 + ,40 + ,0 + ,2520 + ,1 + ,71 + ,4899 + ,4189 + ,11 + ,69 + ,59 + ,1 + ,4071 + ,1 + ,72 + ,4248 + ,4464 + ,11 + ,59 + ,62 + ,0 + ,3658 + ,1 + ,50 + ,2950 + ,3500 + ,9 + ,59 + ,70 + ,1 + ,4130 + ,1 + ,69 + ,4347 + ,4485 + ,11 + ,63 + ,65 + ,0 + ,4095 + ,1 + ,73 + ,4745 + ,4088 + ,12 + ,65 + ,56 + ,0 + ,3640 + ,1 + ,66 + ,4290 + ,2970 + ,12 + ,65 + ,45 + ,1 + ,2925 + ,1 + ,73 + ,5183 + ,4161 + ,10 + ,71 + ,57 + ,0 + ,4047 + ,1 + ,58 + ,3480 + ,2900 + ,12 + ,60 + ,50 + ,1 + ,3000 + ,1 + ,78 + ,6318 + ,3120 + ,12 + ,81 + ,40 + ,0 + ,3240 + ,1 + ,83 + ,5561 + ,4814 + ,12 + ,67 + ,58 + ,1 + ,3886 + ,1 + ,76 + ,5016 + ,3724 + ,9 + ,66 + ,49 + ,0 + ,3234 + ,1 + ,77 + ,4774 + ,3773 + ,9 + ,62 + ,49 + ,1 + ,3038 + ,1 + ,79 + ,4977 + ,2133 + ,12 + ,63 + ,27 + ,1 + ,1701 + ,1 + ,71 + ,5183 + ,3621 + ,14 + ,73 + ,51 + ,0 + ,3723 + ,1 + ,79 + ,4345 + ,5925 + ,12 + ,55 + ,75 + ,0 + ,4125 + ,1 + ,60 + ,3540 + ,3900 + ,11 + ,59 + ,65 + ,1 + ,3835 + ,1 + ,73 + ,4672 + ,3431 + ,9 + ,64 + ,47 + ,1 + ,3008 + ,1 + ,70 + ,4410 + ,3430 + ,11 + ,63 + ,49 + ,0 + ,3087 + ,1 + ,42 + ,2688 + ,2730 + ,7 + ,64 + ,65 + ,1 + ,4160 + ,1 + ,74 + ,5402 + ,4514 + ,15 + ,73 + ,61 + ,1 + ,4453 + ,1 + ,68 + ,3672 + ,3128 + ,11 + ,54 + ,46 + ,1 + ,2484 + ,1 + ,83 + ,6308 + ,5727 + ,12 + ,76 + ,69 + ,1 + ,5244 + ,1 + ,62 + ,4588 + ,3410 + ,12 + ,74 + ,55 + ,0 + ,4070 + ,1 + ,79 + ,4977 + ,6162 + ,9 + ,63 + ,78 + ,0 + ,4914 + ,1 + ,61 + ,4453 + ,3538 + ,12 + ,73 + ,58 + ,0 + ,4234 + ,1 + ,86 + ,5762 + ,2924 + ,11 + ,67 + ,34 + ,0 + ,2278 + ,1 + ,64 + ,4352 + ,4288 + ,11 + ,68 + ,67 + ,0 + ,4556 + ,1 + ,75 + ,4950 + ,3375 + ,8 + ,66 + ,45 + ,1 + ,2970 + ,1 + ,59 + ,3658 + ,4012 + ,7 + ,62 + ,68 + ,0 + ,4216 + ,1 + ,82 + ,5822 + ,4018 + ,12 + ,71 + ,49 + ,0 + ,3479 + ,1 + ,61 + ,3843 + ,1159 + ,8 + ,63 + ,19 + ,1 + ,1197 + ,1 + ,69 + ,5175 + ,4968 + ,10 + ,75 + ,72 + ,1 + ,5400 + ,1 + ,60 + ,4620 + ,3540 + ,12 + ,77 + ,59 + ,1 + ,4543 + ,1 + ,59 + ,3658 + ,2714 + ,15 + ,62 + ,46 + ,0 + ,2852 + ,1 + ,81 + ,5994 + ,4536 + ,12 + ,74 + ,56 + ,1 + ,4144 + ,1 + ,65 + ,4355 + ,2925 + ,12 + ,67 + ,45 + ,0 + ,3015 + ,1 + ,60 + ,3360 + ,3180 + ,12 + ,56 + ,53 + ,0 + ,2968 + ,1 + ,60 + ,3600 + ,4020 + ,12 + ,60 + ,67 + ,0 + ,4020 + ,1 + ,45 + ,2610 + ,3285 + ,8 + ,58 + ,73 + ,0 + ,4234 + ,1 + ,75 + ,4875 + ,3450 + ,10 + ,65 + ,46 + ,1 + ,2990 + ,1 + ,84 + ,4116 + ,5880 + ,14 + ,49 + ,70 + ,0 + ,3430 + ,1 + ,77 + ,4697 + ,2926 + ,10 + ,61 + ,38 + ,1 + ,2318 + ,1 + ,64 + ,4224 + ,3456 + ,12 + ,66 + ,54 + ,0 + ,3564 + ,1 + ,54 + ,3456 + ,2484 + ,14 + ,64 + ,46 + ,0 + ,2944 + ,1 + ,72 + ,4680 + ,3312 + ,6 + ,65 + ,46 + ,0 + ,2990 + ,1 + ,56 + ,2576 + ,2520 + ,11 + ,46 + ,45 + ,1 + ,2070 + ,1 + ,67 + ,4355 + ,3149 + ,10 + ,65 + ,47 + ,0 + ,3055 + ,1 + ,81 + ,6561 + ,2025 + ,14 + ,81 + ,25 + ,0 + ,2025 + ,1 + ,73 + ,5256 + ,4599 + ,12 + ,72 + ,63 + ,1 + ,4536 + ,1 + ,67 + ,4355 + ,3082 + ,13 + ,65 + ,46 + ,0 + ,2990 + ,1 + ,72 + ,5328 + ,4968 + ,11 + ,74 + ,69 + ,0 + ,5106 + ,1 + ,69 + ,4071 + ,2967 + ,11 + ,59 + ,43 + ,1 + ,2537 + ,1 + ,71 + ,4899 + ,3479 + ,12 + ,69 + ,49 + ,1 + ,3381 + ,1 + ,77 + ,4466 + ,3003 + ,13 + ,58 + ,39 + ,0 + ,2262 + ,1 + ,63 + ,4473 + ,4095 + ,12 + ,71 + ,65 + ,1 + ,4615 + ,1 + ,49 + ,3871 + ,2646 + ,8 + ,79 + ,54 + ,0 + ,4266 + ,1 + ,74 + ,5032 + ,3700 + ,12 + ,68 + ,50 + ,0 + ,3400 + ,1 + ,76 + ,5016 + ,3192 + ,11 + ,66 + ,42 + ,1 + ,2772 + ,1 + ,65 + ,4030 + ,2925 + ,10 + ,62 + ,45 + ,0 + ,2790 + ,1 + ,65 + ,4485 + ,3250 + ,12 + ,69 + ,50 + ,1 + ,3450 + ,1 + ,69 + ,4347 + ,3795 + ,11 + ,63 + ,55 + ,0 + ,3465 + ,1 + ,71 + ,4402 + ,2698 + ,12 + ,62 + ,38 + ,1 + ,2356 + ,1 + ,68 + ,4148 + ,2720 + ,12 + ,61 + ,40 + ,1 + ,2440 + ,1 + ,49 + ,3185 + ,2499 + ,10 + ,65 + ,51 + ,0 + ,3315 + ,1 + ,86 + ,5504 + ,4214 + ,12 + ,64 + ,49 + ,1 + ,3136 + ,1 + ,63 + ,3528 + ,2457 + ,12 + ,56 + ,39 + ,0 + ,2184 + ,1 + ,77 + ,4312 + ,4389 + ,11 + ,56 + ,57 + ,0 + ,3192 + ,1 + ,52 + ,2496 + ,1560 + ,10 + ,48 + ,30 + ,1 + ,1440 + ,1 + ,73 + ,5402 + ,3723 + ,12 + ,74 + ,51 + ,1 + ,3774 + ,1 + ,63 + ,4347 + ,3024 + ,11 + ,69 + ,48 + ,1 + ,3312 + ,1 + ,54 + ,3348 + ,3024 + ,12 + ,62 + ,56 + ,1 + ,3472 + ,1 + ,56 + ,4088 + ,3696 + ,12 + ,73 + ,66 + ,1 + ,4818 + ,1 + ,54 + ,3456 + ,3888 + ,10 + ,64 + ,72 + ,1 + ,4608 + ,1 + ,61 + ,3477 + ,1708 + ,11 + ,57 + ,28 + ,1 + ,1596 + ,1 + ,70 + ,3990 + ,3640 + ,10 + ,57 + ,52 + ,1 + ,2964 + ,1 + ,68 + ,4080 + ,3604 + ,11 + ,60 + ,53 + ,0 + ,3180 + ,1 + ,63 + ,3843 + ,4410 + ,11 + ,61 + ,70 + ,0 + ,4270 + ,1 + ,76 + ,5472 + ,4788 + ,12 + ,72 + ,63 + ,1 + ,4536 + ,1 + ,69 + ,3933 + ,3174 + ,11 + ,57 + ,46 + ,1 + ,2622 + ,1 + ,71 + ,3621 + ,3195 + ,11 + ,51 + ,45 + ,1 + ,2295 + ,1 + ,39 + ,2457 + ,2652 + ,7 + ,63 + ,68 + ,1 + ,4284 + ,2 + ,54 + ,2916 + ,2916 + ,12 + ,54 + ,54 + ,1 + ,2916 + ,1 + ,64 + ,4608 + ,3840 + ,8 + ,72 + ,60 + ,1 + ,4320 + ,2 + ,70 + ,4340 + ,3500 + ,10 + ,62 + ,50 + ,1 + ,3100 + ,1 + ,76 + ,5168 + ,5016 + ,12 + ,68 + ,66 + ,1 + ,4488 + ,1 + ,71 + ,4402 + ,3976 + ,11 + ,62 + ,56 + ,1 + ,3472 + ,1 + ,73 + ,4599 + ,3942 + ,13 + ,63 + ,54 + ,0 + ,3402 + ,1 + ,81 + ,6237 + ,5832 + ,9 + ,77 + ,72 + ,1 + ,5544 + ,1 + ,50 + ,2850 + ,1700 + ,11 + ,57 + ,34 + ,1 + ,1938 + ,1 + ,42 + ,2394 + ,1638 + ,13 + ,57 + ,39 + ,1 + ,2223 + ,1 + ,66 + ,4026 + ,4356 + ,8 + ,61 + ,66 + ,1 + ,4026 + ,1 + ,77 + ,5005 + ,2079 + ,12 + ,65 + ,27 + ,1 + ,1755 + ,1 + ,62 + ,3906 + ,3906 + ,11 + ,63 + ,63 + ,1 + ,3969 + ,1 + ,66 + ,4356 + ,4290 + ,11 + ,66 + ,65 + ,0 + ,4290 + ,1 + ,69 + ,4692 + ,4347 + ,12 + ,68 + ,63 + ,1 + ,4284 + ,1 + ,72 + ,5184 + ,3528 + ,13 + ,72 + ,49 + ,1 + ,3528 + ,1 + ,67 + ,4556 + ,2814 + ,11 + ,68 + ,42 + ,1 + ,2856 + ,1 + ,59 + ,3481 + ,3009 + ,10 + ,59 + ,51 + ,1 + ,3009 + ,1 + ,66 + ,3696 + ,3300 + ,10 + ,56 + ,50 + ,1 + ,2800 + ,1 + ,68 + ,4216 + ,4352 + ,10 + ,62 + ,64 + ,1 + ,3968 + ,1 + ,72 + ,5184 + ,4896 + ,12 + ,72 + ,68 + ,0 + ,4896 + ,1 + ,73 + ,4964 + ,4818 + ,12 + ,68 + ,66 + ,0 + ,4488 + ,1 + ,69 + ,4623 + ,4071 + ,13 + ,67 + ,59 + ,1 + ,3953 + ,1 + ,57 + ,3078 + ,1824 + ,11 + ,54 + ,32 + ,1 + ,1728 + ,1 + ,55 + ,3795 + ,3410 + ,11 + ,69 + ,62 + ,0 + ,4278 + ,1 + ,72 + ,4392 + ,3744 + ,12 + ,61 + ,52 + ,1 + ,3172 + ,1 + ,68 + ,3740 + ,2312 + ,9 + ,55 + ,34 + ,1 + ,1870 + ,1 + ,83 + ,6225 + ,5229 + ,11 + ,75 + ,63 + ,0 + ,4725 + ,1 + ,74 + ,4070 + ,3552 + ,12 + ,55 + ,48 + ,1 + ,2640 + ,1 + ,72 + ,3528 + ,3816 + ,12 + ,49 + ,53 + ,1 + ,2597 + ,1 + ,66 + ,3564 + ,2574 + ,13 + ,54 + ,39 + ,0 + ,2106 + ,1 + ,61 + ,4026 + ,3111 + ,6 + ,66 + ,51 + ,1 + ,3366 + ,1 + ,86 + ,6278 + ,5160 + ,11 + ,73 + ,60 + ,1 + ,4380 + ,1 + ,81 + ,5103 + ,5670 + ,10 + ,63 + ,70 + ,0 + ,4410 + ,1 + ,79 + ,4819 + ,3160 + ,12 + ,61 + ,40 + ,0 + ,2440 + ,1 + ,73 + ,5402 + ,4453 + ,11 + ,74 + ,61 + ,1 + ,4514 + ,1 + ,59 + ,4779 + ,2065 + ,12 + ,81 + ,35 + ,0 + ,2835 + ,1 + ,64 + ,3968 + ,2496 + ,12 + ,62 + ,39 + ,1 + ,2418 + ,1 + ,75 + ,4800 + ,2325 + ,7 + ,64 + ,31 + ,1 + ,1984 + ,1 + ,68 + ,4216 + ,2448 + ,12 + ,62 + ,36 + ,1 + ,2232 + ,1 + ,84 + ,7140 + ,4284 + ,12 + ,85 + ,51 + ,1 + ,4335 + ,1 + ,68 + ,5032 + ,3740 + ,9 + ,74 + ,55 + ,1 + ,4070 + ,1 + ,68 + ,3468 + ,4556 + ,12 + ,51 + ,67 + ,1 + ,3417 + ,1 + ,69 + ,4554 + ,2760 + ,12 + ,66 + ,40 + ,1 + ,2640 + ,1) + ,dim=c(9 + ,146) + ,dimnames=list(c('Groepsgevoel' + ,'InteractieGR_NV' + ,'InteractieGR_U' + ,'Vrienden_vinden' + ,'NVC' + ,'Uitingsangst' + ,'Geslacht' + ,'InteractieNV_U' + ,'Leeftijd') + ,1:146)) > y <- array(NA,dim=c(9,146),dimnames=list(c('Groepsgevoel','InteractieGR_NV','InteractieGR_U','Vrienden_vinden','NVC','Uitingsangst','Geslacht','InteractieNV_U','Leeftijd'),1:146)) > 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 = '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > 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 Vrienden_vinden Groepsgevoel InteractieGR_NV InteractieGR_U NVC 1 5 66 4818 4488 73 2 12 54 3132 2916 58 3 11 82 5576 3362 68 4 6 61 3782 2989 62 5 12 65 4225 3185 65 6 11 77 6237 5544 81 7 12 66 4818 5148 73 8 7 66 4224 3828 64 9 8 66 4488 3828 68 10 13 48 2448 1104 51 11 12 57 3876 2223 68 12 13 80 4880 5040 61 13 12 60 4140 2760 69 14 12 70 5110 4060 73 15 11 85 5185 3315 61 16 12 59 3658 2596 62 17 12 72 4536 3528 63 18 12 70 4830 3990 69 19 11 74 3478 5624 47 20 13 70 4620 4410 66 21 9 51 2958 918 58 22 11 70 4410 2800 63 23 11 71 4899 4189 69 24 11 72 4248 4464 59 25 9 50 2950 3500 59 26 11 69 4347 4485 63 27 12 73 4745 4088 65 28 12 66 4290 2970 65 29 10 73 5183 4161 71 30 12 58 3480 2900 60 31 12 78 6318 3120 81 32 12 83 5561 4814 67 33 9 76 5016 3724 66 34 9 77 4774 3773 62 35 12 79 4977 2133 63 36 14 71 5183 3621 73 37 12 79 4345 5925 55 38 11 60 3540 3900 59 39 9 73 4672 3431 64 40 11 70 4410 3430 63 41 7 42 2688 2730 64 42 15 74 5402 4514 73 43 11 68 3672 3128 54 44 12 83 6308 5727 76 45 12 62 4588 3410 74 46 9 79 4977 6162 63 47 12 61 4453 3538 73 48 11 86 5762 2924 67 49 11 64 4352 4288 68 50 8 75 4950 3375 66 51 7 59 3658 4012 62 52 12 82 5822 4018 71 53 8 61 3843 1159 63 54 10 69 5175 4968 75 55 12 60 4620 3540 77 56 15 59 3658 2714 62 57 12 81 5994 4536 74 58 12 65 4355 2925 67 59 12 60 3360 3180 56 60 12 60 3600 4020 60 61 8 45 2610 3285 58 62 10 75 4875 3450 65 63 14 84 4116 5880 49 64 10 77 4697 2926 61 65 12 64 4224 3456 66 66 14 54 3456 2484 64 67 6 72 4680 3312 65 68 11 56 2576 2520 46 69 10 67 4355 3149 65 70 14 81 6561 2025 81 71 12 73 5256 4599 72 72 13 67 4355 3082 65 73 11 72 5328 4968 74 74 11 69 4071 2967 59 75 12 71 4899 3479 69 76 13 77 4466 3003 58 77 12 63 4473 4095 71 78 8 49 3871 2646 79 79 12 74 5032 3700 68 80 11 76 5016 3192 66 81 10 65 4030 2925 62 82 12 65 4485 3250 69 83 11 69 4347 3795 63 84 12 71 4402 2698 62 85 12 68 4148 2720 61 86 10 49 3185 2499 65 87 12 86 5504 4214 64 88 12 63 3528 2457 56 89 11 77 4312 4389 56 90 10 52 2496 1560 48 91 12 73 5402 3723 74 92 11 63 4347 3024 69 93 12 54 3348 3024 62 94 12 56 4088 3696 73 95 10 54 3456 3888 64 96 11 61 3477 1708 57 97 10 70 3990 3640 57 98 11 68 4080 3604 60 99 11 63 3843 4410 61 100 12 76 5472 4788 72 101 11 69 3933 3174 57 102 11 71 3621 3195 51 103 7 39 2457 2652 63 104 12 54 2916 2916 54 105 8 64 4608 3840 72 106 10 70 4340 3500 62 107 12 76 5168 5016 68 108 11 71 4402 3976 62 109 13 73 4599 3942 63 110 9 81 6237 5832 77 111 11 50 2850 1700 57 112 13 42 2394 1638 57 113 8 66 4026 4356 61 114 12 77 5005 2079 65 115 11 62 3906 3906 63 116 11 66 4356 4290 66 117 12 69 4692 4347 68 118 13 72 5184 3528 72 119 11 67 4556 2814 68 120 10 59 3481 3009 59 121 10 66 3696 3300 56 122 10 68 4216 4352 62 123 12 72 5184 4896 72 124 12 73 4964 4818 68 125 13 69 4623 4071 67 126 11 57 3078 1824 54 127 11 55 3795 3410 69 128 12 72 4392 3744 61 129 9 68 3740 2312 55 130 11 83 6225 5229 75 131 12 74 4070 3552 55 132 12 72 3528 3816 49 133 13 66 3564 2574 54 134 6 61 4026 3111 66 135 11 86 6278 5160 73 136 10 81 5103 5670 63 137 12 79 4819 3160 61 138 11 73 5402 4453 74 139 12 59 4779 2065 81 140 12 64 3968 2496 62 141 7 75 4800 2325 64 142 12 68 4216 2448 62 143 12 84 7140 4284 85 144 9 68 5032 3740 74 145 12 68 3468 4556 51 146 12 69 4554 2760 66 Uitingsangst Geslacht InteractieNV_U Leeftijd 1 68 0 4964 1 2 54 1 3132 1 3 41 1 2788 1 4 49 1 3038 1 5 49 1 3185 1 6 72 1 5832 1 7 78 1 5694 1 8 58 0 3712 1 9 58 1 3944 1 10 23 1 1173 1 11 39 1 2652 1 12 63 1 3843 1 13 46 1 3174 1 14 58 1 4234 1 15 39 0 2379 1 16 44 0 2728 1 17 49 1 3087 1 18 57 1 3933 1 19 76 0 3572 1 20 63 0 4158 1 21 18 1 1044 1 22 40 0 2520 1 23 59 1 4071 1 24 62 0 3658 1 25 70 1 4130 1 26 65 0 4095 1 27 56 0 3640 1 28 45 1 2925 1 29 57 0 4047 1 30 50 1 3000 1 31 40 0 3240 1 32 58 1 3886 1 33 49 0 3234 1 34 49 1 3038 1 35 27 1 1701 1 36 51 0 3723 1 37 75 0 4125 1 38 65 1 3835 1 39 47 1 3008 1 40 49 0 3087 1 41 65 1 4160 1 42 61 1 4453 1 43 46 1 2484 1 44 69 1 5244 1 45 55 0 4070 1 46 78 0 4914 1 47 58 0 4234 1 48 34 0 2278 1 49 67 0 4556 1 50 45 1 2970 1 51 68 0 4216 1 52 49 0 3479 1 53 19 1 1197 1 54 72 1 5400 1 55 59 1 4543 1 56 46 0 2852 1 57 56 1 4144 1 58 45 0 3015 1 59 53 0 2968 1 60 67 0 4020 1 61 73 0 4234 1 62 46 1 2990 1 63 70 0 3430 1 64 38 1 2318 1 65 54 0 3564 1 66 46 0 2944 1 67 46 0 2990 1 68 45 1 2070 1 69 47 0 3055 1 70 25 0 2025 1 71 63 1 4536 1 72 46 0 2990 1 73 69 0 5106 1 74 43 1 2537 1 75 49 1 3381 1 76 39 0 2262 1 77 65 1 4615 1 78 54 0 4266 1 79 50 0 3400 1 80 42 1 2772 1 81 45 0 2790 1 82 50 1 3450 1 83 55 0 3465 1 84 38 1 2356 1 85 40 1 2440 1 86 51 0 3315 1 87 49 1 3136 1 88 39 0 2184 1 89 57 0 3192 1 90 30 1 1440 1 91 51 1 3774 1 92 48 1 3312 1 93 56 1 3472 1 94 66 1 4818 1 95 72 1 4608 1 96 28 1 1596 1 97 52 1 2964 1 98 53 0 3180 1 99 70 0 4270 1 100 63 1 4536 1 101 46 1 2622 1 102 45 1 2295 1 103 68 1 4284 2 104 54 1 2916 1 105 60 1 4320 2 106 50 1 3100 1 107 66 1 4488 1 108 56 1 3472 1 109 54 0 3402 1 110 72 1 5544 1 111 34 1 1938 1 112 39 1 2223 1 113 66 1 4026 1 114 27 1 1755 1 115 63 1 3969 1 116 65 0 4290 1 117 63 1 4284 1 118 49 1 3528 1 119 42 1 2856 1 120 51 1 3009 1 121 50 1 2800 1 122 64 1 3968 1 123 68 0 4896 1 124 66 0 4488 1 125 59 1 3953 1 126 32 1 1728 1 127 62 0 4278 1 128 52 1 3172 1 129 34 1 1870 1 130 63 0 4725 1 131 48 1 2640 1 132 53 1 2597 1 133 39 0 2106 1 134 51 1 3366 1 135 60 1 4380 1 136 70 0 4410 1 137 40 0 2440 1 138 61 1 4514 1 139 35 0 2835 1 140 39 1 2418 1 141 31 1 1984 1 142 36 1 2232 1 143 51 1 4335 1 144 55 1 4070 1 145 67 1 3417 1 146 40 1 2640 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Groepsgevoel InteractieGR_NV InteractieGR_U 17.634600 -0.181160 0.001452 0.002178 NVC Uitingsangst Geslacht InteractieNV_U 0.038940 -0.004371 -0.146541 -0.002433 Leeftijd -2.367466 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.5435 -0.7982 0.2628 0.9940 3.9282 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 17.634600 8.850847 1.992 0.0483 * Groepsgevoel -0.181160 0.135777 -1.334 0.1843 InteractieGR_NV 0.001452 0.001962 0.740 0.4606 InteractieGR_U 0.002178 0.001092 1.994 0.0481 * NVC 0.038940 0.145522 0.268 0.7894 Uitingsangst -0.004371 0.101495 -0.043 0.9657 Geslacht -0.146541 0.313971 -0.467 0.6414 InteractieNV_U -0.002433 0.001576 -1.544 0.1249 Leeftijd -2.367466 1.300442 -1.821 0.0709 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.731 on 137 degrees of freedom Multiple R-squared: 0.1226, Adjusted R-squared: 0.07132 F-statistic: 2.392 on 8 and 137 DF, p-value: 0.01910 > 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 + } [,1] [,2] [,3] [1,] 0.99793962 0.0041207595 0.0020603798 [2,] 0.99619296 0.0076140774 0.0038070387 [3,] 0.99277666 0.0144466894 0.0072233447 [4,] 0.99363287 0.0127342530 0.0063671265 [5,] 0.99855475 0.0028905079 0.0014452540 [6,] 0.99711024 0.0057795195 0.0028897597 [7,] 0.99518528 0.0096294321 0.0048147161 [8,] 0.99196463 0.0160707472 0.0080353736 [9,] 0.99734564 0.0053087294 0.0026543647 [10,] 0.99878232 0.0024353621 0.0012176810 [11,] 0.99804492 0.0039101572 0.0019550786 [12,] 0.99656982 0.0068603580 0.0034301790 [13,] 0.99439502 0.0112099587 0.0056049794 [14,] 0.99157982 0.0168403538 0.0084201769 [15,] 0.98774130 0.0245174010 0.0122587005 [16,] 0.98452996 0.0309400822 0.0154700411 [17,] 0.97873378 0.0425324473 0.0212662236 [18,] 0.97068487 0.0586302614 0.0293151307 [19,] 0.96343275 0.0731345045 0.0365672522 [20,] 0.95005878 0.0998824372 0.0499412186 [21,] 0.93355008 0.1328998360 0.0664499180 [22,] 0.93628664 0.1274267231 0.0637133615 [23,] 0.94885333 0.1022933318 0.0511466659 [24,] 0.93589004 0.1282199185 0.0641099592 [25,] 0.96443130 0.0711373949 0.0355686975 [26,] 0.95212968 0.0957406343 0.0478703172 [27,] 0.93656218 0.1268756368 0.0634378184 [28,] 0.94369167 0.1126166564 0.0563083282 [29,] 0.92679535 0.1464092921 0.0732046460 [30,] 0.92768568 0.1446286312 0.0723143156 [31,] 0.96837999 0.0632400134 0.0316200067 [32,] 0.95743856 0.0851228768 0.0425614384 [33,] 0.94810237 0.1037952532 0.0518976266 [34,] 0.94714897 0.1057020613 0.0528510307 [35,] 0.96208548 0.0758290495 0.0379145247 [36,] 0.96095085 0.0780982997 0.0390491499 [37,] 0.94851892 0.1029621571 0.0514810786 [38,] 0.93634542 0.1273091591 0.0636545795 [39,] 0.96602009 0.0679598240 0.0339799120 [40,] 0.98303190 0.0339361959 0.0169680979 [41,] 0.97699047 0.0460190668 0.0230095334 [42,] 0.99114708 0.0177058355 0.0088529177 [43,] 0.98785909 0.0242818256 0.0121409128 [44,] 0.98753412 0.0249317568 0.0124658784 [45,] 0.99741643 0.0051671440 0.0025835720 [46,] 0.99627694 0.0074461248 0.0037230624 [47,] 0.99498214 0.0100357151 0.0050178575 [48,] 0.99395753 0.0120849306 0.0060424653 [49,] 0.99304824 0.0139035155 0.0069517578 [50,] 0.99385739 0.0122852152 0.0061426076 [51,] 0.99239984 0.0152003280 0.0076001640 [52,] 0.99303573 0.0139285468 0.0069642734 [53,] 0.99098097 0.0180380578 0.0090190289 [54,] 0.98855224 0.0228955135 0.0114477568 [55,] 0.99377639 0.0124472261 0.0062236130 [56,] 0.99984254 0.0003149249 0.0001574625 [57,] 0.99976166 0.0004766857 0.0002383429 [58,] 0.99971989 0.0005602198 0.0002801099 [59,] 0.99959375 0.0008125020 0.0004062510 [60,] 0.99946567 0.0010686596 0.0005343298 [61,] 0.99945578 0.0010884314 0.0005442157 [62,] 0.99915343 0.0016931375 0.0008465688 [63,] 0.99871700 0.0025659963 0.0012829981 [64,] 0.99823890 0.0035222062 0.0017611031 [65,] 0.99849166 0.0030166710 0.0015083355 [66,] 0.99847672 0.0030465684 0.0015232842 [67,] 0.99888086 0.0022382871 0.0011191435 [68,] 0.99835509 0.0032898268 0.0016449134 [69,] 0.99754068 0.0049186370 0.0024593185 [70,] 0.99718889 0.0056222235 0.0028111117 [71,] 0.99636666 0.0072666843 0.0036333422 [72,] 0.99479899 0.0104020212 0.0052010106 [73,] 0.99331270 0.0133745937 0.0066872969 [74,] 0.99156674 0.0168665274 0.0084332637 [75,] 0.99016478 0.0196704431 0.0098352215 [76,] 0.98748703 0.0250259480 0.0125129740 [77,] 0.98353010 0.0329397953 0.0164698977 [78,] 0.97780042 0.0443991525 0.0221995762 [79,] 0.97317359 0.0536528222 0.0268264111 [80,] 0.96663331 0.0667333852 0.0333666926 [81,] 0.95529608 0.0894078429 0.0447039214 [82,] 0.94959622 0.1008075522 0.0504037761 [83,] 0.96199711 0.0760057724 0.0380028862 [84,] 0.94942407 0.1011518648 0.0505759324 [85,] 0.93333930 0.1333214000 0.0666607000 [86,] 0.91969596 0.1606080811 0.0803040406 [87,] 0.90160601 0.1967879844 0.0983939922 [88,] 0.87879525 0.2424094910 0.1212047455 [89,] 0.86813789 0.2637242105 0.1318621053 [90,] 0.83539634 0.3292073287 0.1646036643 [91,] 0.79873608 0.4025278406 0.2012639203 [92,] 0.76161576 0.4767684825 0.2383842413 [93,] 0.72288446 0.5542310842 0.2771155421 [94,] 0.67279179 0.6544164130 0.3272082065 [95,] 0.63185293 0.7362941430 0.3681470715 [96,] 0.61304492 0.7739101600 0.3869550800 [97,] 0.55578338 0.8884332489 0.4442166245 [98,] 0.52729237 0.9454152601 0.4727076300 [99,] 0.51578024 0.9684395256 0.4842197628 [100,] 0.46033309 0.9206661766 0.5396669117 [101,] 0.44701870 0.8940374056 0.5529812972 [102,] 0.53878780 0.9224244094 0.4612122047 [103,] 0.49256343 0.9851268535 0.5074365732 [104,] 0.42854834 0.8570966740 0.5714516630 [105,] 0.36789381 0.7357876245 0.6321061877 [106,] 0.34274579 0.6854915720 0.6572542140 [107,] 0.37966050 0.7593210025 0.6203394988 [108,] 0.31849503 0.6369900616 0.6815049692 [109,] 0.27151090 0.5430218007 0.7284890996 [110,] 0.23091189 0.4618237711 0.7690881145 [111,] 0.19029813 0.3805962664 0.8097018668 [112,] 0.15237030 0.3047406002 0.8476296999 [113,] 0.11411947 0.2282389481 0.8858805260 [114,] 0.15483444 0.3096688740 0.8451655630 [115,] 0.11214092 0.2242818479 0.8878590760 [116,] 0.09143047 0.1828609411 0.9085695295 [117,] 0.07661206 0.1532241246 0.9233879377 [118,] 0.07689434 0.1537886725 0.9231056638 [119,] 0.04950371 0.0990074263 0.9504962869 [120,] 0.03865517 0.0773103440 0.9613448280 [121,] 0.02680978 0.0536195681 0.9731902160 [122,] 0.01379996 0.0275999285 0.9862000358 [123,] 0.22099726 0.4419945212 0.7790027394 > postscript(file="/var/www/html/rcomp/tmp/1s6fb1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2s6fb1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3lgww1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4lgww1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5lgww1291291447.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() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 146 Frequency = 1 1 2 3 4 5 6 -5.54350727 1.36464957 -0.36492866 -4.87604660 1.01962994 0.05461589 7 8 9 10 11 12 1.98587149 -3.98383072 -2.81174029 1.58651465 0.71425521 1.56500221 13 14 15 16 17 18 0.96702163 1.01579526 -0.02946046 0.87468116 0.92884246 0.99363037 19 20 21 22 23 24 -0.96252242 1.92789015 -2.81360863 -0.23089283 -0.01416006 -0.23582699 25 26 27 28 29 30 -0.90807197 -0.04804313 0.73899231 0.92446969 -1.29467402 1.20243038 31 32 33 34 35 36 -0.19695347 0.46122698 -2.37572982 -2.12461302 1.12578375 2.62638086 37 38 39 40 41 42 0.05905314 0.43642566 -2.11610079 -0.18372478 -2.44390615 3.87398495 43 44 45 46 47 48 0.19943859 0.39084698 1.14196831 -2.75295516 1.32915641 -0.33569387 49 50 51 52 53 54 0.40365528 -3.21445946 -3.48306976 0.30253482 -3.62945923 -0.41639079 55 56 57 58 59 60 1.64826650 3.92820191 0.42219802 0.74152106 1.07369738 1.36144671 61 62 63 64 65 66 -1.69360107 -1.17693032 1.91590431 -0.92958213 1.00839914 2.96242945 67 68 69 70 71 72 -5.28339896 0.24013385 -1.19997141 1.35618782 0.96930717 1.78338857 73 74 75 76 77 78 0.06890240 0.07315888 0.80920961 2.07644466 1.63166152 -2.23086297 79 80 81 82 83 84 0.62140135 -0.22551775 -1.13951031 0.99411564 -0.12222731 0.96166835 85 86 87 88 89 90 0.99105639 -0.69699910 0.64648167 0.97878024 -0.29855596 -0.95436907 91 92 93 94 95 96 0.68040030 -0.02030314 1.49623719 2.21167083 0.21434894 -0.04979253 97 98 99 100 101 102 -0.93734946 -0.08532054 0.28545608 0.78769822 0.12054818 0.32361286 103 104 105 106 107 108 0.23901659 1.30835794 -0.23901659 -1.01305759 0.78457216 -0.02698996 109 110 111 112 113 114 1.75885596 -2.39289561 -0.25659655 1.80638096 -2.78377603 0.89392380 115 116 117 118 119 120 0.41596724 0.17769966 1.15465633 1.71084872 -0.23862038 -0.79000089 121 122 123 124 125 126 -0.86373249 -0.87735443 0.99722903 0.82181897 2.07185120 0.00764367 127 128 129 130 131 132 0.75635377 0.96534339 -1.70783324 -0.80096552 1.13480110 1.13522371 133 134 135 136 137 138 2.10331769 -4.84478726 -0.81234227 -1.76353053 0.90516781 -0.06485598 139 140 141 142 143 144 -0.11508806 0.91861960 -4.09285258 0.92209095 -0.13451073 -1.98760599 145 146 0.86491293 0.78773854 > postscript(file="/var/www/html/rcomp/tmp/6epvh1291291447.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 146 Frequency = 1 lag(myerror, k = 1) myerror 0 -5.54350727 NA 1 1.36464957 -5.54350727 2 -0.36492866 1.36464957 3 -4.87604660 -0.36492866 4 1.01962994 -4.87604660 5 0.05461589 1.01962994 6 1.98587149 0.05461589 7 -3.98383072 1.98587149 8 -2.81174029 -3.98383072 9 1.58651465 -2.81174029 10 0.71425521 1.58651465 11 1.56500221 0.71425521 12 0.96702163 1.56500221 13 1.01579526 0.96702163 14 -0.02946046 1.01579526 15 0.87468116 -0.02946046 16 0.92884246 0.87468116 17 0.99363037 0.92884246 18 -0.96252242 0.99363037 19 1.92789015 -0.96252242 20 -2.81360863 1.92789015 21 -0.23089283 -2.81360863 22 -0.01416006 -0.23089283 23 -0.23582699 -0.01416006 24 -0.90807197 -0.23582699 25 -0.04804313 -0.90807197 26 0.73899231 -0.04804313 27 0.92446969 0.73899231 28 -1.29467402 0.92446969 29 1.20243038 -1.29467402 30 -0.19695347 1.20243038 31 0.46122698 -0.19695347 32 -2.37572982 0.46122698 33 -2.12461302 -2.37572982 34 1.12578375 -2.12461302 35 2.62638086 1.12578375 36 0.05905314 2.62638086 37 0.43642566 0.05905314 38 -2.11610079 0.43642566 39 -0.18372478 -2.11610079 40 -2.44390615 -0.18372478 41 3.87398495 -2.44390615 42 0.19943859 3.87398495 43 0.39084698 0.19943859 44 1.14196831 0.39084698 45 -2.75295516 1.14196831 46 1.32915641 -2.75295516 47 -0.33569387 1.32915641 48 0.40365528 -0.33569387 49 -3.21445946 0.40365528 50 -3.48306976 -3.21445946 51 0.30253482 -3.48306976 52 -3.62945923 0.30253482 53 -0.41639079 -3.62945923 54 1.64826650 -0.41639079 55 3.92820191 1.64826650 56 0.42219802 3.92820191 57 0.74152106 0.42219802 58 1.07369738 0.74152106 59 1.36144671 1.07369738 60 -1.69360107 1.36144671 61 -1.17693032 -1.69360107 62 1.91590431 -1.17693032 63 -0.92958213 1.91590431 64 1.00839914 -0.92958213 65 2.96242945 1.00839914 66 -5.28339896 2.96242945 67 0.24013385 -5.28339896 68 -1.19997141 0.24013385 69 1.35618782 -1.19997141 70 0.96930717 1.35618782 71 1.78338857 0.96930717 72 0.06890240 1.78338857 73 0.07315888 0.06890240 74 0.80920961 0.07315888 75 2.07644466 0.80920961 76 1.63166152 2.07644466 77 -2.23086297 1.63166152 78 0.62140135 -2.23086297 79 -0.22551775 0.62140135 80 -1.13951031 -0.22551775 81 0.99411564 -1.13951031 82 -0.12222731 0.99411564 83 0.96166835 -0.12222731 84 0.99105639 0.96166835 85 -0.69699910 0.99105639 86 0.64648167 -0.69699910 87 0.97878024 0.64648167 88 -0.29855596 0.97878024 89 -0.95436907 -0.29855596 90 0.68040030 -0.95436907 91 -0.02030314 0.68040030 92 1.49623719 -0.02030314 93 2.21167083 1.49623719 94 0.21434894 2.21167083 95 -0.04979253 0.21434894 96 -0.93734946 -0.04979253 97 -0.08532054 -0.93734946 98 0.28545608 -0.08532054 99 0.78769822 0.28545608 100 0.12054818 0.78769822 101 0.32361286 0.12054818 102 0.23901659 0.32361286 103 1.30835794 0.23901659 104 -0.23901659 1.30835794 105 -1.01305759 -0.23901659 106 0.78457216 -1.01305759 107 -0.02698996 0.78457216 108 1.75885596 -0.02698996 109 -2.39289561 1.75885596 110 -0.25659655 -2.39289561 111 1.80638096 -0.25659655 112 -2.78377603 1.80638096 113 0.89392380 -2.78377603 114 0.41596724 0.89392380 115 0.17769966 0.41596724 116 1.15465633 0.17769966 117 1.71084872 1.15465633 118 -0.23862038 1.71084872 119 -0.79000089 -0.23862038 120 -0.86373249 -0.79000089 121 -0.87735443 -0.86373249 122 0.99722903 -0.87735443 123 0.82181897 0.99722903 124 2.07185120 0.82181897 125 0.00764367 2.07185120 126 0.75635377 0.00764367 127 0.96534339 0.75635377 128 -1.70783324 0.96534339 129 -0.80096552 -1.70783324 130 1.13480110 -0.80096552 131 1.13522371 1.13480110 132 2.10331769 1.13522371 133 -4.84478726 2.10331769 134 -0.81234227 -4.84478726 135 -1.76353053 -0.81234227 136 0.90516781 -1.76353053 137 -0.06485598 0.90516781 138 -0.11508806 -0.06485598 139 0.91861960 -0.11508806 140 -4.09285258 0.91861960 141 0.92209095 -4.09285258 142 -0.13451073 0.92209095 143 -1.98760599 -0.13451073 144 0.86491293 -1.98760599 145 0.78773854 0.86491293 146 NA 0.78773854 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.36464957 -5.54350727 [2,] -0.36492866 1.36464957 [3,] -4.87604660 -0.36492866 [4,] 1.01962994 -4.87604660 [5,] 0.05461589 1.01962994 [6,] 1.98587149 0.05461589 [7,] -3.98383072 1.98587149 [8,] -2.81174029 -3.98383072 [9,] 1.58651465 -2.81174029 [10,] 0.71425521 1.58651465 [11,] 1.56500221 0.71425521 [12,] 0.96702163 1.56500221 [13,] 1.01579526 0.96702163 [14,] -0.02946046 1.01579526 [15,] 0.87468116 -0.02946046 [16,] 0.92884246 0.87468116 [17,] 0.99363037 0.92884246 [18,] -0.96252242 0.99363037 [19,] 1.92789015 -0.96252242 [20,] -2.81360863 1.92789015 [21,] -0.23089283 -2.81360863 [22,] -0.01416006 -0.23089283 [23,] -0.23582699 -0.01416006 [24,] -0.90807197 -0.23582699 [25,] -0.04804313 -0.90807197 [26,] 0.73899231 -0.04804313 [27,] 0.92446969 0.73899231 [28,] -1.29467402 0.92446969 [29,] 1.20243038 -1.29467402 [30,] -0.19695347 1.20243038 [31,] 0.46122698 -0.19695347 [32,] -2.37572982 0.46122698 [33,] -2.12461302 -2.37572982 [34,] 1.12578375 -2.12461302 [35,] 2.62638086 1.12578375 [36,] 0.05905314 2.62638086 [37,] 0.43642566 0.05905314 [38,] -2.11610079 0.43642566 [39,] -0.18372478 -2.11610079 [40,] -2.44390615 -0.18372478 [41,] 3.87398495 -2.44390615 [42,] 0.19943859 3.87398495 [43,] 0.39084698 0.19943859 [44,] 1.14196831 0.39084698 [45,] -2.75295516 1.14196831 [46,] 1.32915641 -2.75295516 [47,] -0.33569387 1.32915641 [48,] 0.40365528 -0.33569387 [49,] -3.21445946 0.40365528 [50,] -3.48306976 -3.21445946 [51,] 0.30253482 -3.48306976 [52,] -3.62945923 0.30253482 [53,] -0.41639079 -3.62945923 [54,] 1.64826650 -0.41639079 [55,] 3.92820191 1.64826650 [56,] 0.42219802 3.92820191 [57,] 0.74152106 0.42219802 [58,] 1.07369738 0.74152106 [59,] 1.36144671 1.07369738 [60,] -1.69360107 1.36144671 [61,] -1.17693032 -1.69360107 [62,] 1.91590431 -1.17693032 [63,] -0.92958213 1.91590431 [64,] 1.00839914 -0.92958213 [65,] 2.96242945 1.00839914 [66,] -5.28339896 2.96242945 [67,] 0.24013385 -5.28339896 [68,] -1.19997141 0.24013385 [69,] 1.35618782 -1.19997141 [70,] 0.96930717 1.35618782 [71,] 1.78338857 0.96930717 [72,] 0.06890240 1.78338857 [73,] 0.07315888 0.06890240 [74,] 0.80920961 0.07315888 [75,] 2.07644466 0.80920961 [76,] 1.63166152 2.07644466 [77,] -2.23086297 1.63166152 [78,] 0.62140135 -2.23086297 [79,] -0.22551775 0.62140135 [80,] -1.13951031 -0.22551775 [81,] 0.99411564 -1.13951031 [82,] -0.12222731 0.99411564 [83,] 0.96166835 -0.12222731 [84,] 0.99105639 0.96166835 [85,] -0.69699910 0.99105639 [86,] 0.64648167 -0.69699910 [87,] 0.97878024 0.64648167 [88,] -0.29855596 0.97878024 [89,] -0.95436907 -0.29855596 [90,] 0.68040030 -0.95436907 [91,] -0.02030314 0.68040030 [92,] 1.49623719 -0.02030314 [93,] 2.21167083 1.49623719 [94,] 0.21434894 2.21167083 [95,] -0.04979253 0.21434894 [96,] -0.93734946 -0.04979253 [97,] -0.08532054 -0.93734946 [98,] 0.28545608 -0.08532054 [99,] 0.78769822 0.28545608 [100,] 0.12054818 0.78769822 [101,] 0.32361286 0.12054818 [102,] 0.23901659 0.32361286 [103,] 1.30835794 0.23901659 [104,] -0.23901659 1.30835794 [105,] -1.01305759 -0.23901659 [106,] 0.78457216 -1.01305759 [107,] -0.02698996 0.78457216 [108,] 1.75885596 -0.02698996 [109,] -2.39289561 1.75885596 [110,] -0.25659655 -2.39289561 [111,] 1.80638096 -0.25659655 [112,] -2.78377603 1.80638096 [113,] 0.89392380 -2.78377603 [114,] 0.41596724 0.89392380 [115,] 0.17769966 0.41596724 [116,] 1.15465633 0.17769966 [117,] 1.71084872 1.15465633 [118,] -0.23862038 1.71084872 [119,] -0.79000089 -0.23862038 [120,] -0.86373249 -0.79000089 [121,] -0.87735443 -0.86373249 [122,] 0.99722903 -0.87735443 [123,] 0.82181897 0.99722903 [124,] 2.07185120 0.82181897 [125,] 0.00764367 2.07185120 [126,] 0.75635377 0.00764367 [127,] 0.96534339 0.75635377 [128,] -1.70783324 0.96534339 [129,] -0.80096552 -1.70783324 [130,] 1.13480110 -0.80096552 [131,] 1.13522371 1.13480110 [132,] 2.10331769 1.13522371 [133,] -4.84478726 2.10331769 [134,] -0.81234227 -4.84478726 [135,] -1.76353053 -0.81234227 [136,] 0.90516781 -1.76353053 [137,] -0.06485598 0.90516781 [138,] -0.11508806 -0.06485598 [139,] 0.91861960 -0.11508806 [140,] -4.09285258 0.91861960 [141,] 0.92209095 -4.09285258 [142,] -0.13451073 0.92209095 [143,] -1.98760599 -0.13451073 [144,] 0.86491293 -1.98760599 [145,] 0.78773854 0.86491293 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.36464957 -5.54350727 2 -0.36492866 1.36464957 3 -4.87604660 -0.36492866 4 1.01962994 -4.87604660 5 0.05461589 1.01962994 6 1.98587149 0.05461589 7 -3.98383072 1.98587149 8 -2.81174029 -3.98383072 9 1.58651465 -2.81174029 10 0.71425521 1.58651465 11 1.56500221 0.71425521 12 0.96702163 1.56500221 13 1.01579526 0.96702163 14 -0.02946046 1.01579526 15 0.87468116 -0.02946046 16 0.92884246 0.87468116 17 0.99363037 0.92884246 18 -0.96252242 0.99363037 19 1.92789015 -0.96252242 20 -2.81360863 1.92789015 21 -0.23089283 -2.81360863 22 -0.01416006 -0.23089283 23 -0.23582699 -0.01416006 24 -0.90807197 -0.23582699 25 -0.04804313 -0.90807197 26 0.73899231 -0.04804313 27 0.92446969 0.73899231 28 -1.29467402 0.92446969 29 1.20243038 -1.29467402 30 -0.19695347 1.20243038 31 0.46122698 -0.19695347 32 -2.37572982 0.46122698 33 -2.12461302 -2.37572982 34 1.12578375 -2.12461302 35 2.62638086 1.12578375 36 0.05905314 2.62638086 37 0.43642566 0.05905314 38 -2.11610079 0.43642566 39 -0.18372478 -2.11610079 40 -2.44390615 -0.18372478 41 3.87398495 -2.44390615 42 0.19943859 3.87398495 43 0.39084698 0.19943859 44 1.14196831 0.39084698 45 -2.75295516 1.14196831 46 1.32915641 -2.75295516 47 -0.33569387 1.32915641 48 0.40365528 -0.33569387 49 -3.21445946 0.40365528 50 -3.48306976 -3.21445946 51 0.30253482 -3.48306976 52 -3.62945923 0.30253482 53 -0.41639079 -3.62945923 54 1.64826650 -0.41639079 55 3.92820191 1.64826650 56 0.42219802 3.92820191 57 0.74152106 0.42219802 58 1.07369738 0.74152106 59 1.36144671 1.07369738 60 -1.69360107 1.36144671 61 -1.17693032 -1.69360107 62 1.91590431 -1.17693032 63 -0.92958213 1.91590431 64 1.00839914 -0.92958213 65 2.96242945 1.00839914 66 -5.28339896 2.96242945 67 0.24013385 -5.28339896 68 -1.19997141 0.24013385 69 1.35618782 -1.19997141 70 0.96930717 1.35618782 71 1.78338857 0.96930717 72 0.06890240 1.78338857 73 0.07315888 0.06890240 74 0.80920961 0.07315888 75 2.07644466 0.80920961 76 1.63166152 2.07644466 77 -2.23086297 1.63166152 78 0.62140135 -2.23086297 79 -0.22551775 0.62140135 80 -1.13951031 -0.22551775 81 0.99411564 -1.13951031 82 -0.12222731 0.99411564 83 0.96166835 -0.12222731 84 0.99105639 0.96166835 85 -0.69699910 0.99105639 86 0.64648167 -0.69699910 87 0.97878024 0.64648167 88 -0.29855596 0.97878024 89 -0.95436907 -0.29855596 90 0.68040030 -0.95436907 91 -0.02030314 0.68040030 92 1.49623719 -0.02030314 93 2.21167083 1.49623719 94 0.21434894 2.21167083 95 -0.04979253 0.21434894 96 -0.93734946 -0.04979253 97 -0.08532054 -0.93734946 98 0.28545608 -0.08532054 99 0.78769822 0.28545608 100 0.12054818 0.78769822 101 0.32361286 0.12054818 102 0.23901659 0.32361286 103 1.30835794 0.23901659 104 -0.23901659 1.30835794 105 -1.01305759 -0.23901659 106 0.78457216 -1.01305759 107 -0.02698996 0.78457216 108 1.75885596 -0.02698996 109 -2.39289561 1.75885596 110 -0.25659655 -2.39289561 111 1.80638096 -0.25659655 112 -2.78377603 1.80638096 113 0.89392380 -2.78377603 114 0.41596724 0.89392380 115 0.17769966 0.41596724 116 1.15465633 0.17769966 117 1.71084872 1.15465633 118 -0.23862038 1.71084872 119 -0.79000089 -0.23862038 120 -0.86373249 -0.79000089 121 -0.87735443 -0.86373249 122 0.99722903 -0.87735443 123 0.82181897 0.99722903 124 2.07185120 0.82181897 125 0.00764367 2.07185120 126 0.75635377 0.00764367 127 0.96534339 0.75635377 128 -1.70783324 0.96534339 129 -0.80096552 -1.70783324 130 1.13480110 -0.80096552 131 1.13522371 1.13480110 132 2.10331769 1.13522371 133 -4.84478726 2.10331769 134 -0.81234227 -4.84478726 135 -1.76353053 -0.81234227 136 0.90516781 -1.76353053 137 -0.06485598 0.90516781 138 -0.11508806 -0.06485598 139 0.91861960 -0.11508806 140 -4.09285258 0.91861960 141 0.92209095 -4.09285258 142 -0.13451073 0.92209095 143 -1.98760599 -0.13451073 144 0.86491293 -1.98760599 145 0.78773854 0.86491293 > 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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7epvh1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8oyck1291291447.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9oyck1291291447.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() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10zpu41291291447.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() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/112qaa1291291447.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/www/html/rcomp/tmp/1269rg1291291447.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/www/html/rcomp/tmp/132io71291291447.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/www/html/rcomp/tmp/145jnv1291291447.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/www/html/rcomp/tmp/159jm11291291447.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/www/html/rcomp/tmp/16c22p1291291447.tab") + } > > try(system("convert tmp/1s6fb1291291447.ps tmp/1s6fb1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/2s6fb1291291447.ps tmp/2s6fb1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/3lgww1291291447.ps tmp/3lgww1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/4lgww1291291447.ps tmp/4lgww1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/5lgww1291291447.ps tmp/5lgww1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/6epvh1291291447.ps tmp/6epvh1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/7epvh1291291447.ps tmp/7epvh1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/8oyck1291291447.ps tmp/8oyck1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/9oyck1291291447.ps tmp/9oyck1291291447.png",intern=TRUE)) character(0) > try(system("convert tmp/10zpu41291291447.ps tmp/10zpu41291291447.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.088 1.786 10.064