R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(14 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,11 + ,12 + ,18 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,12 + ,11 + ,11 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,15 + ,14 + ,12 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,10 + ,12 + ,16 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,12 + ,21 + ,18 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,11 + ,12 + ,14 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,5 + ,22 + ,14 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,16 + ,11 + ,15 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,11 + ,10 + ,15 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,15 + ,13 + ,17 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,12 + ,10 + ,19 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,9 + ,8 + ,10 + ,24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,11 + ,15 + ,18 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,15 + ,10 + ,14 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,12 + ,14 + ,14 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,16 + ,14 + ,17 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,14 + ,11 + ,14 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,11 + ,10 + ,16 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,10 + ,13 + ,18 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,7 + ,7 + ,14 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,11 + ,12 + ,12 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,10 + ,14 + ,17 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,11 + ,11 + ,9 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,16 + ,9 + ,16 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,14 + ,11 + ,14 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,12 + ,15 + ,11 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,12 + ,13 + ,16 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,11 + ,9 + ,13 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,6 + ,15 + ,17 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,14 + ,10 + ,15 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,9 + ,11 + ,14 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,15 + ,13 + ,16 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,12 + ,8 + ,9 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,12 + ,20 + ,15 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,9 + ,12 + ,17 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,13 + ,10 + ,13 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,15 + ,10 + ,15 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,11 + ,9 + ,16 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,10 + ,14 + ,16 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,13 + ,8 + ,12 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,16 + ,11 + ,11 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,13 + ,13 + ,15 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,14 + ,11 + ,17 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,14 + ,15 + ,13 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,16 + ,11 + ,16 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,9 + ,10 + ,14 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,8 + ,14 + ,11 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,8 + ,18 + ,12 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,12 + ,14 + ,12 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,10 + ,11 + ,15 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,16 + ,12 + ,16 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,13 + ,13 + ,15 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,11 + ,9 + ,12 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,14 + ,10 + ,12 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,15 + ,15 + ,8 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,8 + ,20 + ,13 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,9 + ,12 + ,11 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,17 + ,12 + ,14 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,9 + ,14 + ,15 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,13 + ,13 + ,10 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,6 + ,11 + ,11 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,13 + ,17 + ,12 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,8 + ,12 + ,15 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,12 + ,13 + ,15 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,13 + ,14 + ,14 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,14 + ,13 + ,16 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,11 + ,15 + ,15 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,15 + ,13 + ,15 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,7 + ,10 + ,13 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,16 + ,11 + ,17 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,16 + ,13 + ,13 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,14 + ,17 + ,15 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,11 + ,13 + ,13 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,13 + ,9 + ,15 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,13 + ,11 + ,16 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,7 + ,10 + ,15 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,15 + ,9 + ,16 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,11 + ,12 + ,15 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,15 + ,12 + ,14 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,13 + ,13 + ,15 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,11 + ,13 + ,7 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,12 + ,22 + ,17 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,10 + ,13 + ,13 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,12 + ,15 + ,15 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,12 + ,13 + ,14 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,12 + ,15 + ,13 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,14 + ,10 + ,16 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,6 + ,11 + ,12 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,14 + ,16 + ,14 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,15 + ,11 + ,17 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,8 + ,11 + ,15 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,12 + ,10 + ,17 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,10 + ,10 + ,12 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,15 + ,16 + ,16 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,11 + ,12 + ,11 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,9 + ,11 + ,15 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,14 + ,16 + ,9 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,10 + ,19 + ,16 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,16 + ,11 + ,10 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,5 + ,15 + ,10 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,8 + ,24 + ,15 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,13 + ,14 + ,11 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,16 + ,15 + ,13 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,16 + ,11 + ,14 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,14 + ,15 + ,18 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,14 + ,12 + ,16 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,10 + ,10 + ,14 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,9 + ,14 + ,14 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,14 + ,13 + ,14 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,8 + ,9 + ,14 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,8 + ,15 + ,12 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,16 + ,15 + ,14 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,12 + ,14 + ,15 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,9 + ,11 + ,15 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,15 + ,8 + ,13 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,12 + ,11 + ,17 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,14 + ,8 + ,17 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,12 + ,10 + ,19 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,16 + ,11 + ,15 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,12 + ,13 + ,13 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,14 + ,11 + ,9 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,8 + ,20 + ,15 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,15 + ,10 + ,15 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,16 + ,12 + ,16 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,12 + ,14 + ,11 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,4 + ,23 + ,14 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,8 + ,14 + ,11 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,11 + ,16 + ,15 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,4 + ,11 + ,13 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,14 + ,12 + ,16 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,14 + ,14 + ,14 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,13 + ,12 + ,15 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,14 + ,12 + ,16 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,7 + ,11 + ,16 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,19 + ,12 + ,11 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,12 + ,13 + ,13 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,10 + ,17 + ,16 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,14 + ,9 + ,12 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,16 + ,12 + ,9 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,11 + ,19 + ,13 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,16 + ,18 + ,13 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,12 + ,15 + ,14 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,12 + ,14 + ,19 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,16 + ,11 + ,13 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,12 + ,9) + ,dim=c(9 + ,145) + ,dimnames=list(c('Happines' + ,'Concern_over_Mistakes' + ,'Doubts_about_actions' + ,'Parental_Expectations' + ,'Parental_Criticism' + ,'Personal_Standards' + ,'Organization' + ,'Popularity' + ,'Depression') + ,1:145)) > y <- array(NA,dim=c(9,145),dimnames=list(c('Happines','Concern_over_Mistakes','Doubts_about_actions','Parental_Expectations','Parental_Criticism','Personal_Standards','Organization','Popularity','Depression'),1:145)) > 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 = '1' > #'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 > 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 Happines Concern_over_Mistakes Doubts_about_actions Parental_Expectations 1 14 26 9 15 2 18 20 9 15 3 11 21 9 14 4 12 31 14 10 5 16 21 8 10 6 18 18 8 12 7 14 26 11 18 8 14 22 10 12 9 15 22 9 14 10 15 29 15 18 11 17 15 14 9 12 19 16 11 11 13 10 24 14 11 14 18 17 6 17 15 14 19 20 8 16 14 22 9 16 17 17 31 10 21 18 14 28 8 24 19 16 38 11 21 20 18 26 14 14 21 14 25 11 7 22 12 25 16 18 23 17 29 14 18 24 9 28 11 13 25 16 15 11 11 26 14 18 12 13 27 11 21 9 13 28 16 25 7 18 29 13 23 13 14 30 17 23 10 12 31 15 19 9 9 32 14 18 9 12 33 16 18 13 8 34 9 26 16 5 35 15 18 12 10 36 17 18 6 11 37 13 28 14 11 38 15 17 14 12 39 16 29 10 12 40 16 12 4 15 41 12 28 12 16 42 11 20 14 14 43 15 17 9 17 44 17 17 9 13 45 13 20 10 10 46 16 31 14 17 47 14 21 10 12 48 11 19 9 13 49 12 23 14 13 50 12 15 8 11 51 15 24 9 13 52 16 28 8 12 53 15 16 9 12 54 12 19 9 12 55 12 21 9 9 56 8 21 15 7 57 13 20 8 17 58 11 16 10 12 59 14 25 8 12 60 15 30 14 9 61 10 29 11 9 62 11 22 10 13 63 12 19 12 10 64 15 33 14 11 65 15 17 9 12 66 14 9 13 10 67 16 14 15 13 68 15 15 8 6 69 15 12 7 7 70 13 21 10 13 71 17 20 10 11 72 13 29 13 18 73 15 33 11 9 74 13 21 8 9 75 15 15 12 11 76 16 19 9 11 77 15 23 10 15 78 16 20 11 8 79 15 20 11 11 80 14 18 10 14 81 15 31 16 14 82 7 18 16 12 83 17 13 8 12 84 13 9 6 8 85 15 20 11 11 86 14 18 12 10 87 13 23 14 17 88 16 17 9 16 89 12 17 11 13 90 14 16 8 15 91 17 31 8 11 92 15 15 7 12 93 17 28 16 16 94 12 26 13 20 95 16 20 8 16 96 11 19 11 11 97 15 25 14 15 98 9 18 10 15 99 16 20 10 12 100 10 33 14 9 101 10 24 14 24 102 15 22 10 15 103 11 32 12 18 104 13 31 9 17 105 14 13 16 12 106 18 18 8 15 107 16 17 9 11 108 14 29 16 11 109 14 22 13 15 110 14 18 13 12 111 14 22 8 14 112 12 25 14 11 113 14 20 11 20 114 15 20 9 11 115 15 17 8 12 116 13 26 13 12 117 17 10 10 11 118 17 15 8 10 119 19 20 7 11 120 15 14 11 12 121 13 16 11 9 122 9 23 14 8 123 15 11 6 6 124 15 19 10 12 125 16 30 9 15 126 11 21 12 13 127 14 20 11 17 128 11 22 14 14 129 15 30 12 16 130 13 25 14 15 131 16 23 14 11 132 14 23 8 11 133 15 21 11 16 134 16 30 12 15 135 16 22 9 14 136 11 32 16 9 137 13 22 11 13 138 16 15 11 11 139 12 21 12 14 140 9 27 15 11 141 13 22 13 12 142 13 9 6 8 143 14 29 11 7 144 19 20 7 11 145 13 16 8 13 Parental_Criticism Personal_Standards Organization Popularity Depression 1 6 25 25 11 12 2 6 25 24 12 11 3 13 19 21 15 14 4 8 18 23 10 12 5 7 18 17 12 21 6 9 22 19 11 12 7 5 29 18 5 22 8 8 26 27 16 11 9 9 25 23 11 10 10 11 23 23 15 13 11 8 23 29 12 10 12 11 23 21 9 8 13 12 24 26 11 15 14 8 30 25 15 10 15 7 19 25 12 14 16 9 24 23 16 14 17 12 32 26 14 11 18 20 30 20 11 10 19 7 29 29 10 13 20 8 17 24 7 7 21 8 25 23 11 12 22 16 26 24 10 14 23 10 26 30 11 11 24 6 25 22 16 9 25 8 23 22 14 11 26 9 21 13 12 15 27 9 19 24 12 13 28 11 35 17 11 9 29 12 19 24 6 15 30 8 20 21 14 10 31 7 21 23 9 11 32 8 21 24 15 13 33 9 24 24 12 8 34 4 23 24 12 20 35 8 19 23 9 12 36 8 17 26 13 10 37 8 24 24 15 10 38 6 15 21 11 9 39 8 25 23 10 14 40 4 27 28 13 8 41 14 27 22 16 11 42 10 18 24 13 13 43 9 25 21 14 11 44 6 22 23 14 15 45 8 26 23 16 11 46 11 23 20 9 10 47 8 16 23 8 14 48 8 27 21 8 18 49 10 25 27 12 14 50 8 14 12 10 11 51 10 19 15 16 12 52 7 20 22 13 13 53 8 16 21 11 9 54 7 18 21 14 10 55 9 22 20 15 15 56 5 21 24 8 20 57 7 22 24 9 12 58 7 22 29 17 12 59 7 32 25 9 14 60 9 23 14 13 13 61 5 31 30 6 11 62 8 18 19 13 17 63 8 23 29 8 12 64 8 26 25 12 13 65 9 24 25 13 14 66 6 19 25 14 13 67 8 14 16 11 15 68 6 20 25 15 13 69 4 22 28 7 10 70 6 24 24 16 11 71 4 25 25 16 13 72 12 21 21 14 17 73 6 28 22 11 13 74 11 24 20 13 9 75 8 20 25 13 11 76 10 21 27 7 10 77 10 23 21 15 9 78 4 13 13 11 12 79 8 24 26 15 12 80 9 21 26 13 13 81 9 21 25 11 13 82 7 17 22 12 22 83 7 14 19 10 13 84 11 29 23 12 15 85 8 25 25 12 13 86 8 16 15 12 15 87 7 25 21 14 10 88 5 25 23 6 11 89 7 21 25 14 16 90 9 23 24 15 11 91 8 22 24 8 11 92 6 19 21 12 10 93 8 24 24 10 10 94 10 26 22 15 16 95 10 25 24 11 12 96 8 20 28 9 11 97 11 22 21 14 16 98 8 14 17 10 19 99 8 20 28 16 11 100 6 32 24 5 15 101 20 21 10 8 24 102 6 22 20 13 14 103 12 28 22 16 15 104 9 25 19 16 11 105 5 17 22 14 15 106 10 21 22 14 12 107 5 23 26 10 10 108 6 27 24 9 14 109 10 22 22 14 13 110 6 19 20 8 9 111 10 20 20 8 15 112 5 17 15 16 15 113 13 24 20 12 14 114 7 21 20 9 11 115 9 21 24 15 8 116 8 24 29 12 11 117 5 19 23 14 8 118 4 22 24 12 10 119 9 26 22 16 11 120 7 17 16 12 13 121 5 17 23 14 11 122 5 19 27 8 20 123 4 15 16 15 10 124 7 17 21 16 12 125 9 27 26 12 14 126 8 19 22 4 23 127 8 21 23 8 14 128 11 25 19 11 16 129 10 19 18 4 11 130 9 22 24 14 12 131 10 20 29 14 14 132 10 15 22 13 12 133 7 20 24 14 12 134 10 29 22 7 11 135 6 19 12 19 12 136 6 29 26 12 13 137 11 24 18 10 17 138 8 23 22 14 9 139 9 22 24 16 12 140 9 23 21 11 19 141 13 22 15 16 18 142 11 29 23 12 15 143 4 26 22 12 14 144 9 26 22 16 11 145 5 21 24 12 9 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Concern_over_Mistakes Doubts_about_actions 21.734743 -0.018001 -0.147557 Parental_Expectations Parental_Criticism Personal_Standards 0.099226 -0.080226 0.008969 Organization Popularity Depression -0.057369 -0.028245 -0.376606 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.5369 -1.2957 0.1202 1.2892 4.4545 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 21.734743 1.877910 11.574 < 2e-16 *** Concern_over_Mistakes -0.018001 0.037028 -0.486 0.6276 Doubts_about_actions -0.147557 0.071178 -2.073 0.0401 * Parental_Expectations 0.099226 0.060301 1.646 0.1022 Parental_Criticism -0.080226 0.076655 -1.047 0.2971 Personal_Standards 0.008969 0.049532 0.181 0.8566 Organization -0.057369 0.050067 -1.146 0.2539 Popularity -0.028245 0.056806 -0.497 0.6198 Depression -0.376606 0.057887 -6.506 1.37e-09 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.969 on 136 degrees of freedom Multiple R-squared: 0.351, Adjusted R-squared: 0.3129 F-statistic: 9.195 on 8 and 136 DF, p-value: 4.57e-10 > 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.1391683 0.27833657 0.86083171 [2,] 0.1641987 0.32839744 0.83580128 [3,] 0.1033451 0.20669015 0.89665493 [4,] 0.4730510 0.94610193 0.52694904 [5,] 0.3779140 0.75582809 0.62208596 [6,] 0.6744528 0.65109442 0.32554721 [7,] 0.5868321 0.82633575 0.41316788 [8,] 0.7443704 0.51125915 0.25562957 [9,] 0.6826097 0.63478067 0.31739034 [10,] 0.6005810 0.79883796 0.39941898 [11,] 0.5188995 0.96220096 0.48110048 [12,] 0.5863179 0.82736416 0.41368208 [13,] 0.9300279 0.13994423 0.06997211 [14,] 0.9048652 0.19026959 0.09513479 [15,] 0.8717288 0.25654247 0.12827124 [16,] 0.9607281 0.07854381 0.03927191 [17,] 0.9441820 0.11163603 0.05581801 [18,] 0.9382782 0.12344361 0.06172181 [19,] 0.9439159 0.11216820 0.05608410 [20,] 0.9276462 0.14470764 0.07235382 [21,] 0.9059943 0.18801139 0.09400570 [22,] 0.8813613 0.23727731 0.11863865 [23,] 0.8552126 0.28957483 0.14478742 [24,] 0.8257140 0.34857207 0.17428604 [25,] 0.7954126 0.40917485 0.20458743 [26,] 0.7571090 0.48578208 0.24289104 [27,] 0.7598937 0.48021269 0.24010634 [28,] 0.7902654 0.41946921 0.20973461 [29,] 0.8522047 0.29559052 0.14779526 [30,] 0.8407825 0.31843491 0.15921745 [31,] 0.8685078 0.26298435 0.13149218 [32,] 0.8413140 0.31737191 0.15868595 [33,] 0.8756396 0.24872073 0.12436037 [34,] 0.8584887 0.28302256 0.14151128 [35,] 0.8355376 0.32892486 0.16446243 [36,] 0.8091500 0.38170002 0.19085001 [37,] 0.8485406 0.30291872 0.15145936 [38,] 0.8243609 0.35127821 0.17563911 [39,] 0.8970460 0.20590807 0.10295404 [40,] 0.8887760 0.22244795 0.11122398 [41,] 0.8860057 0.22798856 0.11399428 [42,] 0.8674906 0.26501881 0.13250940 [43,] 0.9136938 0.17261236 0.08630618 [44,] 0.8989971 0.20200573 0.10100286 [45,] 0.9265088 0.14698233 0.07349117 [46,] 0.9393811 0.12123775 0.06061888 [47,] 0.9568493 0.08630134 0.04315067 [48,] 0.9455913 0.10881733 0.05440867 [49,] 0.9404504 0.11909915 0.05954958 [50,] 0.9786657 0.04266860 0.02133430 [51,] 0.9775963 0.04480733 0.02240367 [52,] 0.9762052 0.04758953 0.02379477 [53,] 0.9754177 0.04916467 0.02458234 [54,] 0.9713552 0.05728957 0.02864478 [55,] 0.9623469 0.07530622 0.03765311 [56,] 0.9709096 0.05818080 0.02909040 [57,] 0.9664486 0.06710289 0.03355144 [58,] 0.9563446 0.08731077 0.04365538 [59,] 0.9563532 0.08729364 0.04364682 [60,] 0.9684654 0.06306914 0.03153457 [61,] 0.9590885 0.08182296 0.04091148 [62,] 0.9525748 0.09485048 0.04742524 [63,] 0.9666793 0.06664139 0.03332070 [64,] 0.9568381 0.08632388 0.04316194 [65,] 0.9471719 0.10565612 0.05282806 [66,] 0.9375536 0.12489272 0.06244636 [67,] 0.9274978 0.14500432 0.07250216 [68,] 0.9129332 0.17413367 0.08706684 [69,] 0.8910905 0.21781906 0.10890953 [70,] 0.8874368 0.22512642 0.11256321 [71,] 0.9094063 0.18118736 0.09059368 [72,] 0.9159942 0.16801151 0.08400575 [73,] 0.9033509 0.19329819 0.09664909 [74,] 0.8874039 0.22519220 0.11259610 [75,] 0.8660730 0.26785392 0.13392696 [76,] 0.8729610 0.25407798 0.12703899 [77,] 0.8495789 0.30084227 0.15042113 [78,] 0.8218535 0.35629309 0.17814654 [79,] 0.8107495 0.37850100 0.18925050 [80,] 0.8172391 0.36552175 0.18276087 [81,] 0.7887776 0.42244477 0.21122239 [82,] 0.8259613 0.34807736 0.17403868 [83,] 0.8036787 0.39264262 0.19632131 [84,] 0.7697933 0.46041349 0.23020675 [85,] 0.8495451 0.30090986 0.15045493 [86,] 0.8726298 0.25474031 0.12737016 [87,] 0.9220293 0.15594149 0.07797075 [88,] 0.9081726 0.18365486 0.09182743 [89,] 0.9160470 0.16790598 0.08395299 [90,] 0.8919707 0.21605869 0.10802934 [91,] 0.8677784 0.26444314 0.13222157 [92,] 0.8900106 0.21997872 0.10998936 [93,] 0.9314889 0.13702221 0.06851111 [94,] 0.9465898 0.10682031 0.05341016 [95,] 0.9570837 0.08583254 0.04291627 [96,] 0.9429424 0.11411518 0.05705759 [97,] 0.9447002 0.11059967 0.05529984 [98,] 0.9247903 0.15041934 0.07520967 [99,] 0.9045159 0.19096829 0.09548415 [100,] 0.8773641 0.24527182 0.12263591 [101,] 0.8431261 0.31374784 0.15687392 [102,] 0.8080611 0.38387774 0.19193887 [103,] 0.7578643 0.48427138 0.24213569 [104,] 0.7578844 0.48423130 0.24211565 [105,] 0.7203211 0.55935785 0.27967892 [106,] 0.7163171 0.56736587 0.28368294 [107,] 0.7176003 0.56479948 0.28239974 [108,] 0.7681034 0.46379322 0.23189661 [109,] 0.7782044 0.44359111 0.22179555 [110,] 0.7187491 0.56250189 0.28125094 [111,] 0.6519458 0.69610850 0.34805425 [112,] 0.5741083 0.85178333 0.42589167 [113,] 0.4951772 0.99035436 0.50482282 [114,] 0.4209434 0.84188683 0.57905659 [115,] 0.4259981 0.85199610 0.57400195 [116,] 0.4128635 0.82572702 0.58713649 [117,] 0.3311045 0.66220901 0.66889549 [118,] 0.2548457 0.50969147 0.74515427 [119,] 0.1940105 0.38802107 0.80598946 [120,] 0.5041538 0.99169241 0.49584620 [121,] 0.4771543 0.95430863 0.52284569 [122,] 0.8545100 0.29097994 0.14548997 > postscript(file="/var/www/rcomp/tmp/1z1oo1290533022.ps",horizontal=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/rcomp/tmp/2z1oo1290533022.ps",horizontal=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/rcomp/tmp/3z1oo1290533022.ps",horizontal=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/rcomp/tmp/49tnr1290533022.ps",horizontal=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/rcomp/tmp/59tnr1290533022.ps",horizontal=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 = 145 Frequency = 1 1 2 3 4 5 6 -0.90577072 2.58049092 -2.64444485 -1.50159999 4.45454696 3.02370968 7 8 9 10 11 12 2.17057024 -0.50170360 -0.50582210 1.52980810 2.91225057 3.23291140 13 14 15 16 17 18 -2.12957750 1.76646970 2.20141854 -0.04765966 1.92050747 -1.87209751 19 20 21 22 23 24 1.63219065 2.11006420 0.21086322 -0.72766742 2.81051140 -6.53690242 25 26 27 28 29 30 1.30264178 0.33752756 -3.15535489 -0.79388944 0.19606892 1.79280228 31 32 33 34 35 36 0.13184344 -0.12356231 0.94912595 -1.03940715 0.93205470 1.49730010 37 38 39 40 41 42 -1.26326166 -0.30192720 2.36414868 -1.35178956 -2.30994427 -2.41735999 43 44 45 46 47 48 -0.54690537 3.25738779 -1.56872967 1.04608905 0.24436632 -1.74539030 49 50 51 52 53 54 -0.80644328 -3.74597659 0.19892885 1.66641139 -0.90622916 -3.48904840 55 56 57 58 59 60 -1.17688696 -2.49023855 -2.36651432 -3.13447514 -0.05948412 1.56002702 61 62 63 64 65 66 -4.32631983 -1.81323080 -1.76985050 1.91125970 1.28924092 0.38971359 67 68 69 70 71 72 2.83460885 1.17611901 -0.48672458 -1.93355153 2.88805896 0.69629808 73 74 75 76 77 78 1.28830181 -2.49805258 0.62096636 0.97044888 -0.71969145 1.23466353 79 80 81 82 83 84 1.01800577 -0.03598370 1.96951668 -2.94503778 2.19336173 -0.55130519 85 86 87 88 89 90 1.24353984 0.71456114 -2.23817058 0.12019803 -0.86696122 -1.29572284 91 92 93 94 95 96 2.10223308 -1.00185121 2.39449813 -1.05244543 1.00297208 -3.39545679 97 98 99 100 101 102 2.60372705 -3.49407416 1.57347465 -2.60642227 -0.36398856 0.71954281 103 104 105 106 107 108 -2.09938834 -2.35313361 1.22475369 3.07206649 0.54274514 1.19944989 109 110 111 112 113 114 0.24949237 -1.60946011 0.09787814 -1.10020877 -0.14963558 -0.22071364 115 116 117 118 119 120 -1.09192271 -0.96733153 0.78782764 1.32890635 3.91223125 0.51150986 121 122 123 124 125 126 -1.61040079 -1.51097449 -0.95274407 0.47717753 2.22779946 0.63245042 127 128 129 130 131 132 -0.16705219 -1.57742901 -0.09150589 -0.89104038 3.60807934 -0.41545460 133 134 135 136 137 138 0.35254388 1.23224226 0.65542461 -1.74316515 0.37908791 0.54943056 139 140 141 142 143 144 -2.10244405 -1.94014666 1.32578330 -0.55130519 0.67708440 3.91223125 145 -3.23818147 > postscript(file="/var/www/rcomp/tmp/62k4u1290533022.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 145 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.90577072 NA 1 2.58049092 -0.90577072 2 -2.64444485 2.58049092 3 -1.50159999 -2.64444485 4 4.45454696 -1.50159999 5 3.02370968 4.45454696 6 2.17057024 3.02370968 7 -0.50170360 2.17057024 8 -0.50582210 -0.50170360 9 1.52980810 -0.50582210 10 2.91225057 1.52980810 11 3.23291140 2.91225057 12 -2.12957750 3.23291140 13 1.76646970 -2.12957750 14 2.20141854 1.76646970 15 -0.04765966 2.20141854 16 1.92050747 -0.04765966 17 -1.87209751 1.92050747 18 1.63219065 -1.87209751 19 2.11006420 1.63219065 20 0.21086322 2.11006420 21 -0.72766742 0.21086322 22 2.81051140 -0.72766742 23 -6.53690242 2.81051140 24 1.30264178 -6.53690242 25 0.33752756 1.30264178 26 -3.15535489 0.33752756 27 -0.79388944 -3.15535489 28 0.19606892 -0.79388944 29 1.79280228 0.19606892 30 0.13184344 1.79280228 31 -0.12356231 0.13184344 32 0.94912595 -0.12356231 33 -1.03940715 0.94912595 34 0.93205470 -1.03940715 35 1.49730010 0.93205470 36 -1.26326166 1.49730010 37 -0.30192720 -1.26326166 38 2.36414868 -0.30192720 39 -1.35178956 2.36414868 40 -2.30994427 -1.35178956 41 -2.41735999 -2.30994427 42 -0.54690537 -2.41735999 43 3.25738779 -0.54690537 44 -1.56872967 3.25738779 45 1.04608905 -1.56872967 46 0.24436632 1.04608905 47 -1.74539030 0.24436632 48 -0.80644328 -1.74539030 49 -3.74597659 -0.80644328 50 0.19892885 -3.74597659 51 1.66641139 0.19892885 52 -0.90622916 1.66641139 53 -3.48904840 -0.90622916 54 -1.17688696 -3.48904840 55 -2.49023855 -1.17688696 56 -2.36651432 -2.49023855 57 -3.13447514 -2.36651432 58 -0.05948412 -3.13447514 59 1.56002702 -0.05948412 60 -4.32631983 1.56002702 61 -1.81323080 -4.32631983 62 -1.76985050 -1.81323080 63 1.91125970 -1.76985050 64 1.28924092 1.91125970 65 0.38971359 1.28924092 66 2.83460885 0.38971359 67 1.17611901 2.83460885 68 -0.48672458 1.17611901 69 -1.93355153 -0.48672458 70 2.88805896 -1.93355153 71 0.69629808 2.88805896 72 1.28830181 0.69629808 73 -2.49805258 1.28830181 74 0.62096636 -2.49805258 75 0.97044888 0.62096636 76 -0.71969145 0.97044888 77 1.23466353 -0.71969145 78 1.01800577 1.23466353 79 -0.03598370 1.01800577 80 1.96951668 -0.03598370 81 -2.94503778 1.96951668 82 2.19336173 -2.94503778 83 -0.55130519 2.19336173 84 1.24353984 -0.55130519 85 0.71456114 1.24353984 86 -2.23817058 0.71456114 87 0.12019803 -2.23817058 88 -0.86696122 0.12019803 89 -1.29572284 -0.86696122 90 2.10223308 -1.29572284 91 -1.00185121 2.10223308 92 2.39449813 -1.00185121 93 -1.05244543 2.39449813 94 1.00297208 -1.05244543 95 -3.39545679 1.00297208 96 2.60372705 -3.39545679 97 -3.49407416 2.60372705 98 1.57347465 -3.49407416 99 -2.60642227 1.57347465 100 -0.36398856 -2.60642227 101 0.71954281 -0.36398856 102 -2.09938834 0.71954281 103 -2.35313361 -2.09938834 104 1.22475369 -2.35313361 105 3.07206649 1.22475369 106 0.54274514 3.07206649 107 1.19944989 0.54274514 108 0.24949237 1.19944989 109 -1.60946011 0.24949237 110 0.09787814 -1.60946011 111 -1.10020877 0.09787814 112 -0.14963558 -1.10020877 113 -0.22071364 -0.14963558 114 -1.09192271 -0.22071364 115 -0.96733153 -1.09192271 116 0.78782764 -0.96733153 117 1.32890635 0.78782764 118 3.91223125 1.32890635 119 0.51150986 3.91223125 120 -1.61040079 0.51150986 121 -1.51097449 -1.61040079 122 -0.95274407 -1.51097449 123 0.47717753 -0.95274407 124 2.22779946 0.47717753 125 0.63245042 2.22779946 126 -0.16705219 0.63245042 127 -1.57742901 -0.16705219 128 -0.09150589 -1.57742901 129 -0.89104038 -0.09150589 130 3.60807934 -0.89104038 131 -0.41545460 3.60807934 132 0.35254388 -0.41545460 133 1.23224226 0.35254388 134 0.65542461 1.23224226 135 -1.74316515 0.65542461 136 0.37908791 -1.74316515 137 0.54943056 0.37908791 138 -2.10244405 0.54943056 139 -1.94014666 -2.10244405 140 1.32578330 -1.94014666 141 -0.55130519 1.32578330 142 0.67708440 -0.55130519 143 3.91223125 0.67708440 144 -3.23818147 3.91223125 145 NA -3.23818147 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.58049092 -0.90577072 [2,] -2.64444485 2.58049092 [3,] -1.50159999 -2.64444485 [4,] 4.45454696 -1.50159999 [5,] 3.02370968 4.45454696 [6,] 2.17057024 3.02370968 [7,] -0.50170360 2.17057024 [8,] -0.50582210 -0.50170360 [9,] 1.52980810 -0.50582210 [10,] 2.91225057 1.52980810 [11,] 3.23291140 2.91225057 [12,] -2.12957750 3.23291140 [13,] 1.76646970 -2.12957750 [14,] 2.20141854 1.76646970 [15,] -0.04765966 2.20141854 [16,] 1.92050747 -0.04765966 [17,] -1.87209751 1.92050747 [18,] 1.63219065 -1.87209751 [19,] 2.11006420 1.63219065 [20,] 0.21086322 2.11006420 [21,] -0.72766742 0.21086322 [22,] 2.81051140 -0.72766742 [23,] -6.53690242 2.81051140 [24,] 1.30264178 -6.53690242 [25,] 0.33752756 1.30264178 [26,] -3.15535489 0.33752756 [27,] -0.79388944 -3.15535489 [28,] 0.19606892 -0.79388944 [29,] 1.79280228 0.19606892 [30,] 0.13184344 1.79280228 [31,] -0.12356231 0.13184344 [32,] 0.94912595 -0.12356231 [33,] -1.03940715 0.94912595 [34,] 0.93205470 -1.03940715 [35,] 1.49730010 0.93205470 [36,] -1.26326166 1.49730010 [37,] -0.30192720 -1.26326166 [38,] 2.36414868 -0.30192720 [39,] -1.35178956 2.36414868 [40,] -2.30994427 -1.35178956 [41,] -2.41735999 -2.30994427 [42,] -0.54690537 -2.41735999 [43,] 3.25738779 -0.54690537 [44,] -1.56872967 3.25738779 [45,] 1.04608905 -1.56872967 [46,] 0.24436632 1.04608905 [47,] -1.74539030 0.24436632 [48,] -0.80644328 -1.74539030 [49,] -3.74597659 -0.80644328 [50,] 0.19892885 -3.74597659 [51,] 1.66641139 0.19892885 [52,] -0.90622916 1.66641139 [53,] -3.48904840 -0.90622916 [54,] -1.17688696 -3.48904840 [55,] -2.49023855 -1.17688696 [56,] -2.36651432 -2.49023855 [57,] -3.13447514 -2.36651432 [58,] -0.05948412 -3.13447514 [59,] 1.56002702 -0.05948412 [60,] -4.32631983 1.56002702 [61,] -1.81323080 -4.32631983 [62,] -1.76985050 -1.81323080 [63,] 1.91125970 -1.76985050 [64,] 1.28924092 1.91125970 [65,] 0.38971359 1.28924092 [66,] 2.83460885 0.38971359 [67,] 1.17611901 2.83460885 [68,] -0.48672458 1.17611901 [69,] -1.93355153 -0.48672458 [70,] 2.88805896 -1.93355153 [71,] 0.69629808 2.88805896 [72,] 1.28830181 0.69629808 [73,] -2.49805258 1.28830181 [74,] 0.62096636 -2.49805258 [75,] 0.97044888 0.62096636 [76,] -0.71969145 0.97044888 [77,] 1.23466353 -0.71969145 [78,] 1.01800577 1.23466353 [79,] -0.03598370 1.01800577 [80,] 1.96951668 -0.03598370 [81,] -2.94503778 1.96951668 [82,] 2.19336173 -2.94503778 [83,] -0.55130519 2.19336173 [84,] 1.24353984 -0.55130519 [85,] 0.71456114 1.24353984 [86,] -2.23817058 0.71456114 [87,] 0.12019803 -2.23817058 [88,] -0.86696122 0.12019803 [89,] -1.29572284 -0.86696122 [90,] 2.10223308 -1.29572284 [91,] -1.00185121 2.10223308 [92,] 2.39449813 -1.00185121 [93,] -1.05244543 2.39449813 [94,] 1.00297208 -1.05244543 [95,] -3.39545679 1.00297208 [96,] 2.60372705 -3.39545679 [97,] -3.49407416 2.60372705 [98,] 1.57347465 -3.49407416 [99,] -2.60642227 1.57347465 [100,] -0.36398856 -2.60642227 [101,] 0.71954281 -0.36398856 [102,] -2.09938834 0.71954281 [103,] -2.35313361 -2.09938834 [104,] 1.22475369 -2.35313361 [105,] 3.07206649 1.22475369 [106,] 0.54274514 3.07206649 [107,] 1.19944989 0.54274514 [108,] 0.24949237 1.19944989 [109,] -1.60946011 0.24949237 [110,] 0.09787814 -1.60946011 [111,] -1.10020877 0.09787814 [112,] -0.14963558 -1.10020877 [113,] -0.22071364 -0.14963558 [114,] -1.09192271 -0.22071364 [115,] -0.96733153 -1.09192271 [116,] 0.78782764 -0.96733153 [117,] 1.32890635 0.78782764 [118,] 3.91223125 1.32890635 [119,] 0.51150986 3.91223125 [120,] -1.61040079 0.51150986 [121,] -1.51097449 -1.61040079 [122,] -0.95274407 -1.51097449 [123,] 0.47717753 -0.95274407 [124,] 2.22779946 0.47717753 [125,] 0.63245042 2.22779946 [126,] -0.16705219 0.63245042 [127,] -1.57742901 -0.16705219 [128,] -0.09150589 -1.57742901 [129,] -0.89104038 -0.09150589 [130,] 3.60807934 -0.89104038 [131,] -0.41545460 3.60807934 [132,] 0.35254388 -0.41545460 [133,] 1.23224226 0.35254388 [134,] 0.65542461 1.23224226 [135,] -1.74316515 0.65542461 [136,] 0.37908791 -1.74316515 [137,] 0.54943056 0.37908791 [138,] -2.10244405 0.54943056 [139,] -1.94014666 -2.10244405 [140,] 1.32578330 -1.94014666 [141,] -0.55130519 1.32578330 [142,] 0.67708440 -0.55130519 [143,] 3.91223125 0.67708440 [144,] -3.23818147 3.91223125 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.58049092 -0.90577072 2 -2.64444485 2.58049092 3 -1.50159999 -2.64444485 4 4.45454696 -1.50159999 5 3.02370968 4.45454696 6 2.17057024 3.02370968 7 -0.50170360 2.17057024 8 -0.50582210 -0.50170360 9 1.52980810 -0.50582210 10 2.91225057 1.52980810 11 3.23291140 2.91225057 12 -2.12957750 3.23291140 13 1.76646970 -2.12957750 14 2.20141854 1.76646970 15 -0.04765966 2.20141854 16 1.92050747 -0.04765966 17 -1.87209751 1.92050747 18 1.63219065 -1.87209751 19 2.11006420 1.63219065 20 0.21086322 2.11006420 21 -0.72766742 0.21086322 22 2.81051140 -0.72766742 23 -6.53690242 2.81051140 24 1.30264178 -6.53690242 25 0.33752756 1.30264178 26 -3.15535489 0.33752756 27 -0.79388944 -3.15535489 28 0.19606892 -0.79388944 29 1.79280228 0.19606892 30 0.13184344 1.79280228 31 -0.12356231 0.13184344 32 0.94912595 -0.12356231 33 -1.03940715 0.94912595 34 0.93205470 -1.03940715 35 1.49730010 0.93205470 36 -1.26326166 1.49730010 37 -0.30192720 -1.26326166 38 2.36414868 -0.30192720 39 -1.35178956 2.36414868 40 -2.30994427 -1.35178956 41 -2.41735999 -2.30994427 42 -0.54690537 -2.41735999 43 3.25738779 -0.54690537 44 -1.56872967 3.25738779 45 1.04608905 -1.56872967 46 0.24436632 1.04608905 47 -1.74539030 0.24436632 48 -0.80644328 -1.74539030 49 -3.74597659 -0.80644328 50 0.19892885 -3.74597659 51 1.66641139 0.19892885 52 -0.90622916 1.66641139 53 -3.48904840 -0.90622916 54 -1.17688696 -3.48904840 55 -2.49023855 -1.17688696 56 -2.36651432 -2.49023855 57 -3.13447514 -2.36651432 58 -0.05948412 -3.13447514 59 1.56002702 -0.05948412 60 -4.32631983 1.56002702 61 -1.81323080 -4.32631983 62 -1.76985050 -1.81323080 63 1.91125970 -1.76985050 64 1.28924092 1.91125970 65 0.38971359 1.28924092 66 2.83460885 0.38971359 67 1.17611901 2.83460885 68 -0.48672458 1.17611901 69 -1.93355153 -0.48672458 70 2.88805896 -1.93355153 71 0.69629808 2.88805896 72 1.28830181 0.69629808 73 -2.49805258 1.28830181 74 0.62096636 -2.49805258 75 0.97044888 0.62096636 76 -0.71969145 0.97044888 77 1.23466353 -0.71969145 78 1.01800577 1.23466353 79 -0.03598370 1.01800577 80 1.96951668 -0.03598370 81 -2.94503778 1.96951668 82 2.19336173 -2.94503778 83 -0.55130519 2.19336173 84 1.24353984 -0.55130519 85 0.71456114 1.24353984 86 -2.23817058 0.71456114 87 0.12019803 -2.23817058 88 -0.86696122 0.12019803 89 -1.29572284 -0.86696122 90 2.10223308 -1.29572284 91 -1.00185121 2.10223308 92 2.39449813 -1.00185121 93 -1.05244543 2.39449813 94 1.00297208 -1.05244543 95 -3.39545679 1.00297208 96 2.60372705 -3.39545679 97 -3.49407416 2.60372705 98 1.57347465 -3.49407416 99 -2.60642227 1.57347465 100 -0.36398856 -2.60642227 101 0.71954281 -0.36398856 102 -2.09938834 0.71954281 103 -2.35313361 -2.09938834 104 1.22475369 -2.35313361 105 3.07206649 1.22475369 106 0.54274514 3.07206649 107 1.19944989 0.54274514 108 0.24949237 1.19944989 109 -1.60946011 0.24949237 110 0.09787814 -1.60946011 111 -1.10020877 0.09787814 112 -0.14963558 -1.10020877 113 -0.22071364 -0.14963558 114 -1.09192271 -0.22071364 115 -0.96733153 -1.09192271 116 0.78782764 -0.96733153 117 1.32890635 0.78782764 118 3.91223125 1.32890635 119 0.51150986 3.91223125 120 -1.61040079 0.51150986 121 -1.51097449 -1.61040079 122 -0.95274407 -1.51097449 123 0.47717753 -0.95274407 124 2.22779946 0.47717753 125 0.63245042 2.22779946 126 -0.16705219 0.63245042 127 -1.57742901 -0.16705219 128 -0.09150589 -1.57742901 129 -0.89104038 -0.09150589 130 3.60807934 -0.89104038 131 -0.41545460 3.60807934 132 0.35254388 -0.41545460 133 1.23224226 0.35254388 134 0.65542461 1.23224226 135 -1.74316515 0.65542461 136 0.37908791 -1.74316515 137 0.54943056 0.37908791 138 -2.10244405 0.54943056 139 -1.94014666 -2.10244405 140 1.32578330 -1.94014666 141 -0.55130519 1.32578330 142 0.67708440 -0.55130519 143 3.91223125 0.67708440 144 -3.23818147 3.91223125 > 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/rcomp/tmp/7db4x1290533022.ps",horizontal=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/rcomp/tmp/8db4x1290533022.ps",horizontal=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/rcomp/tmp/9db4x1290533022.ps",horizontal=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/rcomp/tmp/10n2301290533022.ps",horizontal=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/111u1r1290533022.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/rcomp/tmp/12cl0u1290533022.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/rcomp/tmp/131nfo1290533022.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/rcomp/tmp/14mndt1290533022.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/rcomp/tmp/15ifbk1290533022.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/rcomp/tmp/164xsq1290533022.tab") + } > > try(system("convert tmp/1z1oo1290533022.ps tmp/1z1oo1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/2z1oo1290533022.ps tmp/2z1oo1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/3z1oo1290533022.ps tmp/3z1oo1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/49tnr1290533022.ps tmp/49tnr1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/59tnr1290533022.ps tmp/59tnr1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/62k4u1290533022.ps tmp/62k4u1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/7db4x1290533022.ps tmp/7db4x1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/8db4x1290533022.ps tmp/8db4x1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/9db4x1290533022.ps tmp/9db4x1290533022.png",intern=TRUE)) character(0) > try(system("convert tmp/10n2301290533022.ps tmp/10n2301290533022.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.680 2.010 7.672