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(1 + ,12 + ,12 + ,18 + ,18 + ,9 + ,9 + ,51 + ,15 + ,15 + ,1 + ,15 + ,15 + ,11 + ,11 + ,9 + ,9 + ,42 + ,14 + ,14 + ,1 + ,12 + ,12 + ,16 + ,16 + ,8 + ,8 + ,46 + ,10 + ,10 + ,1 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,47 + ,18 + ,18 + ,1 + ,9 + ,9 + ,19 + ,19 + ,11 + ,11 + ,33 + ,11 + ,11 + ,1 + ,11 + ,11 + ,18 + ,18 + ,8 + ,8 + ,47 + ,12 + ,12 + ,1 + ,11 + ,11 + ,14 + ,14 + ,9 + ,9 + ,32 + ,15 + ,15 + ,1 + ,15 + ,15 + ,18 + ,18 + ,6 + ,6 + ,53 + ,17 + ,17 + ,1 + ,11 + ,11 + ,14 + ,14 + ,11 + ,11 + ,33 + ,7 + ,7 + ,1 + ,10 + ,10 + ,12 + ,12 + ,16 + ,16 + ,37 + ,18 + ,18 + ,1 + ,11 + ,11 + ,16 + ,16 + ,7 + ,7 + ,49 + ,18 + ,18 + ,1 + ,11 + ,11 + ,9 + ,9 + ,15 + ,15 + ,43 + ,11 + ,11 + ,1 + ,14 + ,14 + ,17 + ,17 + ,10 + ,10 + ,43 + ,12 + ,12 + ,1 + ,13 + ,13 + ,17 + ,17 + ,6 + ,6 + ,46 + ,11 + ,11 + ,1 + ,16 + ,16 + ,12 + ,12 + ,12 + ,12 + ,42 + ,16 + ,16 + ,1 + ,13 + ,13 + ,11 + ,11 + ,14 + ,14 + ,40 + ,14 + ,14 + ,1 + ,14 + ,14 + ,17 + ,17 + ,9 + ,9 + ,42 + ,13 + ,13 + ,1 + ,9 + ,9 + ,16 + ,16 + ,14 + ,14 + ,44 + ,17 + ,17 + ,1 + ,12 + ,12 + ,12 + ,12 + ,14 + ,14 + ,46 + ,13 + ,13 + ,1 + ,13 + ,13 + ,16 + ,16 + ,8 + ,8 + ,45 + ,12 + ,12 + ,1 + ,16 + ,16 + ,14 + ,14 + ,10 + ,10 + ,49 + ,12 + ,12 + ,1 + ,15 + ,15 + ,12 + ,12 + ,9 + ,9 + ,43 + ,9 + ,9 + ,1 + ,5 + ,5 + ,14 + ,14 + ,11 + ,11 + ,37 + ,18 + ,18 + ,1 + ,11 + ,11 + ,15 + ,15 + ,9 + ,9 + ,45 + ,14 + ,14 + ,1 + ,17 + ,17 + ,11 + ,11 + ,10 + ,10 + ,45 + ,12 + ,12 + ,1 + ,9 + ,9 + ,14 + ,14 + ,8 + ,8 + ,31 + ,12 + ,12 + ,1 + ,13 + ,13 + ,15 + ,15 + ,14 + ,14 + ,33 + ,9 + ,9 + ,1 + ,10 + ,10 + ,16 + ,16 + ,10 + ,10 + ,44 + ,12 + ,12 + ,1 + ,12 + ,12 + ,15 + ,15 + ,14 + ,14 + ,38 + ,11 + ,11 + ,1 + ,11 + ,11 + ,16 + ,16 + ,15 + ,15 + ,33 + ,13 + ,13 + ,1 + ,16 + ,16 + ,9 + ,9 + ,11 + ,11 + ,47 + ,13 + ,13 + ,1 + ,15 + ,15 + ,15 + ,15 + ,8 + ,8 + ,48 + ,6 + ,6 + ,1 + ,14 + ,14 + ,17 + ,17 + ,10 + ,10 + ,54 + ,21 + ,21 + ,1 + ,16 + ,16 + ,17 + ,17 + ,10 + ,10 + ,43 + ,11 + ,11 + ,1 + ,9 + ,9 + ,15 + ,15 + ,9 + ,9 + ,54 + ,9 + ,9 + ,1 + ,14 + ,14 + ,13 + ,13 + ,13 + ,13 + ,44 + ,18 + ,18 + ,1 + ,15 + ,15 + ,15 + ,15 + ,10 + ,10 + ,45 + ,15 + ,15 + ,1 + ,15 + ,15 + ,15 + ,15 + ,11 + ,11 + ,44 + ,11 + ,11 + ,1 + ,13 + ,13 + ,14 + ,14 + ,10 + ,10 + ,47 + ,14 + ,14 + ,1 + ,12 + ,12 + ,7 + ,7 + ,16 + ,16 + ,43 + ,12 + ,12 + ,1 + ,12 + ,12 + ,13 + ,13 + ,6 + ,6 + ,33 + ,8 + ,8 + ,1 + ,12 + ,12 + ,15 + ,15 + ,11 + ,11 + ,46 + ,11 + ,11 + ,1 + ,14 + ,14 + ,13 + ,13 + ,14 + ,14 + ,47 + ,17 + ,17 + ,1 + ,6 + ,6 + ,16 + ,16 + ,9 + ,9 + ,47 + ,16 + ,16 + ,1 + ,14 + ,14 + ,12 + ,12 + ,11 + ,11 + ,43 + ,13 + ,13 + ,1 + ,12 + ,12 + ,14 + ,14 + ,12 + ,12 + ,44 + ,13 + ,13 + ,1 + ,16 + ,16 + ,15 + ,15 + ,9 + ,9 + ,47 + ,13 + ,13 + ,1 + ,14 + ,14 + ,15 + ,15 + ,14 + ,14 + ,47 + ,15 + ,15 + ,1 + ,10 + ,10 + ,17 + ,17 + ,8 + ,8 + ,46 + ,12 + ,12 + ,1 + ,16 + ,16 + ,16 + ,16 + ,10 + ,10 + ,47 + ,12 + ,12 + ,1 + ,15 + ,15 + ,14 + ,14 + ,8 + ,8 + ,46 + ,15 + ,15 + ,1 + ,10 + ,10 + ,16 + ,16 + ,11 + ,11 + ,36 + ,21 + ,21 + ,1 + ,8 + ,8 + ,10 + ,10 + ,14 + ,14 + ,30 + ,24 + ,24 + ,1 + ,13 + ,13 + ,15 + ,15 + ,10 + ,10 + ,49 + ,15 + ,15 + ,1 + ,16 + ,16 + ,13 + ,13 + ,9 + ,9 + ,55 + ,17 + ,17 + ,1 + ,11 + ,11 + ,16 + ,16 + ,8 + ,8 + ,52 + ,16 + ,16 + ,1 + ,14 + ,14 + ,18 + ,18 + ,8 + ,8 + ,47 + ,15 + ,15 + ,1 + ,9 + ,9 + ,14 + ,14 + ,16 + ,16 + ,33 + ,11 + ,11 + ,1 + ,14 + ,14 + ,14 + ,14 + ,13 + ,13 + ,44 + ,15 + ,15 + ,1 + ,8 + ,8 + ,14 + ,14 + ,13 + ,13 + ,42 + ,12 + ,12 + ,1 + ,8 + ,8 + ,14 + ,14 + ,8 + ,8 + ,55 + ,14 + ,14 + ,1 + ,11 + ,11 + ,15 + ,15 + ,9 + ,9 + ,42 + ,12 + ,12 + ,1 + ,12 + ,12 + ,14 + ,14 + ,11 + ,11 + ,46 + ,20 + ,20 + ,1 + ,14 + ,14 + ,15 + ,15 + ,9 + ,9 + ,46 + ,17 + ,17 + ,1 + ,16 + ,16 + ,12 + ,12 + ,14 + ,14 + ,33 + ,11 + ,11 + ,1 + ,16 + ,16 + ,19 + ,19 + ,7 + ,7 + ,53 + ,11 + ,11 + ,1 + ,12 + ,12 + ,15 + ,15 + ,11 + ,11 + ,44 + ,12 + ,12 + ,1 + ,12 + ,12 + ,16 + ,16 + ,9 + ,9 + ,53 + ,15 + ,15 + ,1 + ,12 + ,12 + ,17 + ,17 + ,8 + ,8 + ,44 + ,10 + ,10 + ,1 + ,11 + ,11 + ,11 + ,11 + ,14 + ,14 + ,35 + ,14 + ,14 + ,1 + ,4 + ,4 + ,15 + ,15 + ,12 + ,12 + ,40 + ,16 + ,16 + ,1 + ,16 + ,16 + ,11 + ,11 + ,12 + ,12 + ,44 + ,18 + ,18 + ,1 + ,15 + ,15 + ,15 + ,15 + ,6 + ,6 + ,46 + ,6 + ,6 + ,1 + ,10 + ,10 + ,17 + ,17 + ,16 + ,16 + ,45 + ,16 + ,16 + ,1 + ,13 + ,13 + ,14 + ,14 + ,8 + ,8 + ,53 + ,11 + ,11 + ,1 + ,12 + ,12 + ,14 + ,14 + ,12 + ,12 + ,48 + ,10 + ,10 + ,1 + ,7 + ,7 + ,16 + ,16 + ,12 + ,12 + ,55 + ,15 + ,15 + ,1 + ,19 + ,19 + ,16 + ,16 + ,9 + ,9 + ,47 + ,14 + ,14 + ,1 + ,12 + ,12 + ,14 + ,14 + ,11 + ,11 + ,43 + ,7 + ,7 + ,1 + ,12 + ,12 + ,13 + ,13 + ,13 + ,13 + ,47 + ,12 + ,12 + ,1 + ,10 + ,10 + ,13 + ,13 + ,11 + ,11 + ,47 + ,13 + ,13 + ,1 + ,16 + ,16 + ,12 + ,12 + ,12 + ,12 + ,44 + ,14 + ,14 + ,1 + ,13 + ,13 + ,11 + ,11 + ,10 + ,10 + ,42 + ,13 + ,13 + ,1 + ,16 + ,16 + ,13 + ,13 + ,13 + ,13 + ,51 + ,12 + ,12 + ,1 + ,9 + ,9 + ,15 + ,15 + ,9 + ,9 + ,54 + ,11 + ,11 + ,1 + ,12 + ,12 + ,13 + ,13 + ,8 + ,8 + ,51 + ,13 + ,13 + ,0 + ,13 + ,0 + ,15 + ,0 + ,9 + ,0 + ,42 + ,12 + ,0 + ,0 + ,10 + ,0 + ,12 + ,0 + ,14 + ,0 + ,41 + ,10 + ,0 + ,0 + ,12 + ,0 + ,17 + ,0 + ,14 + ,0 + ,49 + ,9 + ,0 + ,0 + ,11 + ,0 + ,10 + ,0 + ,14 + ,0 + ,42 + ,11 + ,0 + ,0 + ,7 + ,0 + ,18 + ,0 + ,14 + ,0 + ,41 + ,14 + ,0 + ,0 + ,11 + ,0 + ,14 + ,0 + ,8 + ,0 + ,41 + ,24 + ,0 + ,0 + ,14 + ,0 + ,16 + ,0 + ,11 + ,0 + ,43 + ,11 + ,0 + ,0 + ,6 + ,0 + ,13 + ,0 + ,13 + ,0 + ,33 + ,14 + ,0 + ,0 + ,15 + ,0 + ,14 + ,0 + ,9 + ,0 + ,42 + ,12 + ,0 + ,0 + ,12 + ,0 + ,9 + ,0 + ,16 + ,0 + ,37 + ,5 + ,0 + ,0 + ,15 + ,0 + ,13 + ,0 + ,14 + ,0 + ,42 + ,11 + ,0 + ,0 + ,9 + ,0 + ,15 + ,0 + ,12 + ,0 + ,43 + ,10 + ,0 + ,0 + ,13 + ,0 + ,16 + ,0 + ,4 + ,0 + ,33 + ,15 + ,0 + ,0 + ,12 + ,0 + ,16 + ,0 + ,13 + ,0 + ,44 + ,8 + ,0 + ,0 + ,11 + ,0 + ,17 + ,0 + ,14 + ,0 + ,52 + ,18 + ,0 + ,0 + ,16 + ,0 + ,13 + ,0 + ,10 + ,0 + ,45 + ,10 + ,0 + ,0 + ,10 + ,0 + ,12 + ,0 + ,8 + ,0 + ,36 + ,11 + ,0 + ,0 + ,14 + ,0 + ,12 + ,0 + ,9 + ,0 + ,43 + ,12 + ,0 + ,0 + ,8 + ,0 + ,8 + ,0 + ,15 + ,0 + ,32 + ,7 + ,0 + ,0 + ,16 + ,0 + ,14 + ,0 + ,9 + ,0 + ,45 + ,16 + ,0 + ,0 + ,9 + ,0 + ,13 + ,0 + ,8 + ,0 + ,45 + ,17 + ,0 + ,0 + ,6 + ,0 + ,10 + ,0 + ,11 + ,0 + ,49 + ,9 + ,0 + ,0 + ,12 + ,0 + ,11 + ,0 + ,9 + ,0 + ,44 + ,13 + ,0 + ,0 + ,8 + ,0 + ,12 + ,0 + ,12 + ,0 + ,41 + ,10 + ,0 + ,0 + ,14 + ,0 + ,14 + ,0 + ,13 + ,0 + ,44 + ,10 + ,0 + ,0 + ,8 + ,0 + ,11 + ,0 + ,9 + ,0 + ,37 + ,13 + ,0 + ,0 + ,7 + ,0 + ,15 + ,0 + ,7 + ,0 + ,40 + ,7 + ,0 + ,0 + ,16 + ,0 + ,13 + ,0 + ,10 + ,0 + ,50 + ,13 + ,0 + ,0 + ,11 + ,0 + ,15 + ,0 + ,11 + ,0 + ,47 + ,9 + ,0 + ,0 + ,13 + ,0 + ,13 + ,0 + ,8 + ,0 + ,33 + ,9 + ,0 + ,0 + ,5 + ,0 + ,10 + ,0 + ,14 + ,0 + ,33 + ,9 + ,0 + ,0 + ,11 + ,0 + ,15 + ,0 + ,16 + ,0 + ,45 + ,14 + ,0 + ,0 + ,11 + ,0 + ,16 + ,0 + ,11 + ,0 + ,43 + ,8 + ,0 + ,0 + ,7 + ,0 + ,16 + ,0 + ,9 + ,0 + ,0 + ,11 + ,0 + ,0 + ,13 + ,0 + ,15 + ,0 + ,12 + ,0 + ,46 + ,11 + ,0 + ,0 + ,12 + ,0 + ,14 + ,0 + ,20 + ,0 + ,36 + ,8 + ,0 + ,0 + ,9 + ,0 + ,11 + ,0 + ,11 + ,0 + ,42 + ,11 + ,0 + ,0 + ,10 + ,0 + ,9 + ,0 + ,10 + ,0 + ,41 + ,15 + ,0 + ,0 + ,12 + ,0 + ,15 + ,0 + ,7 + ,0 + ,46 + ,12 + ,0 + ,0 + ,8 + ,0 + ,17 + ,0 + ,8 + ,0 + ,48 + ,11 + ,0 + ,0 + ,11 + ,0 + ,15 + ,0 + ,14 + ,0 + ,45 + ,12 + ,0 + ,0 + ,14 + ,0 + ,14 + ,0 + ,16 + ,0 + ,11 + ,12 + ,0 + ,0 + ,4 + ,0 + ,11 + ,0 + ,12 + ,0 + ,33 + ,13 + ,0 + ,0 + ,15 + ,0 + ,15 + ,0 + ,8 + ,0 + ,47 + ,12 + ,0 + ,0 + ,14 + ,0 + ,13 + ,0 + ,11 + ,0 + ,42 + ,9 + ,0 + ,0 + ,14 + ,0 + ,17 + ,0 + ,10 + ,0 + ,55 + ,11 + ,0 + ,0 + ,8 + ,0 + ,9 + ,0 + ,14 + ,0 + ,40 + ,8 + ,0 + ,0 + ,16 + ,0 + ,15 + ,0 + ,10 + ,0 + ,46 + ,12 + ,0 + ,0 + ,15 + ,0 + ,12 + ,0 + ,13 + ,0 + ,45 + ,20 + ,0 + ,0 + ,14 + ,0 + ,15 + ,0 + ,11 + ,0 + ,46 + ,16 + ,0 + ,0 + ,12 + ,0 + ,11 + ,0 + ,16 + ,0 + ,38 + ,9 + ,0 + ,0 + ,8 + ,0 + ,14 + ,0 + ,10 + ,0 + ,40 + ,12 + ,0 + ,0 + ,8 + ,0 + ,14 + ,0 + ,11 + ,0 + ,42 + ,17 + ,0 + ,0 + ,10 + ,0 + ,16 + ,0 + ,9 + ,0 + ,53 + ,11 + ,0 + ,0 + ,14 + ,0 + ,16 + ,0 + ,11 + ,0 + ,43 + ,11 + ,0 + ,0 + ,14 + ,0 + ,13 + ,0 + ,14 + ,0 + ,41 + ,15 + ,0 + ,0 + ,14 + ,0 + ,16 + ,0 + ,14 + ,0 + ,51 + ,11 + ,0) + ,dim=c(10 + ,143) + ,dimnames=list(c('gender' + ,'popularity' + ,'popularity_g' + ,'hapiness' + ,'hapiness_g' + ,'doubsaboutactions' + ,'doubtsaboutactions_g' + ,'belonging' + ,'parentalexpectations' + ,'parentalexpectations_g') + ,1:143)) > y <- array(NA,dim=c(10,143),dimnames=list(c('gender','popularity','popularity_g','hapiness','hapiness_g','doubsaboutactions','doubtsaboutactions_g','belonging','parentalexpectations','parentalexpectations_g'),1:143)) > 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' > #'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 belonging gender popularity popularity_g hapiness hapiness_g 1 51 1 12 12 18 18 2 42 1 15 15 11 11 3 46 1 12 12 16 16 4 47 1 15 15 15 15 5 33 1 9 9 19 19 6 47 1 11 11 18 18 7 32 1 11 11 14 14 8 53 1 15 15 18 18 9 33 1 11 11 14 14 10 37 1 10 10 12 12 11 49 1 11 11 16 16 12 43 1 11 11 9 9 13 43 1 14 14 17 17 14 46 1 13 13 17 17 15 42 1 16 16 12 12 16 40 1 13 13 11 11 17 42 1 14 14 17 17 18 44 1 9 9 16 16 19 46 1 12 12 12 12 20 45 1 13 13 16 16 21 49 1 16 16 14 14 22 43 1 15 15 12 12 23 37 1 5 5 14 14 24 45 1 11 11 15 15 25 45 1 17 17 11 11 26 31 1 9 9 14 14 27 33 1 13 13 15 15 28 44 1 10 10 16 16 29 38 1 12 12 15 15 30 33 1 11 11 16 16 31 47 1 16 16 9 9 32 48 1 15 15 15 15 33 54 1 14 14 17 17 34 43 1 16 16 17 17 35 54 1 9 9 15 15 36 44 1 14 14 13 13 37 45 1 15 15 15 15 38 44 1 15 15 15 15 39 47 1 13 13 14 14 40 43 1 12 12 7 7 41 33 1 12 12 13 13 42 46 1 12 12 15 15 43 47 1 14 14 13 13 44 47 1 6 6 16 16 45 43 1 14 14 12 12 46 44 1 12 12 14 14 47 47 1 16 16 15 15 48 47 1 14 14 15 15 49 46 1 10 10 17 17 50 47 1 16 16 16 16 51 46 1 15 15 14 14 52 36 1 10 10 16 16 53 30 1 8 8 10 10 54 49 1 13 13 15 15 55 55 1 16 16 13 13 56 52 1 11 11 16 16 57 47 1 14 14 18 18 58 33 1 9 9 14 14 59 44 1 14 14 14 14 60 42 1 8 8 14 14 61 55 1 8 8 14 14 62 42 1 11 11 15 15 63 46 1 12 12 14 14 64 46 1 14 14 15 15 65 33 1 16 16 12 12 66 53 1 16 16 19 19 67 44 1 12 12 15 15 68 53 1 12 12 16 16 69 44 1 12 12 17 17 70 35 1 11 11 11 11 71 40 1 4 4 15 15 72 44 1 16 16 11 11 73 46 1 15 15 15 15 74 45 1 10 10 17 17 75 53 1 13 13 14 14 76 48 1 12 12 14 14 77 55 1 7 7 16 16 78 47 1 19 19 16 16 79 43 1 12 12 14 14 80 47 1 12 12 13 13 81 47 1 10 10 13 13 82 44 1 16 16 12 12 83 42 1 13 13 11 11 84 51 1 16 16 13 13 85 54 1 9 9 15 15 86 51 1 12 12 13 13 87 42 0 13 0 15 0 88 41 0 10 0 12 0 89 49 0 12 0 17 0 90 42 0 11 0 10 0 91 41 0 7 0 18 0 92 41 0 11 0 14 0 93 43 0 14 0 16 0 94 33 0 6 0 13 0 95 42 0 15 0 14 0 96 37 0 12 0 9 0 97 42 0 15 0 13 0 98 43 0 9 0 15 0 99 33 0 13 0 16 0 100 44 0 12 0 16 0 101 52 0 11 0 17 0 102 45 0 16 0 13 0 103 36 0 10 0 12 0 104 43 0 14 0 12 0 105 32 0 8 0 8 0 106 45 0 16 0 14 0 107 45 0 9 0 13 0 108 49 0 6 0 10 0 109 44 0 12 0 11 0 110 41 0 8 0 12 0 111 44 0 14 0 14 0 112 37 0 8 0 11 0 113 40 0 7 0 15 0 114 50 0 16 0 13 0 115 47 0 11 0 15 0 116 33 0 13 0 13 0 117 33 0 5 0 10 0 118 45 0 11 0 15 0 119 43 0 11 0 16 0 120 0 0 7 0 16 0 121 46 0 13 0 15 0 122 36 0 12 0 14 0 123 42 0 9 0 11 0 124 41 0 10 0 9 0 125 46 0 12 0 15 0 126 48 0 8 0 17 0 127 45 0 11 0 15 0 128 11 0 14 0 14 0 129 33 0 4 0 11 0 130 47 0 15 0 15 0 131 42 0 14 0 13 0 132 55 0 14 0 17 0 133 40 0 8 0 9 0 134 46 0 16 0 15 0 135 45 0 15 0 12 0 136 46 0 14 0 15 0 137 38 0 12 0 11 0 138 40 0 8 0 14 0 139 42 0 8 0 14 0 140 53 0 10 0 16 0 141 43 0 14 0 16 0 142 41 0 14 0 13 0 143 51 0 14 0 16 0 doubsaboutactions doubtsaboutactions_g parentalexpectations 1 9 9 15 2 9 9 14 3 8 8 10 4 15 15 18 5 11 11 11 6 8 8 12 7 9 9 15 8 6 6 17 9 11 11 7 10 16 16 18 11 7 7 18 12 15 15 11 13 10 10 12 14 6 6 11 15 12 12 16 16 14 14 14 17 9 9 13 18 14 14 17 19 14 14 13 20 8 8 12 21 10 10 12 22 9 9 9 23 11 11 18 24 9 9 14 25 10 10 12 26 8 8 12 27 14 14 9 28 10 10 12 29 14 14 11 30 15 15 13 31 11 11 13 32 8 8 6 33 10 10 21 34 10 10 11 35 9 9 9 36 13 13 18 37 10 10 15 38 11 11 11 39 10 10 14 40 16 16 12 41 6 6 8 42 11 11 11 43 14 14 17 44 9 9 16 45 11 11 13 46 12 12 13 47 9 9 13 48 14 14 15 49 8 8 12 50 10 10 12 51 8 8 15 52 11 11 21 53 14 14 24 54 10 10 15 55 9 9 17 56 8 8 16 57 8 8 15 58 16 16 11 59 13 13 15 60 13 13 12 61 8 8 14 62 9 9 12 63 11 11 20 64 9 9 17 65 14 14 11 66 7 7 11 67 11 11 12 68 9 9 15 69 8 8 10 70 14 14 14 71 12 12 16 72 12 12 18 73 6 6 6 74 16 16 16 75 8 8 11 76 12 12 10 77 12 12 15 78 9 9 14 79 11 11 7 80 13 13 12 81 11 11 13 82 12 12 14 83 10 10 13 84 13 13 12 85 9 9 11 86 8 8 13 87 9 0 12 88 14 0 10 89 14 0 9 90 14 0 11 91 14 0 14 92 8 0 24 93 11 0 11 94 13 0 14 95 9 0 12 96 16 0 5 97 14 0 11 98 12 0 10 99 4 0 15 100 13 0 8 101 14 0 18 102 10 0 10 103 8 0 11 104 9 0 12 105 15 0 7 106 9 0 16 107 8 0 17 108 11 0 9 109 9 0 13 110 12 0 10 111 13 0 10 112 9 0 13 113 7 0 7 114 10 0 13 115 11 0 9 116 8 0 9 117 14 0 9 118 16 0 14 119 11 0 8 120 9 0 11 121 12 0 11 122 20 0 8 123 11 0 11 124 10 0 15 125 7 0 12 126 8 0 11 127 14 0 12 128 16 0 12 129 12 0 13 130 8 0 12 131 11 0 9 132 10 0 11 133 14 0 8 134 10 0 12 135 13 0 20 136 11 0 16 137 16 0 9 138 10 0 12 139 11 0 17 140 9 0 11 141 11 0 11 142 14 0 15 143 14 0 11 parentalexpectations_g 1 15 2 14 3 10 4 18 5 11 6 12 7 15 8 17 9 7 10 18 11 18 12 11 13 12 14 11 15 16 16 14 17 13 18 17 19 13 20 12 21 12 22 9 23 18 24 14 25 12 26 12 27 9 28 12 29 11 30 13 31 13 32 6 33 21 34 11 35 9 36 18 37 15 38 11 39 14 40 12 41 8 42 11 43 17 44 16 45 13 46 13 47 13 48 15 49 12 50 12 51 15 52 21 53 24 54 15 55 17 56 16 57 15 58 11 59 15 60 12 61 14 62 12 63 20 64 17 65 11 66 11 67 12 68 15 69 10 70 14 71 16 72 18 73 6 74 16 75 11 76 10 77 15 78 14 79 7 80 12 81 13 82 14 83 13 84 12 85 11 86 13 87 0 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) gender popularity 27.1549 11.0419 0.7119 popularity_g hapiness hapiness_g -0.2623 0.4457 -0.1072 doubsaboutactions doubtsaboutactions_g parentalexpectations -0.1214 -0.6561 0.1232 parentalexpectations_g 0.1764 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -39.5311 -2.0011 0.3838 3.2887 13.3440 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 27.1549 8.1717 3.323 0.00115 ** gender 11.0419 12.4089 0.890 0.37516 popularity 0.7119 0.3070 2.319 0.02190 * popularity_g -0.2623 0.4088 -0.642 0.52228 hapiness 0.4457 0.4070 1.095 0.27555 hapiness_g -0.1072 0.5486 -0.195 0.84539 doubsaboutactions -0.1214 0.3287 -0.369 0.71241 doubtsaboutactions_g -0.6561 0.4677 -1.403 0.16304 parentalexpectations 0.1232 0.2868 0.429 0.66834 parentalexpectations_g 0.1764 0.3678 0.479 0.63240 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.842 on 133 degrees of freedom Multiple R-squared: 0.1901, Adjusted R-squared: 0.1353 F-statistic: 3.468 on 9 and 133 DF, p-value: 0.0007115 > 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,] 9.050054e-01 1.899893e-01 0.09499463 [2,] 8.263227e-01 3.473546e-01 0.17367730 [3,] 7.620001e-01 4.759997e-01 0.23799985 [4,] 6.552054e-01 6.895892e-01 0.34479459 [5,] 5.735103e-01 8.529795e-01 0.42648974 [6,] 4.911597e-01 9.823194e-01 0.50884032 [7,] 4.797081e-01 9.594162e-01 0.52029192 [8,] 3.845470e-01 7.690940e-01 0.61545302 [9,] 3.190843e-01 6.381685e-01 0.68091573 [10,] 2.413315e-01 4.826630e-01 0.75866852 [11,] 1.798576e-01 3.597152e-01 0.82014239 [12,] 1.340051e-01 2.680102e-01 0.86599490 [13,] 9.306789e-02 1.861358e-01 0.90693211 [14,] 1.252179e-01 2.504359e-01 0.87478206 [15,] 1.310978e-01 2.621957e-01 0.86890216 [16,] 1.095625e-01 2.191250e-01 0.89043752 [17,] 7.955894e-02 1.591179e-01 0.92044106 [18,] 8.073196e-02 1.614639e-01 0.91926804 [19,] 6.116148e-02 1.223230e-01 0.93883852 [20,] 5.698382e-02 1.139676e-01 0.94301618 [21,] 4.437603e-02 8.875206e-02 0.95562397 [22,] 3.466512e-02 6.933024e-02 0.96533488 [23,] 1.565422e-01 3.130845e-01 0.84345776 [24,] 1.205621e-01 2.411242e-01 0.87943791 [25,] 9.272410e-02 1.854482e-01 0.90727590 [26,] 6.907076e-02 1.381415e-01 0.93092924 [27,] 5.278372e-02 1.055674e-01 0.94721628 [28,] 5.082789e-02 1.016558e-01 0.94917211 [29,] 8.811495e-02 1.762299e-01 0.91188505 [30,] 7.552319e-02 1.510464e-01 0.92447681 [31,] 6.080234e-02 1.216047e-01 0.93919766 [32,] 5.676726e-02 1.135345e-01 0.94323274 [33,] 4.185869e-02 8.371737e-02 0.95814131 [34,] 3.109041e-02 6.218083e-02 0.96890959 [35,] 2.218197e-02 4.436394e-02 0.97781803 [36,] 1.738961e-02 3.477922e-02 0.98261039 [37,] 1.355127e-02 2.710253e-02 0.98644873 [38,] 9.364255e-03 1.872851e-02 0.99063574 [39,] 6.590942e-03 1.318188e-02 0.99340906 [40,] 1.153419e-02 2.306839e-02 0.98846581 [41,] 2.149643e-02 4.299287e-02 0.97850357 [42,] 1.730057e-02 3.460113e-02 0.98269943 [43,] 1.785875e-02 3.571751e-02 0.98214125 [44,] 1.729339e-02 3.458678e-02 0.98270661 [45,] 1.307991e-02 2.615983e-02 0.98692009 [46,] 1.047251e-02 2.094502e-02 0.98952749 [47,] 7.255556e-03 1.451111e-02 0.99274444 [48,] 5.978482e-03 1.195696e-02 0.99402152 [49,] 1.332870e-02 2.665740e-02 0.98667130 [50,] 1.040936e-02 2.081872e-02 0.98959064 [51,] 7.323779e-03 1.464756e-02 0.99267622 [52,] 5.344175e-03 1.068835e-02 0.99465583 [53,] 7.031118e-03 1.406224e-02 0.99296888 [54,] 5.299547e-03 1.059909e-02 0.99470045 [55,] 3.767359e-03 7.534718e-03 0.99623264 [56,] 3.610677e-03 7.221354e-03 0.99638932 [57,] 2.841942e-03 5.683885e-03 0.99715806 [58,] 2.438617e-03 4.877234e-03 0.99756138 [59,] 2.322364e-03 4.644728e-03 0.99767764 [60,] 1.577203e-03 3.154406e-03 0.99842280 [61,] 1.071591e-03 2.143181e-03 0.99892841 [62,] 9.347823e-04 1.869565e-03 0.99906522 [63,] 9.975795e-04 1.995159e-03 0.99900242 [64,] 8.982382e-04 1.796476e-03 0.99910176 [65,] 1.995678e-03 3.991356e-03 0.99800432 [66,] 1.604442e-03 3.208883e-03 0.99839556 [67,] 1.132680e-03 2.265359e-03 0.99886732 [68,] 9.068941e-04 1.813788e-03 0.99909311 [69,] 6.954841e-04 1.390968e-03 0.99930452 [70,] 4.412371e-04 8.824743e-04 0.99955876 [71,] 2.789960e-04 5.579921e-04 0.99972100 [72,] 2.509913e-04 5.019825e-04 0.99974901 [73,] 3.129160e-04 6.258320e-04 0.99968708 [74,] 2.302483e-04 4.604966e-04 0.99976975 [75,] 1.416266e-04 2.832531e-04 0.99985837 [76,] 8.616433e-05 1.723287e-04 0.99991384 [77,] 6.131248e-05 1.226250e-04 0.99993869 [78,] 3.720377e-05 7.440753e-05 0.99996280 [79,] 2.155874e-05 4.311748e-05 0.99997844 [80,] 1.265919e-05 2.531837e-05 0.99998734 [81,] 7.756781e-06 1.551356e-05 0.99999224 [82,] 4.767585e-06 9.535169e-06 0.99999523 [83,] 2.675252e-06 5.350504e-06 0.99999732 [84,] 1.619873e-06 3.239745e-06 0.99999838 [85,] 9.976274e-07 1.995255e-06 0.99999900 [86,] 5.849296e-07 1.169859e-06 0.99999942 [87,] 1.027873e-06 2.055746e-06 0.99999897 [88,] 5.515638e-07 1.103128e-06 0.99999945 [89,] 5.245982e-07 1.049196e-06 0.99999948 [90,] 2.790646e-07 5.581293e-07 0.99999972 [91,] 1.894044e-07 3.788087e-07 0.99999981 [92,] 1.051847e-07 2.103694e-07 0.99999989 [93,] 5.520179e-08 1.104036e-07 0.99999994 [94,] 2.690021e-08 5.380041e-08 0.99999997 [95,] 2.381823e-08 4.763645e-08 0.99999998 [96,] 1.721654e-07 3.443308e-07 0.99999983 [97,] 9.095699e-08 1.819140e-07 0.99999991 [98,] 4.783555e-08 9.567110e-08 0.99999995 [99,] 2.143889e-08 4.287779e-08 0.99999998 [100,] 9.547399e-09 1.909480e-08 0.99999999 [101,] 4.152819e-09 8.305639e-09 1.00000000 [102,] 2.486981e-09 4.973962e-09 1.00000000 [103,] 1.620822e-09 3.241645e-09 1.00000000 [104,] 2.864916e-09 5.729832e-09 1.00000000 [105,] 1.330508e-09 2.661015e-09 1.00000000 [106,] 1.018248e-09 2.036496e-09 1.00000000 [107,] 3.915242e-10 7.830485e-10 1.00000000 [108,] 2.579014e-02 5.158027e-02 0.97420986 [109,] 1.683669e-02 3.367338e-02 0.98316331 [110,] 1.482452e-02 2.964905e-02 0.98517548 [111,] 8.923879e-03 1.784776e-02 0.99107612 [112,] 4.906527e-03 9.813054e-03 0.99509347 [113,] 3.554808e-03 7.109616e-03 0.99644519 [114,] 2.321405e-03 4.642810e-03 0.99767859 [115,] 1.715309e-03 3.430618e-03 0.99828469 [116,] 6.491850e-01 7.016300e-01 0.35081498 [117,] 5.585690e-01 8.828621e-01 0.44143105 [118,] 3.912831e-01 7.825661e-01 0.60871693 > postscript(file="/var/www/html/rcomp/tmp/1w3yx1292320405.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/2w3yx1292320405.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/37cxi1292320405.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/47cxi1292320405.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/57cxi1292320405.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 = 143 Frequency = 1 1 2 3 4 5 6 3.81926229 -3.86080403 0.21633037 3.25205557 -10.41725913 0.38998526 7 8 9 10 11 12 -13.37716843 1.53886184 -8.42608865 -2.70678827 0.49237315 5.17814465 13 14 15 16 17 18 -3.06553032 -2.42626321 -2.91554216 -1.07413580 -5.14252107 2.13350649 19 20 21 22 23 24 5.33654851 -1.83235059 3.05061410 -1.70170239 -5.02287967 -0.41613232 25 26 27 28 29 30 -0.38359329 -13.35679726 -7.93047497 0.07154273 -3.07985954 -7.79025001 31 32 33 34 35 36 3.22097343 2.40393158 5.23882225 -3.66531033 10.98074598 -0.17628443 37 38 39 40 41 42 -1.73676712 -0.76122723 1.80052592 5.88341498 -12.72414479 2.58771736 43 44 45 46 47 48 3.90070632 2.89459563 -0.89517099 1.10463923 -0.36485692 3.82277854 49 50 51 52 53 54 0.17811373 0.37365356 -1.95323559 -9.84663033 -11.48257836 3.16252927 55 56 57 58 59 60 7.11403809 4.86888028 -1.85750847 -4.83748594 0.38378445 1.98022277 61 62 63 64 65 66 10.49381817 -2.81709956 0.23055020 -1.66362606 -8.86301151 3.32530603 67 68 69 70 71 72 0.28820098 6.49622283 -2.12214990 -5.17483941 -0.53520461 -1.17609465 73 74 75 76 77 78 -1.15101716 4.19984314 7.14412633 6.00318838 13.07688691 -2.35179816 79 80 81 82 83 84 1.12426316 5.52011025 4.56494153 -0.31650939 -1.88451689 7.72151747 85 86 87 88 89 90 10.38171321 5.33322204 -1.48015262 1.84601057 6.31701005 2.90223626 91 92 93 94 95 96 0.81519895 -2.20998698 -1.27175647 -4.36598311 -2.45835647 -1.38223762 97 98 99 100 101 102 -1.28247039 2.97813733 -11.90236286 1.76441908 8.92048316 0.64310851 103 104 105 106 107 108 -4.00562856 0.14489494 -3.45658755 -0.66293660 4.52167100 13.34398098 109 110 111 112 113 114 2.89125628 3.02704852 0.98555087 -1.26101645 1.16442299 5.27362227 115 116 117 118 119 120 5.55602293 -9.34075965 -1.57984868 3.54727674 1.23352522 -39.53105943 121 122 123 124 125 126 3.00724798 -4.49437145 3.51620157 2.08152819 2.98895351 7.18993612 127 128 129 130 131 132 3.55077522 -31.89653476 -2.04905065 1.97457090 -0.68845294 10.16117089 133 134 135 136 137 138 3.85317774 0.50546477 0.93331785 1.55809293 -1.76620551 0.64657910 139 140 141 142 143 2.15218154 11.33314511 -1.27175647 -2.06318689 7.09248205 > postscript(file="/var/www/html/rcomp/tmp/6z3w31292320405.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 = 143 Frequency = 1 lag(myerror, k = 1) myerror 0 3.81926229 NA 1 -3.86080403 3.81926229 2 0.21633037 -3.86080403 3 3.25205557 0.21633037 4 -10.41725913 3.25205557 5 0.38998526 -10.41725913 6 -13.37716843 0.38998526 7 1.53886184 -13.37716843 8 -8.42608865 1.53886184 9 -2.70678827 -8.42608865 10 0.49237315 -2.70678827 11 5.17814465 0.49237315 12 -3.06553032 5.17814465 13 -2.42626321 -3.06553032 14 -2.91554216 -2.42626321 15 -1.07413580 -2.91554216 16 -5.14252107 -1.07413580 17 2.13350649 -5.14252107 18 5.33654851 2.13350649 19 -1.83235059 5.33654851 20 3.05061410 -1.83235059 21 -1.70170239 3.05061410 22 -5.02287967 -1.70170239 23 -0.41613232 -5.02287967 24 -0.38359329 -0.41613232 25 -13.35679726 -0.38359329 26 -7.93047497 -13.35679726 27 0.07154273 -7.93047497 28 -3.07985954 0.07154273 29 -7.79025001 -3.07985954 30 3.22097343 -7.79025001 31 2.40393158 3.22097343 32 5.23882225 2.40393158 33 -3.66531033 5.23882225 34 10.98074598 -3.66531033 35 -0.17628443 10.98074598 36 -1.73676712 -0.17628443 37 -0.76122723 -1.73676712 38 1.80052592 -0.76122723 39 5.88341498 1.80052592 40 -12.72414479 5.88341498 41 2.58771736 -12.72414479 42 3.90070632 2.58771736 43 2.89459563 3.90070632 44 -0.89517099 2.89459563 45 1.10463923 -0.89517099 46 -0.36485692 1.10463923 47 3.82277854 -0.36485692 48 0.17811373 3.82277854 49 0.37365356 0.17811373 50 -1.95323559 0.37365356 51 -9.84663033 -1.95323559 52 -11.48257836 -9.84663033 53 3.16252927 -11.48257836 54 7.11403809 3.16252927 55 4.86888028 7.11403809 56 -1.85750847 4.86888028 57 -4.83748594 -1.85750847 58 0.38378445 -4.83748594 59 1.98022277 0.38378445 60 10.49381817 1.98022277 61 -2.81709956 10.49381817 62 0.23055020 -2.81709956 63 -1.66362606 0.23055020 64 -8.86301151 -1.66362606 65 3.32530603 -8.86301151 66 0.28820098 3.32530603 67 6.49622283 0.28820098 68 -2.12214990 6.49622283 69 -5.17483941 -2.12214990 70 -0.53520461 -5.17483941 71 -1.17609465 -0.53520461 72 -1.15101716 -1.17609465 73 4.19984314 -1.15101716 74 7.14412633 4.19984314 75 6.00318838 7.14412633 76 13.07688691 6.00318838 77 -2.35179816 13.07688691 78 1.12426316 -2.35179816 79 5.52011025 1.12426316 80 4.56494153 5.52011025 81 -0.31650939 4.56494153 82 -1.88451689 -0.31650939 83 7.72151747 -1.88451689 84 10.38171321 7.72151747 85 5.33322204 10.38171321 86 -1.48015262 5.33322204 87 1.84601057 -1.48015262 88 6.31701005 1.84601057 89 2.90223626 6.31701005 90 0.81519895 2.90223626 91 -2.20998698 0.81519895 92 -1.27175647 -2.20998698 93 -4.36598311 -1.27175647 94 -2.45835647 -4.36598311 95 -1.38223762 -2.45835647 96 -1.28247039 -1.38223762 97 2.97813733 -1.28247039 98 -11.90236286 2.97813733 99 1.76441908 -11.90236286 100 8.92048316 1.76441908 101 0.64310851 8.92048316 102 -4.00562856 0.64310851 103 0.14489494 -4.00562856 104 -3.45658755 0.14489494 105 -0.66293660 -3.45658755 106 4.52167100 -0.66293660 107 13.34398098 4.52167100 108 2.89125628 13.34398098 109 3.02704852 2.89125628 110 0.98555087 3.02704852 111 -1.26101645 0.98555087 112 1.16442299 -1.26101645 113 5.27362227 1.16442299 114 5.55602293 5.27362227 115 -9.34075965 5.55602293 116 -1.57984868 -9.34075965 117 3.54727674 -1.57984868 118 1.23352522 3.54727674 119 -39.53105943 1.23352522 120 3.00724798 -39.53105943 121 -4.49437145 3.00724798 122 3.51620157 -4.49437145 123 2.08152819 3.51620157 124 2.98895351 2.08152819 125 7.18993612 2.98895351 126 3.55077522 7.18993612 127 -31.89653476 3.55077522 128 -2.04905065 -31.89653476 129 1.97457090 -2.04905065 130 -0.68845294 1.97457090 131 10.16117089 -0.68845294 132 3.85317774 10.16117089 133 0.50546477 3.85317774 134 0.93331785 0.50546477 135 1.55809293 0.93331785 136 -1.76620551 1.55809293 137 0.64657910 -1.76620551 138 2.15218154 0.64657910 139 11.33314511 2.15218154 140 -1.27175647 11.33314511 141 -2.06318689 -1.27175647 142 7.09248205 -2.06318689 143 NA 7.09248205 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.86080403 3.81926229 [2,] 0.21633037 -3.86080403 [3,] 3.25205557 0.21633037 [4,] -10.41725913 3.25205557 [5,] 0.38998526 -10.41725913 [6,] -13.37716843 0.38998526 [7,] 1.53886184 -13.37716843 [8,] -8.42608865 1.53886184 [9,] -2.70678827 -8.42608865 [10,] 0.49237315 -2.70678827 [11,] 5.17814465 0.49237315 [12,] -3.06553032 5.17814465 [13,] -2.42626321 -3.06553032 [14,] -2.91554216 -2.42626321 [15,] -1.07413580 -2.91554216 [16,] -5.14252107 -1.07413580 [17,] 2.13350649 -5.14252107 [18,] 5.33654851 2.13350649 [19,] -1.83235059 5.33654851 [20,] 3.05061410 -1.83235059 [21,] -1.70170239 3.05061410 [22,] -5.02287967 -1.70170239 [23,] -0.41613232 -5.02287967 [24,] -0.38359329 -0.41613232 [25,] -13.35679726 -0.38359329 [26,] -7.93047497 -13.35679726 [27,] 0.07154273 -7.93047497 [28,] -3.07985954 0.07154273 [29,] -7.79025001 -3.07985954 [30,] 3.22097343 -7.79025001 [31,] 2.40393158 3.22097343 [32,] 5.23882225 2.40393158 [33,] -3.66531033 5.23882225 [34,] 10.98074598 -3.66531033 [35,] -0.17628443 10.98074598 [36,] -1.73676712 -0.17628443 [37,] -0.76122723 -1.73676712 [38,] 1.80052592 -0.76122723 [39,] 5.88341498 1.80052592 [40,] -12.72414479 5.88341498 [41,] 2.58771736 -12.72414479 [42,] 3.90070632 2.58771736 [43,] 2.89459563 3.90070632 [44,] -0.89517099 2.89459563 [45,] 1.10463923 -0.89517099 [46,] -0.36485692 1.10463923 [47,] 3.82277854 -0.36485692 [48,] 0.17811373 3.82277854 [49,] 0.37365356 0.17811373 [50,] -1.95323559 0.37365356 [51,] -9.84663033 -1.95323559 [52,] -11.48257836 -9.84663033 [53,] 3.16252927 -11.48257836 [54,] 7.11403809 3.16252927 [55,] 4.86888028 7.11403809 [56,] -1.85750847 4.86888028 [57,] -4.83748594 -1.85750847 [58,] 0.38378445 -4.83748594 [59,] 1.98022277 0.38378445 [60,] 10.49381817 1.98022277 [61,] -2.81709956 10.49381817 [62,] 0.23055020 -2.81709956 [63,] -1.66362606 0.23055020 [64,] -8.86301151 -1.66362606 [65,] 3.32530603 -8.86301151 [66,] 0.28820098 3.32530603 [67,] 6.49622283 0.28820098 [68,] -2.12214990 6.49622283 [69,] -5.17483941 -2.12214990 [70,] -0.53520461 -5.17483941 [71,] -1.17609465 -0.53520461 [72,] -1.15101716 -1.17609465 [73,] 4.19984314 -1.15101716 [74,] 7.14412633 4.19984314 [75,] 6.00318838 7.14412633 [76,] 13.07688691 6.00318838 [77,] -2.35179816 13.07688691 [78,] 1.12426316 -2.35179816 [79,] 5.52011025 1.12426316 [80,] 4.56494153 5.52011025 [81,] -0.31650939 4.56494153 [82,] -1.88451689 -0.31650939 [83,] 7.72151747 -1.88451689 [84,] 10.38171321 7.72151747 [85,] 5.33322204 10.38171321 [86,] -1.48015262 5.33322204 [87,] 1.84601057 -1.48015262 [88,] 6.31701005 1.84601057 [89,] 2.90223626 6.31701005 [90,] 0.81519895 2.90223626 [91,] -2.20998698 0.81519895 [92,] -1.27175647 -2.20998698 [93,] -4.36598311 -1.27175647 [94,] -2.45835647 -4.36598311 [95,] -1.38223762 -2.45835647 [96,] -1.28247039 -1.38223762 [97,] 2.97813733 -1.28247039 [98,] -11.90236286 2.97813733 [99,] 1.76441908 -11.90236286 [100,] 8.92048316 1.76441908 [101,] 0.64310851 8.92048316 [102,] -4.00562856 0.64310851 [103,] 0.14489494 -4.00562856 [104,] -3.45658755 0.14489494 [105,] -0.66293660 -3.45658755 [106,] 4.52167100 -0.66293660 [107,] 13.34398098 4.52167100 [108,] 2.89125628 13.34398098 [109,] 3.02704852 2.89125628 [110,] 0.98555087 3.02704852 [111,] -1.26101645 0.98555087 [112,] 1.16442299 -1.26101645 [113,] 5.27362227 1.16442299 [114,] 5.55602293 5.27362227 [115,] -9.34075965 5.55602293 [116,] -1.57984868 -9.34075965 [117,] 3.54727674 -1.57984868 [118,] 1.23352522 3.54727674 [119,] -39.53105943 1.23352522 [120,] 3.00724798 -39.53105943 [121,] -4.49437145 3.00724798 [122,] 3.51620157 -4.49437145 [123,] 2.08152819 3.51620157 [124,] 2.98895351 2.08152819 [125,] 7.18993612 2.98895351 [126,] 3.55077522 7.18993612 [127,] -31.89653476 3.55077522 [128,] -2.04905065 -31.89653476 [129,] 1.97457090 -2.04905065 [130,] -0.68845294 1.97457090 [131,] 10.16117089 -0.68845294 [132,] 3.85317774 10.16117089 [133,] 0.50546477 3.85317774 [134,] 0.93331785 0.50546477 [135,] 1.55809293 0.93331785 [136,] -1.76620551 1.55809293 [137,] 0.64657910 -1.76620551 [138,] 2.15218154 0.64657910 [139,] 11.33314511 2.15218154 [140,] -1.27175647 11.33314511 [141,] -2.06318689 -1.27175647 [142,] 7.09248205 -2.06318689 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.86080403 3.81926229 2 0.21633037 -3.86080403 3 3.25205557 0.21633037 4 -10.41725913 3.25205557 5 0.38998526 -10.41725913 6 -13.37716843 0.38998526 7 1.53886184 -13.37716843 8 -8.42608865 1.53886184 9 -2.70678827 -8.42608865 10 0.49237315 -2.70678827 11 5.17814465 0.49237315 12 -3.06553032 5.17814465 13 -2.42626321 -3.06553032 14 -2.91554216 -2.42626321 15 -1.07413580 -2.91554216 16 -5.14252107 -1.07413580 17 2.13350649 -5.14252107 18 5.33654851 2.13350649 19 -1.83235059 5.33654851 20 3.05061410 -1.83235059 21 -1.70170239 3.05061410 22 -5.02287967 -1.70170239 23 -0.41613232 -5.02287967 24 -0.38359329 -0.41613232 25 -13.35679726 -0.38359329 26 -7.93047497 -13.35679726 27 0.07154273 -7.93047497 28 -3.07985954 0.07154273 29 -7.79025001 -3.07985954 30 3.22097343 -7.79025001 31 2.40393158 3.22097343 32 5.23882225 2.40393158 33 -3.66531033 5.23882225 34 10.98074598 -3.66531033 35 -0.17628443 10.98074598 36 -1.73676712 -0.17628443 37 -0.76122723 -1.73676712 38 1.80052592 -0.76122723 39 5.88341498 1.80052592 40 -12.72414479 5.88341498 41 2.58771736 -12.72414479 42 3.90070632 2.58771736 43 2.89459563 3.90070632 44 -0.89517099 2.89459563 45 1.10463923 -0.89517099 46 -0.36485692 1.10463923 47 3.82277854 -0.36485692 48 0.17811373 3.82277854 49 0.37365356 0.17811373 50 -1.95323559 0.37365356 51 -9.84663033 -1.95323559 52 -11.48257836 -9.84663033 53 3.16252927 -11.48257836 54 7.11403809 3.16252927 55 4.86888028 7.11403809 56 -1.85750847 4.86888028 57 -4.83748594 -1.85750847 58 0.38378445 -4.83748594 59 1.98022277 0.38378445 60 10.49381817 1.98022277 61 -2.81709956 10.49381817 62 0.23055020 -2.81709956 63 -1.66362606 0.23055020 64 -8.86301151 -1.66362606 65 3.32530603 -8.86301151 66 0.28820098 3.32530603 67 6.49622283 0.28820098 68 -2.12214990 6.49622283 69 -5.17483941 -2.12214990 70 -0.53520461 -5.17483941 71 -1.17609465 -0.53520461 72 -1.15101716 -1.17609465 73 4.19984314 -1.15101716 74 7.14412633 4.19984314 75 6.00318838 7.14412633 76 13.07688691 6.00318838 77 -2.35179816 13.07688691 78 1.12426316 -2.35179816 79 5.52011025 1.12426316 80 4.56494153 5.52011025 81 -0.31650939 4.56494153 82 -1.88451689 -0.31650939 83 7.72151747 -1.88451689 84 10.38171321 7.72151747 85 5.33322204 10.38171321 86 -1.48015262 5.33322204 87 1.84601057 -1.48015262 88 6.31701005 1.84601057 89 2.90223626 6.31701005 90 0.81519895 2.90223626 91 -2.20998698 0.81519895 92 -1.27175647 -2.20998698 93 -4.36598311 -1.27175647 94 -2.45835647 -4.36598311 95 -1.38223762 -2.45835647 96 -1.28247039 -1.38223762 97 2.97813733 -1.28247039 98 -11.90236286 2.97813733 99 1.76441908 -11.90236286 100 8.92048316 1.76441908 101 0.64310851 8.92048316 102 -4.00562856 0.64310851 103 0.14489494 -4.00562856 104 -3.45658755 0.14489494 105 -0.66293660 -3.45658755 106 4.52167100 -0.66293660 107 13.34398098 4.52167100 108 2.89125628 13.34398098 109 3.02704852 2.89125628 110 0.98555087 3.02704852 111 -1.26101645 0.98555087 112 1.16442299 -1.26101645 113 5.27362227 1.16442299 114 5.55602293 5.27362227 115 -9.34075965 5.55602293 116 -1.57984868 -9.34075965 117 3.54727674 -1.57984868 118 1.23352522 3.54727674 119 -39.53105943 1.23352522 120 3.00724798 -39.53105943 121 -4.49437145 3.00724798 122 3.51620157 -4.49437145 123 2.08152819 3.51620157 124 2.98895351 2.08152819 125 7.18993612 2.98895351 126 3.55077522 7.18993612 127 -31.89653476 3.55077522 128 -2.04905065 -31.89653476 129 1.97457090 -2.04905065 130 -0.68845294 1.97457090 131 10.16117089 -0.68845294 132 3.85317774 10.16117089 133 0.50546477 3.85317774 134 0.93331785 0.50546477 135 1.55809293 0.93331785 136 -1.76620551 1.55809293 137 0.64657910 -1.76620551 138 2.15218154 0.64657910 139 11.33314511 2.15218154 140 -1.27175647 11.33314511 141 -2.06318689 -1.27175647 142 7.09248205 -2.06318689 > 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/7z3w31292320405.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/8sceo1292320405.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/9sceo1292320405.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/10k4vq1292320405.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/116mte1292320405.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/12zvth1292320405.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/135xqt1292320405.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/14yo7w1292320405.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/152oo21292320405.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/16yg3t1292320405.tab") + } > > try(system("convert tmp/1w3yx1292320405.ps tmp/1w3yx1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/2w3yx1292320405.ps tmp/2w3yx1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/37cxi1292320405.ps tmp/37cxi1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/47cxi1292320405.ps tmp/47cxi1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/57cxi1292320405.ps tmp/57cxi1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/6z3w31292320405.ps tmp/6z3w31292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/7z3w31292320405.ps tmp/7z3w31292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/8sceo1292320405.ps tmp/8sceo1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/9sceo1292320405.ps tmp/9sceo1292320405.png",intern=TRUE)) character(0) > try(system("convert tmp/10k4vq1292320405.ps tmp/10k4vq1292320405.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.171 1.869 10.023