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(1 + ,41 + ,25 + ,25 + ,15 + ,15 + ,9 + ,9 + ,3 + ,3 + ,1 + ,38 + ,25 + ,25 + ,15 + ,15 + ,9 + ,9 + ,4 + ,4 + ,1 + ,37 + ,19 + ,19 + ,14 + ,14 + ,9 + ,9 + ,4 + ,4 + ,0 + ,36 + ,18 + ,36 + ,10 + ,20 + ,14 + ,28 + ,2 + ,4 + ,1 + ,42 + ,18 + ,18 + ,10 + ,10 + ,8 + ,8 + ,4 + ,4 + ,0 + ,44 + ,23 + ,46 + ,9 + ,18 + ,14 + ,28 + ,4 + ,8 + ,1 + ,40 + ,23 + ,23 + ,18 + ,18 + ,15 + ,15 + ,3 + ,3 + ,1 + ,43 + ,25 + ,25 + ,14 + ,14 + ,9 + ,9 + ,4 + ,4 + ,1 + ,40 + ,23 + ,23 + ,11 + ,11 + ,11 + ,11 + ,4 + ,4 + ,0 + ,45 + ,24 + ,48 + ,11 + ,22 + ,14 + ,28 + ,4 + ,8 + ,0 + ,47 + ,32 + ,64 + ,9 + ,18 + ,14 + ,28 + ,4 + ,8 + ,1 + ,45 + ,30 + ,30 + ,17 + ,17 + ,6 + ,6 + ,5 + ,5 + ,1 + ,45 + ,32 + ,32 + ,21 + ,21 + ,10 + ,10 + ,4 + ,4 + ,0 + ,40 + ,24 + ,48 + ,16 + ,32 + ,9 + ,18 + ,4 + ,8 + ,0 + ,49 + ,17 + ,34 + ,14 + ,28 + ,14 + ,28 + ,4 + ,8 + ,0 + ,48 + ,30 + ,60 + ,24 + ,48 + ,8 + ,16 + ,5 + ,10 + ,1 + ,44 + ,25 + ,25 + ,7 + ,7 + ,11 + ,11 + ,4 + ,4 + ,0 + ,29 + ,25 + ,50 + ,9 + ,18 + ,10 + ,20 + ,4 + ,8 + ,1 + ,42 + ,26 + ,26 + ,18 + ,18 + ,16 + ,16 + ,4 + ,4 + ,0 + ,45 + ,23 + ,46 + ,11 + ,22 + ,11 + ,22 + ,5 + ,10 + ,1 + ,32 + ,25 + ,25 + ,13 + ,13 + ,11 + ,11 + ,5 + ,5 + ,1 + ,32 + ,25 + ,25 + ,13 + ,13 + ,11 + ,11 + ,5 + ,5 + ,1 + ,41 + ,35 + ,35 + ,18 + ,18 + ,7 + ,7 + ,4 + ,4 + ,0 + ,29 + ,19 + ,38 + ,14 + ,28 + ,13 + ,26 + ,2 + ,4 + ,1 + ,38 + ,20 + ,20 + ,12 + ,12 + ,10 + ,10 + ,4 + ,4 + ,0 + ,41 + ,21 + ,42 + ,12 + ,24 + ,9 + ,18 + ,4 + ,8 + ,1 + ,38 + ,21 + ,21 + ,9 + ,9 + ,9 + ,9 + ,4 + ,4 + ,1 + ,24 + ,23 + ,23 + ,11 + ,11 + ,15 + ,15 + ,3 + ,3 + ,0 + ,34 + ,24 + ,48 + ,8 + ,16 + ,13 + ,26 + ,2 + ,4 + ,0 + ,38 + ,23 + ,46 + ,5 + ,10 + ,16 + ,32 + ,2 + ,4 + ,0 + ,37 + ,19 + ,38 + ,10 + ,20 + ,12 + ,24 + ,3 + ,6 + ,1 + ,46 + ,17 + ,17 + ,11 + ,11 + ,6 + ,6 + ,5 + ,5 + ,0 + ,48 + ,27 + ,54 + ,15 + ,30 + ,4 + ,8 + ,5 + ,10 + ,1 + ,42 + ,27 + ,27 + ,16 + ,16 + ,12 + ,12 + ,4 + ,4 + ,1 + ,46 + ,25 + ,25 + ,12 + ,12 + ,10 + ,10 + ,4 + ,4 + ,1 + ,43 + ,18 + ,18 + ,14 + ,14 + ,14 + ,14 + ,5 + ,5 + ,1 + ,38 + ,22 + ,22 + ,13 + ,13 + ,9 + ,9 + ,4 + ,4 + ,0 + ,39 + ,26 + ,52 + ,10 + ,20 + ,10 + ,20 + ,4 + ,8 + ,0 + ,34 + ,26 + ,52 + ,18 + ,36 + ,14 + ,28 + ,4 + ,8 + ,1 + ,39 + ,23 + ,23 + ,17 + ,17 + ,14 + ,14 + ,4 + ,4 + ,0 + ,35 + ,16 + ,32 + ,12 + ,24 + ,10 + ,20 + ,2 + ,4 + ,0 + ,41 + ,27 + ,54 + ,13 + ,26 + ,9 + ,18 + ,3 + ,6 + ,1 + ,40 + ,25 + ,25 + ,13 + ,13 + ,14 + ,14 + ,3 + ,3 + ,0 + ,43 + ,14 + ,28 + ,11 + ,22 + ,8 + ,16 + ,4 + ,8 + ,1 + ,37 + ,19 + ,19 + ,13 + ,13 + ,9 + ,9 + ,2 + ,2 + ,1 + ,41 + ,20 + ,20 + ,12 + ,12 + ,8 + ,8 + ,4 + ,4 + ,1 + ,46 + ,26 + ,26 + ,12 + ,12 + ,10 + ,10 + ,4 + ,4 + ,1 + ,26 + ,16 + ,16 + ,12 + ,12 + ,9 + ,9 + ,3 + ,3 + ,0 + ,41 + ,18 + ,36 + ,12 + ,24 + ,9 + ,18 + ,3 + ,6 + ,1 + ,37 + ,22 + ,22 + ,9 + ,9 + ,9 + ,9 + ,3 + ,3 + ,1 + ,39 + ,25 + ,25 + ,17 + ,17 + ,9 + ,9 + ,4 + ,4 + ,1 + ,44 + ,29 + ,29 + ,18 + ,18 + ,11 + ,11 + ,5 + ,5 + ,0 + ,39 + ,21 + ,42 + ,7 + ,14 + ,15 + ,30 + ,2 + ,4 + ,0 + ,36 + ,22 + ,44 + ,17 + ,34 + ,8 + ,16 + ,4 + ,8 + ,1 + ,38 + ,22 + ,22 + ,12 + ,12 + ,10 + ,10 + ,2 + ,2 + ,1 + ,38 + ,32 + ,32 + ,12 + ,12 + ,8 + ,8 + ,0 + ,0 + ,1 + ,38 + ,23 + ,23 + ,9 + ,9 + ,14 + ,14 + ,4 + ,4 + ,0 + ,32 + ,31 + ,62 + ,9 + ,18 + ,11 + ,22 + ,4 + ,8 + ,1 + ,33 + ,18 + ,18 + ,13 + ,13 + ,10 + ,10 + ,3 + ,3 + ,0 + ,46 + ,23 + ,46 + ,10 + ,20 + ,12 + ,24 + ,4 + ,8 + ,0 + ,42 + ,24 + ,48 + ,12 + ,24 + ,9 + ,18 + ,4 + ,8 + ,0 + ,42 + ,19 + ,38 + ,10 + ,20 + ,13 + ,26 + ,2 + ,4 + ,1 + ,43 + ,26 + ,26 + ,11 + ,11 + ,14 + ,14 + ,4 + ,4 + ,1 + ,41 + ,14 + ,14 + ,13 + ,13 + ,15 + ,15 + ,2 + ,2 + ,1 + ,49 + ,20 + ,20 + ,6 + ,6 + ,8 + ,8 + ,4 + ,4 + ,0 + ,45 + ,22 + ,44 + ,7 + ,14 + ,7 + ,14 + ,3 + ,6 + ,0 + ,39 + ,24 + ,48 + ,13 + ,26 + ,10 + ,20 + ,4 + ,8 + ,1 + ,45 + ,25 + ,25 + ,11 + ,11 + ,10 + ,10 + ,5 + ,5 + ,1 + ,31 + ,21 + ,21 + ,18 + ,18 + ,13 + ,13 + ,3 + ,3 + ,1 + ,30 + ,21 + ,21 + ,18 + ,18 + ,13 + ,13 + ,3 + ,3 + ,0 + ,45 + ,28 + ,56 + ,9 + ,18 + ,11 + ,22 + ,4 + ,8 + ,0 + ,48 + ,24 + ,48 + ,9 + ,18 + ,8 + ,16 + ,5 + ,10 + ,0 + ,28 + ,15 + ,30 + ,12 + ,24 + ,14 + ,28 + ,4 + ,8 + ,0 + ,35 + ,21 + ,42 + ,11 + ,22 + ,9 + ,18 + ,2 + ,4 + ,1 + ,38 + ,23 + ,23 + ,15 + ,15 + ,10 + ,10 + ,4 + ,4 + ,1 + ,39 + ,24 + ,24 + ,11 + ,11 + ,11 + ,11 + ,4 + ,4 + ,1 + ,40 + ,21 + ,21 + ,14 + ,14 + ,10 + ,10 + ,4 + ,4 + ,0 + ,38 + ,21 + ,42 + ,14 + ,28 + ,16 + ,32 + ,4 + ,8 + ,0 + ,42 + ,13 + ,26 + ,8 + ,16 + ,11 + ,22 + ,4 + ,8 + ,1 + ,36 + ,17 + ,17 + ,12 + ,12 + ,16 + ,16 + ,2 + ,2 + ,1 + ,49 + ,29 + ,29 + ,8 + ,8 + ,6 + ,6 + ,5 + ,5 + ,1 + ,41 + ,25 + ,25 + ,11 + ,11 + ,11 + ,11 + ,4 + ,4 + ,1 + ,18 + ,16 + ,16 + ,10 + ,10 + ,12 + ,12 + ,2 + ,2 + ,0 + ,36 + ,20 + ,40 + ,11 + ,22 + ,12 + ,24 + ,3 + ,6 + ,1 + ,42 + ,25 + ,25 + ,17 + ,17 + ,14 + ,14 + ,3 + ,3 + ,1 + ,41 + ,25 + ,25 + ,16 + ,16 + ,9 + ,9 + ,5 + ,5 + ,1 + ,43 + ,21 + ,21 + ,13 + ,13 + ,11 + ,11 + ,4 + ,4 + ,1 + ,46 + ,23 + ,23 + ,15 + ,15 + ,8 + ,8 + ,3 + ,3 + ,0 + ,37 + ,22 + ,44 + ,11 + ,22 + ,8 + ,16 + ,4 + ,8 + ,0 + ,38 + ,19 + ,38 + ,12 + ,24 + ,7 + ,14 + ,3 + ,6 + ,0 + ,43 + ,26 + ,52 + ,20 + ,40 + ,13 + ,26 + ,4 + ,8 + ,1 + ,41 + ,25 + ,25 + ,16 + ,16 + ,8 + ,8 + ,5 + ,5 + ,0 + ,35 + ,19 + ,38 + ,8 + ,16 + ,20 + ,40 + ,2 + ,4 + ,1 + ,39 + ,25 + ,25 + ,7 + ,7 + ,11 + ,11 + ,4 + ,4 + ,1 + ,42 + ,24 + ,24 + ,16 + ,16 + ,16 + ,16 + ,4 + ,4 + ,0 + ,36 + ,20 + ,40 + ,11 + ,22 + ,11 + ,22 + ,4 + ,8 + ,1 + ,35 + ,21 + ,21 + ,13 + ,13 + ,12 + ,12 + ,5 + ,5 + ,0 + ,33 + ,14 + ,28 + ,15 + ,30 + ,10 + ,20 + ,2 + ,4 + ,1 + ,36 + ,22 + ,22 + ,15 + ,15 + ,14 + ,14 + ,3 + ,3 + ,1 + ,48 + ,14 + ,14 + ,12 + ,12 + ,8 + ,8 + ,4 + ,4 + ,1 + ,41 + ,20 + ,20 + ,12 + ,12 + ,10 + ,10 + ,4 + ,4 + ,1 + ,47 + ,21 + ,21 + ,24 + ,24 + ,14 + ,14 + ,3 + ,3 + ,1 + ,41 + ,22 + ,22 + ,15 + ,15 + ,10 + ,10 + ,3 + ,3 + ,1 + ,31 + ,19 + ,19 + ,8 + ,8 + ,5 + ,5 + ,5 + ,5 + ,1 + ,36 + ,28 + ,28 + ,18 + ,18 + ,12 + ,12 + ,4 + ,4 + ,1 + ,46 + ,25 + ,25 + ,17 + ,17 + ,9 + ,9 + ,4 + ,4 + ,0 + ,39 + ,17 + ,34 + ,12 + ,24 + ,16 + ,32 + ,4 + ,8 + ,1 + ,44 + ,21 + ,21 + ,15 + ,15 + ,8 + ,8 + ,4 + ,4 + ,1 + ,43 + ,27 + ,27 + ,11 + ,11 + ,16 + ,16 + ,2 + ,2 + ,0 + ,32 + ,29 + ,58 + ,12 + ,24 + ,12 + ,24 + ,4 + ,8 + ,1 + ,40 + ,19 + ,19 + ,12 + ,12 + ,13 + ,13 + ,5 + ,5 + ,1 + ,40 + ,20 + ,20 + ,14 + ,14 + ,8 + ,8 + ,3 + ,3 + ,1 + ,46 + ,17 + ,17 + ,11 + ,11 + ,14 + ,14 + ,3 + ,3 + ,0 + ,45 + ,21 + ,42 + ,12 + ,24 + ,8 + ,16 + ,3 + ,6 + ,1 + ,39 + ,22 + ,22 + ,10 + ,10 + ,8 + ,8 + ,4 + ,4 + ,1 + ,44 + ,26 + ,26 + ,11 + ,11 + ,7 + ,7 + ,4 + ,4 + ,0 + ,35 + ,19 + ,38 + ,11 + ,22 + ,10 + ,20 + ,4 + ,8 + ,0 + ,38 + ,17 + ,34 + ,9 + ,18 + ,11 + ,22 + ,3 + ,6 + ,1 + ,38 + ,17 + ,17 + ,12 + ,12 + ,11 + ,11 + ,2 + ,2 + ,0 + ,36 + ,19 + ,38 + ,8 + ,16 + ,14 + ,28 + ,3 + ,6 + ,0 + ,42 + ,17 + ,34 + ,12 + ,24 + ,10 + ,20 + ,3 + ,6 + ,1 + ,39 + ,15 + ,15 + ,6 + ,6 + ,6 + ,6 + ,4 + ,4 + ,1 + ,41 + ,27 + ,27 + ,15 + ,15 + ,9 + ,9 + ,5 + ,5 + ,0 + ,41 + ,19 + ,38 + ,13 + ,26 + ,12 + ,24 + ,4 + ,8 + ,0 + ,47 + ,21 + ,42 + ,17 + ,34 + ,11 + ,22 + ,3 + ,6 + ,1 + ,39 + ,25 + ,25 + ,14 + ,14 + ,14 + ,14 + ,3 + ,3 + ,1 + ,40 + ,19 + ,19 + ,16 + ,16 + ,12 + ,12 + ,4 + ,4 + ,1 + ,44 + ,18 + ,18 + ,16 + ,16 + ,8 + ,8 + ,4 + ,4 + ,1 + ,42 + ,15 + ,15 + ,11 + ,11 + ,8 + ,8 + ,4 + ,4 + ,0 + ,35 + ,20 + ,40 + ,16 + ,32 + ,11 + ,22 + ,3 + ,6 + ,1 + ,46 + ,29 + ,29 + ,15 + ,15 + ,12 + ,12 + ,5 + ,5 + ,0 + ,43 + ,20 + ,40 + ,11 + ,22 + ,14 + ,28 + ,3 + ,6 + ,0 + ,40 + ,29 + ,58 + ,9 + ,18 + ,16 + ,32 + ,4 + ,8 + ,1 + ,44 + ,24 + ,24 + ,12 + ,12 + ,13 + ,13 + ,4 + ,4 + ,1 + ,37 + ,24 + ,24 + ,13 + ,13 + ,11 + ,11 + ,4 + ,4 + ,0 + ,46 + ,23 + ,46 + ,11 + ,22 + ,9 + ,18 + ,4 + ,8 + ,0 + ,44 + ,23 + ,46 + ,11 + ,22 + ,11 + ,22 + ,5 + ,10 + ,0 + ,35 + ,19 + ,38 + ,13 + ,26 + ,9 + ,18 + ,3 + ,6 + ,1 + ,39 + ,22 + ,22 + ,14 + ,14 + ,12 + ,12 + ,2 + ,2 + ,1 + ,40 + ,22 + ,22 + ,12 + ,12 + ,13 + ,13 + ,3 + ,3 + ,1 + ,42 + ,25 + ,25 + ,17 + ,17 + ,14 + ,14 + ,3 + ,3 + ,1 + ,37 + ,21 + ,21 + ,11 + ,11 + ,9 + ,9 + ,3 + ,3 + ,0 + ,29 + ,22 + ,44 + ,15 + ,30 + ,14 + ,28 + ,4 + ,8 + ,1 + ,33 + ,21 + ,21 + ,13 + ,13 + ,8 + ,8 + ,2 + ,2 + ,1 + ,35 + ,18 + ,18 + ,9 + ,9 + ,8 + ,8 + ,4 + ,4 + ,1 + ,42 + ,10 + ,10 + ,12 + ,12 + ,9 + ,9 + ,2 + ,2) + ,dim=c(10 + ,146) + ,dimnames=list(c('G' + ,'Career' + ,'PersonalStandards' + ,'PeG' + ,'ParentalExpectations' + ,'PaG' + ,'Doubts' + ,'DoG' + ,'LeadershipPreference' + ,'LeaderG') + ,1:146)) > y <- array(NA,dim=c(10,146),dimnames=list(c('G','Career','PersonalStandards','PeG','ParentalExpectations','PaG','Doubts','DoG','LeadershipPreference','LeaderG'),1:146)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 Career G PersonalStandards PeG ParentalExpectations PaG Doubts DoG 1 41 1 25 25 15 15 9 9 2 38 1 25 25 15 15 9 9 3 37 1 19 19 14 14 9 9 4 36 0 18 36 10 20 14 28 5 42 1 18 18 10 10 8 8 6 44 0 23 46 9 18 14 28 7 40 1 23 23 18 18 15 15 8 43 1 25 25 14 14 9 9 9 40 1 23 23 11 11 11 11 10 45 0 24 48 11 22 14 28 11 47 0 32 64 9 18 14 28 12 45 1 30 30 17 17 6 6 13 45 1 32 32 21 21 10 10 14 40 0 24 48 16 32 9 18 15 49 0 17 34 14 28 14 28 16 48 0 30 60 24 48 8 16 17 44 1 25 25 7 7 11 11 18 29 0 25 50 9 18 10 20 19 42 1 26 26 18 18 16 16 20 45 0 23 46 11 22 11 22 21 32 1 25 25 13 13 11 11 22 32 1 25 25 13 13 11 11 23 41 1 35 35 18 18 7 7 24 29 0 19 38 14 28 13 26 25 38 1 20 20 12 12 10 10 26 41 0 21 42 12 24 9 18 27 38 1 21 21 9 9 9 9 28 24 1 23 23 11 11 15 15 29 34 0 24 48 8 16 13 26 30 38 0 23 46 5 10 16 32 31 37 0 19 38 10 20 12 24 32 46 1 17 17 11 11 6 6 33 48 0 27 54 15 30 4 8 34 42 1 27 27 16 16 12 12 35 46 1 25 25 12 12 10 10 36 43 1 18 18 14 14 14 14 37 38 1 22 22 13 13 9 9 38 39 0 26 52 10 20 10 20 39 34 0 26 52 18 36 14 28 40 39 1 23 23 17 17 14 14 41 35 0 16 32 12 24 10 20 42 41 0 27 54 13 26 9 18 43 40 1 25 25 13 13 14 14 44 43 0 14 28 11 22 8 16 45 37 1 19 19 13 13 9 9 46 41 1 20 20 12 12 8 8 47 46 1 26 26 12 12 10 10 48 26 1 16 16 12 12 9 9 49 41 0 18 36 12 24 9 18 50 37 1 22 22 9 9 9 9 51 39 1 25 25 17 17 9 9 52 44 1 29 29 18 18 11 11 53 39 0 21 42 7 14 15 30 54 36 0 22 44 17 34 8 16 55 38 1 22 22 12 12 10 10 56 38 1 32 32 12 12 8 8 57 38 1 23 23 9 9 14 14 58 32 0 31 62 9 18 11 22 59 33 1 18 18 13 13 10 10 60 46 0 23 46 10 20 12 24 61 42 0 24 48 12 24 9 18 62 42 0 19 38 10 20 13 26 63 43 1 26 26 11 11 14 14 64 41 1 14 14 13 13 15 15 65 49 1 20 20 6 6 8 8 66 45 0 22 44 7 14 7 14 67 39 0 24 48 13 26 10 20 68 45 1 25 25 11 11 10 10 69 31 1 21 21 18 18 13 13 70 30 1 21 21 18 18 13 13 71 45 0 28 56 9 18 11 22 72 48 0 24 48 9 18 8 16 73 28 0 15 30 12 24 14 28 74 35 0 21 42 11 22 9 18 75 38 1 23 23 15 15 10 10 76 39 1 24 24 11 11 11 11 77 40 1 21 21 14 14 10 10 78 38 0 21 42 14 28 16 32 79 42 0 13 26 8 16 11 22 80 36 1 17 17 12 12 16 16 81 49 1 29 29 8 8 6 6 82 41 1 25 25 11 11 11 11 83 18 1 16 16 10 10 12 12 84 36 0 20 40 11 22 12 24 85 42 1 25 25 17 17 14 14 86 41 1 25 25 16 16 9 9 87 43 1 21 21 13 13 11 11 88 46 1 23 23 15 15 8 8 89 37 0 22 44 11 22 8 16 90 38 0 19 38 12 24 7 14 91 43 0 26 52 20 40 13 26 92 41 1 25 25 16 16 8 8 93 35 0 19 38 8 16 20 40 94 39 1 25 25 7 7 11 11 95 42 1 24 24 16 16 16 16 96 36 0 20 40 11 22 11 22 97 35 1 21 21 13 13 12 12 98 33 0 14 28 15 30 10 20 99 36 1 22 22 15 15 14 14 100 48 1 14 14 12 12 8 8 101 41 1 20 20 12 12 10 10 102 47 1 21 21 24 24 14 14 103 41 1 22 22 15 15 10 10 104 31 1 19 19 8 8 5 5 105 36 1 28 28 18 18 12 12 106 46 1 25 25 17 17 9 9 107 39 0 17 34 12 24 16 32 108 44 1 21 21 15 15 8 8 109 43 1 27 27 11 11 16 16 110 32 0 29 58 12 24 12 24 111 40 1 19 19 12 12 13 13 112 40 1 20 20 14 14 8 8 113 46 1 17 17 11 11 14 14 114 45 0 21 42 12 24 8 16 115 39 1 22 22 10 10 8 8 116 44 1 26 26 11 11 7 7 117 35 0 19 38 11 22 10 20 118 38 0 17 34 9 18 11 22 119 38 1 17 17 12 12 11 11 120 36 0 19 38 8 16 14 28 121 42 0 17 34 12 24 10 20 122 39 1 15 15 6 6 6 6 123 41 1 27 27 15 15 9 9 124 41 0 19 38 13 26 12 24 125 47 0 21 42 17 34 11 22 126 39 1 25 25 14 14 14 14 127 40 1 19 19 16 16 12 12 128 44 1 18 18 16 16 8 8 129 42 1 15 15 11 11 8 8 130 35 0 20 40 16 32 11 22 131 46 1 29 29 15 15 12 12 132 43 0 20 40 11 22 14 28 133 40 0 29 58 9 18 16 32 134 44 1 24 24 12 12 13 13 135 37 1 24 24 13 13 11 11 136 46 0 23 46 11 22 9 18 137 44 0 23 46 11 22 11 22 138 35 0 19 38 13 26 9 18 139 39 1 22 22 14 14 12 12 140 40 1 22 22 12 12 13 13 141 42 1 25 25 17 17 14 14 142 37 1 21 21 11 11 9 9 143 29 0 22 44 15 30 14 28 144 33 1 21 21 13 13 8 8 145 35 1 18 18 9 9 8 8 146 42 1 10 10 12 12 9 9 LeadershipPreference LeaderG 1 3 3 2 4 4 3 4 4 4 2 4 5 4 4 6 4 8 7 3 3 8 4 4 9 4 4 10 4 8 11 4 8 12 5 5 13 4 4 14 4 8 15 4 8 16 5 10 17 4 4 18 4 8 19 4 4 20 5 10 21 5 5 22 5 5 23 4 4 24 2 4 25 4 4 26 4 8 27 4 4 28 3 3 29 2 4 30 2 4 31 3 6 32 5 5 33 5 10 34 4 4 35 4 4 36 5 5 37 4 4 38 4 8 39 4 8 40 4 4 41 2 4 42 3 6 43 3 3 44 4 8 45 2 2 46 4 4 47 4 4 48 3 3 49 3 6 50 3 3 51 4 4 52 5 5 53 2 4 54 4 8 55 2 2 56 0 0 57 4 4 58 4 8 59 3 3 60 4 8 61 4 8 62 2 4 63 4 4 64 2 2 65 4 4 66 3 6 67 4 8 68 5 5 69 3 3 70 3 3 71 4 8 72 5 10 73 4 8 74 2 4 75 4 4 76 4 4 77 4 4 78 4 8 79 4 8 80 2 2 81 5 5 82 4 4 83 2 2 84 3 6 85 3 3 86 5 5 87 4 4 88 3 3 89 4 8 90 3 6 91 4 8 92 5 5 93 2 4 94 4 4 95 4 4 96 4 8 97 5 5 98 2 4 99 3 3 100 4 4 101 4 4 102 3 3 103 3 3 104 5 5 105 4 4 106 4 4 107 4 8 108 4 4 109 2 2 110 4 8 111 5 5 112 3 3 113 3 3 114 3 6 115 4 4 116 4 4 117 4 8 118 3 6 119 2 2 120 3 6 121 3 6 122 4 4 123 5 5 124 4 8 125 3 6 126 3 3 127 4 4 128 4 4 129 4 4 130 3 6 131 5 5 132 3 6 133 4 8 134 4 4 135 4 4 136 4 8 137 5 10 138 3 6 139 2 2 140 3 3 141 3 3 142 3 3 143 4 8 144 2 2 145 4 4 146 2 2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) G PersonalStandards 35.61971 -4.20094 0.30303 PeG ParentalExpectations PaG -0.10947 0.41231 -0.27666 Doubts DoG LeadershipPreference -0.09705 -0.10922 0.35718 LeaderG 0.84801 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -17.8074 -2.3348 0.6335 3.2159 10.1289 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 35.61971 5.51278 6.461 1.71e-09 *** G -4.20094 6.90674 -0.608 0.544 PersonalStandards 0.30303 0.32279 0.939 0.349 PeG -0.10947 0.21968 -0.498 0.619 ParentalExpectations 0.41231 0.42404 0.972 0.333 PaG -0.27666 0.28108 -0.984 0.327 Doubts -0.09705 0.49840 -0.195 0.846 DoG -0.10922 0.32723 -0.334 0.739 LeadershipPreference 0.35718 1.47807 0.242 0.809 LeaderG 0.84801 1.06258 0.798 0.426 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.038 on 136 degrees of freedom Multiple R-squared: 0.1473, Adjusted R-squared: 0.09084 F-statistic: 2.61 on 9 and 136 DF, p-value: 0.008226 > 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.222726010 0.44545202 0.77727399 [2,] 0.104911851 0.20982370 0.89508815 [3,] 0.060792196 0.12158439 0.93920780 [4,] 0.032058471 0.06411694 0.96794153 [5,] 0.013898300 0.02779660 0.98610170 [6,] 0.019274163 0.03854833 0.98072584 [7,] 0.008844012 0.01768802 0.99115599 [8,] 0.009961318 0.01992264 0.99003868 [9,] 0.084306268 0.16861254 0.91569373 [10,] 0.114335458 0.22867092 0.88566454 [11,] 0.135418268 0.27083654 0.86458173 [12,] 0.169064059 0.33812812 0.83093594 [13,] 0.121934548 0.24386910 0.87806545 [14,] 0.182101601 0.36420320 0.81789840 [15,] 0.139078074 0.27815615 0.86092193 [16,] 0.621037875 0.75792425 0.37896213 [17,] 0.603488191 0.79302362 0.39651181 [18,] 0.548447137 0.90310573 0.45155286 [19,] 0.484928520 0.96985704 0.51507148 [20,] 0.480730407 0.96146081 0.51926959 [21,] 0.644187155 0.71162569 0.35581285 [22,] 0.606391146 0.78721771 0.39360885 [23,] 0.649601327 0.70079735 0.35039867 [24,] 0.646978785 0.70604243 0.35302122 [25,] 0.604631319 0.79073736 0.39536868 [26,] 0.551305693 0.89738861 0.44869431 [27,] 0.694334016 0.61133197 0.30566598 [28,] 0.642099869 0.71580026 0.35790013 [29,] 0.603125045 0.79374991 0.39687496 [30,] 0.579236464 0.84152707 0.42076354 [31,] 0.543907724 0.91218455 0.45609228 [32,] 0.494023412 0.98804682 0.50597659 [33,] 0.445665670 0.89133134 0.55433433 [34,] 0.391013165 0.78202633 0.60898684 [35,] 0.413367987 0.82673597 0.58663201 [36,] 0.643390809 0.71321838 0.35660919 [37,] 0.607278557 0.78544289 0.39272144 [38,] 0.556800572 0.88639886 0.44319943 [39,] 0.514210500 0.97157900 0.48578950 [40,] 0.461146384 0.92229277 0.53885362 [41,] 0.430619052 0.86123810 0.56938095 [42,] 0.421187631 0.84237526 0.57881237 [43,] 0.376450183 0.75290037 0.62354982 [44,] 0.328692304 0.65738461 0.67130770 [45,] 0.285399120 0.57079824 0.71460088 [46,] 0.402741648 0.80548330 0.59725835 [47,] 0.391005844 0.78201169 0.60899416 [48,] 0.383581854 0.76716371 0.61641815 [49,] 0.336759645 0.67351929 0.66324036 [50,] 0.357450874 0.71490175 0.64254913 [51,] 0.331390233 0.66278047 0.66860977 [52,] 0.374613183 0.74922637 0.62538682 [53,] 0.503479214 0.99304157 0.49652079 [54,] 0.512700162 0.97459968 0.48729984 [55,] 0.470924802 0.94184960 0.52907520 [56,] 0.438216778 0.87643356 0.56178322 [57,] 0.491932303 0.98386461 0.50806770 [58,] 0.585038803 0.82992239 0.41496120 [59,] 0.558307760 0.88338448 0.44169224 [60,] 0.544494642 0.91101072 0.45550536 [61,] 0.752888334 0.49422333 0.24711167 [62,] 0.717157980 0.56568404 0.28284202 [63,] 0.688001025 0.62399795 0.31199897 [64,] 0.644520357 0.71095929 0.35547964 [65,] 0.598468755 0.80306249 0.40153125 [66,] 0.549955830 0.90008834 0.45004417 [67,] 0.511446903 0.97710619 0.48855310 [68,] 0.467481790 0.93496358 0.53251821 [69,] 0.515445213 0.96910957 0.48455479 [70,] 0.468395888 0.93679178 0.53160411 [71,] 0.949544425 0.10091115 0.05045558 [72,] 0.937521609 0.12495678 0.06247839 [73,] 0.927163919 0.14567216 0.07283608 [74,] 0.907995974 0.18400805 0.09200403 [75,] 0.894257981 0.21148404 0.10574202 [76,] 0.911028922 0.17794216 0.08897108 [77,] 0.903151598 0.19369680 0.09684840 [78,] 0.881884245 0.23623151 0.11811576 [79,] 0.879307926 0.24138415 0.12069207 [80,] 0.851379644 0.29724071 0.14862036 [81,] 0.818352494 0.36329501 0.18164751 [82,] 0.786746659 0.42650668 0.21325334 [83,] 0.753114400 0.49377120 0.24688560 [84,] 0.741430315 0.51713937 0.25856969 [85,] 0.778747365 0.44250527 0.22125263 [86,] 0.776563553 0.44687289 0.22343645 [87,] 0.787374158 0.42525168 0.21262584 [88,] 0.854538973 0.29092205 0.14546103 [89,] 0.820445610 0.35910878 0.17955439 [90,] 0.824249053 0.35150189 0.17575095 [91,] 0.786381663 0.42723667 0.21361834 [92,] 0.861240065 0.27751987 0.13875993 [93,] 0.886066129 0.22786774 0.11393387 [94,] 0.879179725 0.24164055 0.12082028 [95,] 0.857032527 0.28593495 0.14296747 [96,] 0.838743201 0.32251360 0.16125680 [97,] 0.826690756 0.34661849 0.17330924 [98,] 0.926033626 0.14793275 0.07396637 [99,] 0.921524387 0.15695123 0.07847561 [100,] 0.896243905 0.20751219 0.10375609 [101,] 0.908689617 0.18262077 0.09131038 [102,] 0.884045430 0.23190914 0.11595457 [103,] 0.846156839 0.30768632 0.15384316 [104,] 0.871771289 0.25645742 0.12822871 [105,] 0.882927780 0.23414444 0.11707222 [106,] 0.848372807 0.30325439 0.15162719 [107,] 0.799266925 0.40146615 0.20073307 [108,] 0.767342058 0.46531588 0.23265794 [109,] 0.706325698 0.58734860 0.29367430 [110,] 0.643908261 0.71218348 0.35609174 [111,] 0.563349119 0.87330176 0.43665088 [112,] 0.511350749 0.97729850 0.48864925 [113,] 0.916317950 0.16736410 0.08368205 [114,] 0.875966169 0.24806766 0.12403383 [115,] 0.928407825 0.14318435 0.07159218 [116,] 0.881209621 0.23758076 0.11879038 [117,] 0.813574938 0.37285012 0.18642506 [118,] 0.890780348 0.21843930 0.10921965 [119,] 0.928123455 0.14375309 0.07187655 [120,] 0.963257277 0.07348545 0.03674272 [121,] 0.896272963 0.20745407 0.10372704 > postscript(file="/var/www/rcomp/tmp/1cpiq1290518064.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/2cpiq1290518064.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/3ng0t1290518064.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/4ng0t1290518064.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/5ng0t1290518064.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 = 146 Frequency = 1 1 2 3 4 5 6 0.94823308 -3.25695789 -2.95991653 0.58710400 2.56996986 3.91920277 7 8 9 10 11 12 1.16604215 1.87868985 0.08530464 5.11713313 6.16233119 0.67991710 13 14 15 16 17 18 1.78046663 -0.75523509 10.12885183 5.49960373 4.24076440 -12.51093990 19 20 21 22 23 24 1.58642456 2.20156652 -9.77831301 -9.77831301 -3.01209751 -6.24842568 25 26 27 28 29 30 -1.67591647 -0.06699898 -1.66880903 -13.88442367 -2.51499150 2.09252627 31 32 33 34 35 36 -1.18116905 5.01015639 3.22082284 0.83907371 5.35625551 3.05980902 37 38 39 40 41 42 -2.40496560 -2.45402314 -5.06396533 -1.10977125 -1.22462410 1.62263529 43 44 45 46 47 48 1.25087947 2.06517806 -0.41388685 0.91154317 5.16268991 -11.90273327 49 50 51 52 53 54 2.23849326 -1.65718367 -2.52825337 0.76918587 3.22725991 -4.76151505 55 56 57 58 59 60 0.34733426 0.40951979 -1.02458933 -9.70003370 -5.21924203 5.42924187 61 62 63 64 65 66 0.68071050 6.18751991 3.12341838 5.79156225 9.72542961 4.56606339 67 68 69 70 71 72 -1.86278865 3.28671229 -7.85936700 -8.85936700 3.55225682 3.88898073 73 74 75 76 77 78 -10.98498170 -2.10160916 -2.66355650 -1.10826096 -0.14077755 -0.57656104 79 80 81 82 83 84 1.67269583 0.55278336 6.09431237 0.69817344 -17.80743628 -2.12425229 85 86 87 88 89 90 2.70828850 -1.59779660 3.20114037 6.12909410 -4.60759667 -1.47657808 91 92 93 94 95 96 3.90257463 -1.80406678 1.11390343 -0.75923560 2.24485124 -4.49294125 97 98 99 100 101 102 -5.79778042 -2.63338961 -2.43971920 9.07293679 1.32408353 7.53301674 103 104 105 106 107 108 1.73520007 -10.17630178 -5.62578738 4.47174663 0.47779912 3.31103435 109 110 111 112 113 114 5.75277507 -8.79331197 -0.06873129 0.84543866 9.07069978 5.67071549 115 116 117 118 119 120 -1.20429256 2.67952711 -5.72433165 -0.46947621 1.52143246 -1.83222176 121 122 123 124 125 126 3.63807735 0.28071727 -1.84928006 1.18867005 9.32224524 0.11523173 127 128 129 130 131 132 0.38759854 3.75608342 3.01501893 -2.73467152 3.38239927 5.50672221 133 134 135 136 137 138 0.04559621 4.16863166 -3.37955644 4.62379374 1.20156652 -3.70458998 139 140 141 142 143 144 1.48857914 1.76095384 2.70828850 -1.73491355 -10.15061878 -5.00728824 145 146 -4.29438240 6.46385132 > postscript(file="/var/www/rcomp/tmp/6g7zw1290518064.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 = 146 Frequency = 1 lag(myerror, k = 1) myerror 0 0.94823308 NA 1 -3.25695789 0.94823308 2 -2.95991653 -3.25695789 3 0.58710400 -2.95991653 4 2.56996986 0.58710400 5 3.91920277 2.56996986 6 1.16604215 3.91920277 7 1.87868985 1.16604215 8 0.08530464 1.87868985 9 5.11713313 0.08530464 10 6.16233119 5.11713313 11 0.67991710 6.16233119 12 1.78046663 0.67991710 13 -0.75523509 1.78046663 14 10.12885183 -0.75523509 15 5.49960373 10.12885183 16 4.24076440 5.49960373 17 -12.51093990 4.24076440 18 1.58642456 -12.51093990 19 2.20156652 1.58642456 20 -9.77831301 2.20156652 21 -9.77831301 -9.77831301 22 -3.01209751 -9.77831301 23 -6.24842568 -3.01209751 24 -1.67591647 -6.24842568 25 -0.06699898 -1.67591647 26 -1.66880903 -0.06699898 27 -13.88442367 -1.66880903 28 -2.51499150 -13.88442367 29 2.09252627 -2.51499150 30 -1.18116905 2.09252627 31 5.01015639 -1.18116905 32 3.22082284 5.01015639 33 0.83907371 3.22082284 34 5.35625551 0.83907371 35 3.05980902 5.35625551 36 -2.40496560 3.05980902 37 -2.45402314 -2.40496560 38 -5.06396533 -2.45402314 39 -1.10977125 -5.06396533 40 -1.22462410 -1.10977125 41 1.62263529 -1.22462410 42 1.25087947 1.62263529 43 2.06517806 1.25087947 44 -0.41388685 2.06517806 45 0.91154317 -0.41388685 46 5.16268991 0.91154317 47 -11.90273327 5.16268991 48 2.23849326 -11.90273327 49 -1.65718367 2.23849326 50 -2.52825337 -1.65718367 51 0.76918587 -2.52825337 52 3.22725991 0.76918587 53 -4.76151505 3.22725991 54 0.34733426 -4.76151505 55 0.40951979 0.34733426 56 -1.02458933 0.40951979 57 -9.70003370 -1.02458933 58 -5.21924203 -9.70003370 59 5.42924187 -5.21924203 60 0.68071050 5.42924187 61 6.18751991 0.68071050 62 3.12341838 6.18751991 63 5.79156225 3.12341838 64 9.72542961 5.79156225 65 4.56606339 9.72542961 66 -1.86278865 4.56606339 67 3.28671229 -1.86278865 68 -7.85936700 3.28671229 69 -8.85936700 -7.85936700 70 3.55225682 -8.85936700 71 3.88898073 3.55225682 72 -10.98498170 3.88898073 73 -2.10160916 -10.98498170 74 -2.66355650 -2.10160916 75 -1.10826096 -2.66355650 76 -0.14077755 -1.10826096 77 -0.57656104 -0.14077755 78 1.67269583 -0.57656104 79 0.55278336 1.67269583 80 6.09431237 0.55278336 81 0.69817344 6.09431237 82 -17.80743628 0.69817344 83 -2.12425229 -17.80743628 84 2.70828850 -2.12425229 85 -1.59779660 2.70828850 86 3.20114037 -1.59779660 87 6.12909410 3.20114037 88 -4.60759667 6.12909410 89 -1.47657808 -4.60759667 90 3.90257463 -1.47657808 91 -1.80406678 3.90257463 92 1.11390343 -1.80406678 93 -0.75923560 1.11390343 94 2.24485124 -0.75923560 95 -4.49294125 2.24485124 96 -5.79778042 -4.49294125 97 -2.63338961 -5.79778042 98 -2.43971920 -2.63338961 99 9.07293679 -2.43971920 100 1.32408353 9.07293679 101 7.53301674 1.32408353 102 1.73520007 7.53301674 103 -10.17630178 1.73520007 104 -5.62578738 -10.17630178 105 4.47174663 -5.62578738 106 0.47779912 4.47174663 107 3.31103435 0.47779912 108 5.75277507 3.31103435 109 -8.79331197 5.75277507 110 -0.06873129 -8.79331197 111 0.84543866 -0.06873129 112 9.07069978 0.84543866 113 5.67071549 9.07069978 114 -1.20429256 5.67071549 115 2.67952711 -1.20429256 116 -5.72433165 2.67952711 117 -0.46947621 -5.72433165 118 1.52143246 -0.46947621 119 -1.83222176 1.52143246 120 3.63807735 -1.83222176 121 0.28071727 3.63807735 122 -1.84928006 0.28071727 123 1.18867005 -1.84928006 124 9.32224524 1.18867005 125 0.11523173 9.32224524 126 0.38759854 0.11523173 127 3.75608342 0.38759854 128 3.01501893 3.75608342 129 -2.73467152 3.01501893 130 3.38239927 -2.73467152 131 5.50672221 3.38239927 132 0.04559621 5.50672221 133 4.16863166 0.04559621 134 -3.37955644 4.16863166 135 4.62379374 -3.37955644 136 1.20156652 4.62379374 137 -3.70458998 1.20156652 138 1.48857914 -3.70458998 139 1.76095384 1.48857914 140 2.70828850 1.76095384 141 -1.73491355 2.70828850 142 -10.15061878 -1.73491355 143 -5.00728824 -10.15061878 144 -4.29438240 -5.00728824 145 6.46385132 -4.29438240 146 NA 6.46385132 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.25695789 0.94823308 [2,] -2.95991653 -3.25695789 [3,] 0.58710400 -2.95991653 [4,] 2.56996986 0.58710400 [5,] 3.91920277 2.56996986 [6,] 1.16604215 3.91920277 [7,] 1.87868985 1.16604215 [8,] 0.08530464 1.87868985 [9,] 5.11713313 0.08530464 [10,] 6.16233119 5.11713313 [11,] 0.67991710 6.16233119 [12,] 1.78046663 0.67991710 [13,] -0.75523509 1.78046663 [14,] 10.12885183 -0.75523509 [15,] 5.49960373 10.12885183 [16,] 4.24076440 5.49960373 [17,] -12.51093990 4.24076440 [18,] 1.58642456 -12.51093990 [19,] 2.20156652 1.58642456 [20,] -9.77831301 2.20156652 [21,] -9.77831301 -9.77831301 [22,] -3.01209751 -9.77831301 [23,] -6.24842568 -3.01209751 [24,] -1.67591647 -6.24842568 [25,] -0.06699898 -1.67591647 [26,] -1.66880903 -0.06699898 [27,] -13.88442367 -1.66880903 [28,] -2.51499150 -13.88442367 [29,] 2.09252627 -2.51499150 [30,] -1.18116905 2.09252627 [31,] 5.01015639 -1.18116905 [32,] 3.22082284 5.01015639 [33,] 0.83907371 3.22082284 [34,] 5.35625551 0.83907371 [35,] 3.05980902 5.35625551 [36,] -2.40496560 3.05980902 [37,] -2.45402314 -2.40496560 [38,] -5.06396533 -2.45402314 [39,] -1.10977125 -5.06396533 [40,] -1.22462410 -1.10977125 [41,] 1.62263529 -1.22462410 [42,] 1.25087947 1.62263529 [43,] 2.06517806 1.25087947 [44,] -0.41388685 2.06517806 [45,] 0.91154317 -0.41388685 [46,] 5.16268991 0.91154317 [47,] -11.90273327 5.16268991 [48,] 2.23849326 -11.90273327 [49,] -1.65718367 2.23849326 [50,] -2.52825337 -1.65718367 [51,] 0.76918587 -2.52825337 [52,] 3.22725991 0.76918587 [53,] -4.76151505 3.22725991 [54,] 0.34733426 -4.76151505 [55,] 0.40951979 0.34733426 [56,] -1.02458933 0.40951979 [57,] -9.70003370 -1.02458933 [58,] -5.21924203 -9.70003370 [59,] 5.42924187 -5.21924203 [60,] 0.68071050 5.42924187 [61,] 6.18751991 0.68071050 [62,] 3.12341838 6.18751991 [63,] 5.79156225 3.12341838 [64,] 9.72542961 5.79156225 [65,] 4.56606339 9.72542961 [66,] -1.86278865 4.56606339 [67,] 3.28671229 -1.86278865 [68,] -7.85936700 3.28671229 [69,] -8.85936700 -7.85936700 [70,] 3.55225682 -8.85936700 [71,] 3.88898073 3.55225682 [72,] -10.98498170 3.88898073 [73,] -2.10160916 -10.98498170 [74,] -2.66355650 -2.10160916 [75,] -1.10826096 -2.66355650 [76,] -0.14077755 -1.10826096 [77,] -0.57656104 -0.14077755 [78,] 1.67269583 -0.57656104 [79,] 0.55278336 1.67269583 [80,] 6.09431237 0.55278336 [81,] 0.69817344 6.09431237 [82,] -17.80743628 0.69817344 [83,] -2.12425229 -17.80743628 [84,] 2.70828850 -2.12425229 [85,] -1.59779660 2.70828850 [86,] 3.20114037 -1.59779660 [87,] 6.12909410 3.20114037 [88,] -4.60759667 6.12909410 [89,] -1.47657808 -4.60759667 [90,] 3.90257463 -1.47657808 [91,] -1.80406678 3.90257463 [92,] 1.11390343 -1.80406678 [93,] -0.75923560 1.11390343 [94,] 2.24485124 -0.75923560 [95,] -4.49294125 2.24485124 [96,] -5.79778042 -4.49294125 [97,] -2.63338961 -5.79778042 [98,] -2.43971920 -2.63338961 [99,] 9.07293679 -2.43971920 [100,] 1.32408353 9.07293679 [101,] 7.53301674 1.32408353 [102,] 1.73520007 7.53301674 [103,] -10.17630178 1.73520007 [104,] -5.62578738 -10.17630178 [105,] 4.47174663 -5.62578738 [106,] 0.47779912 4.47174663 [107,] 3.31103435 0.47779912 [108,] 5.75277507 3.31103435 [109,] -8.79331197 5.75277507 [110,] -0.06873129 -8.79331197 [111,] 0.84543866 -0.06873129 [112,] 9.07069978 0.84543866 [113,] 5.67071549 9.07069978 [114,] -1.20429256 5.67071549 [115,] 2.67952711 -1.20429256 [116,] -5.72433165 2.67952711 [117,] -0.46947621 -5.72433165 [118,] 1.52143246 -0.46947621 [119,] -1.83222176 1.52143246 [120,] 3.63807735 -1.83222176 [121,] 0.28071727 3.63807735 [122,] -1.84928006 0.28071727 [123,] 1.18867005 -1.84928006 [124,] 9.32224524 1.18867005 [125,] 0.11523173 9.32224524 [126,] 0.38759854 0.11523173 [127,] 3.75608342 0.38759854 [128,] 3.01501893 3.75608342 [129,] -2.73467152 3.01501893 [130,] 3.38239927 -2.73467152 [131,] 5.50672221 3.38239927 [132,] 0.04559621 5.50672221 [133,] 4.16863166 0.04559621 [134,] -3.37955644 4.16863166 [135,] 4.62379374 -3.37955644 [136,] 1.20156652 4.62379374 [137,] -3.70458998 1.20156652 [138,] 1.48857914 -3.70458998 [139,] 1.76095384 1.48857914 [140,] 2.70828850 1.76095384 [141,] -1.73491355 2.70828850 [142,] -10.15061878 -1.73491355 [143,] -5.00728824 -10.15061878 [144,] -4.29438240 -5.00728824 [145,] 6.46385132 -4.29438240 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.25695789 0.94823308 2 -2.95991653 -3.25695789 3 0.58710400 -2.95991653 4 2.56996986 0.58710400 5 3.91920277 2.56996986 6 1.16604215 3.91920277 7 1.87868985 1.16604215 8 0.08530464 1.87868985 9 5.11713313 0.08530464 10 6.16233119 5.11713313 11 0.67991710 6.16233119 12 1.78046663 0.67991710 13 -0.75523509 1.78046663 14 10.12885183 -0.75523509 15 5.49960373 10.12885183 16 4.24076440 5.49960373 17 -12.51093990 4.24076440 18 1.58642456 -12.51093990 19 2.20156652 1.58642456 20 -9.77831301 2.20156652 21 -9.77831301 -9.77831301 22 -3.01209751 -9.77831301 23 -6.24842568 -3.01209751 24 -1.67591647 -6.24842568 25 -0.06699898 -1.67591647 26 -1.66880903 -0.06699898 27 -13.88442367 -1.66880903 28 -2.51499150 -13.88442367 29 2.09252627 -2.51499150 30 -1.18116905 2.09252627 31 5.01015639 -1.18116905 32 3.22082284 5.01015639 33 0.83907371 3.22082284 34 5.35625551 0.83907371 35 3.05980902 5.35625551 36 -2.40496560 3.05980902 37 -2.45402314 -2.40496560 38 -5.06396533 -2.45402314 39 -1.10977125 -5.06396533 40 -1.22462410 -1.10977125 41 1.62263529 -1.22462410 42 1.25087947 1.62263529 43 2.06517806 1.25087947 44 -0.41388685 2.06517806 45 0.91154317 -0.41388685 46 5.16268991 0.91154317 47 -11.90273327 5.16268991 48 2.23849326 -11.90273327 49 -1.65718367 2.23849326 50 -2.52825337 -1.65718367 51 0.76918587 -2.52825337 52 3.22725991 0.76918587 53 -4.76151505 3.22725991 54 0.34733426 -4.76151505 55 0.40951979 0.34733426 56 -1.02458933 0.40951979 57 -9.70003370 -1.02458933 58 -5.21924203 -9.70003370 59 5.42924187 -5.21924203 60 0.68071050 5.42924187 61 6.18751991 0.68071050 62 3.12341838 6.18751991 63 5.79156225 3.12341838 64 9.72542961 5.79156225 65 4.56606339 9.72542961 66 -1.86278865 4.56606339 67 3.28671229 -1.86278865 68 -7.85936700 3.28671229 69 -8.85936700 -7.85936700 70 3.55225682 -8.85936700 71 3.88898073 3.55225682 72 -10.98498170 3.88898073 73 -2.10160916 -10.98498170 74 -2.66355650 -2.10160916 75 -1.10826096 -2.66355650 76 -0.14077755 -1.10826096 77 -0.57656104 -0.14077755 78 1.67269583 -0.57656104 79 0.55278336 1.67269583 80 6.09431237 0.55278336 81 0.69817344 6.09431237 82 -17.80743628 0.69817344 83 -2.12425229 -17.80743628 84 2.70828850 -2.12425229 85 -1.59779660 2.70828850 86 3.20114037 -1.59779660 87 6.12909410 3.20114037 88 -4.60759667 6.12909410 89 -1.47657808 -4.60759667 90 3.90257463 -1.47657808 91 -1.80406678 3.90257463 92 1.11390343 -1.80406678 93 -0.75923560 1.11390343 94 2.24485124 -0.75923560 95 -4.49294125 2.24485124 96 -5.79778042 -4.49294125 97 -2.63338961 -5.79778042 98 -2.43971920 -2.63338961 99 9.07293679 -2.43971920 100 1.32408353 9.07293679 101 7.53301674 1.32408353 102 1.73520007 7.53301674 103 -10.17630178 1.73520007 104 -5.62578738 -10.17630178 105 4.47174663 -5.62578738 106 0.47779912 4.47174663 107 3.31103435 0.47779912 108 5.75277507 3.31103435 109 -8.79331197 5.75277507 110 -0.06873129 -8.79331197 111 0.84543866 -0.06873129 112 9.07069978 0.84543866 113 5.67071549 9.07069978 114 -1.20429256 5.67071549 115 2.67952711 -1.20429256 116 -5.72433165 2.67952711 117 -0.46947621 -5.72433165 118 1.52143246 -0.46947621 119 -1.83222176 1.52143246 120 3.63807735 -1.83222176 121 0.28071727 3.63807735 122 -1.84928006 0.28071727 123 1.18867005 -1.84928006 124 9.32224524 1.18867005 125 0.11523173 9.32224524 126 0.38759854 0.11523173 127 3.75608342 0.38759854 128 3.01501893 3.75608342 129 -2.73467152 3.01501893 130 3.38239927 -2.73467152 131 5.50672221 3.38239927 132 0.04559621 5.50672221 133 4.16863166 0.04559621 134 -3.37955644 4.16863166 135 4.62379374 -3.37955644 136 1.20156652 4.62379374 137 -3.70458998 1.20156652 138 1.48857914 -3.70458998 139 1.76095384 1.48857914 140 2.70828850 1.76095384 141 -1.73491355 2.70828850 142 -10.15061878 -1.73491355 143 -5.00728824 -10.15061878 144 -4.29438240 -5.00728824 145 6.46385132 -4.29438240 > 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/7qhyz1290518064.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/8qhyz1290518064.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/9j8gk1290518064.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/10j8gk1290518064.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/1149eq1290518064.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/12qruv1290518064.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/13fasp1290518064.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/14pj9s1290518064.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/15b2pg1290518064.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/167c571290518064.tab") + } > > try(system("convert tmp/1cpiq1290518064.ps tmp/1cpiq1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/2cpiq1290518064.ps tmp/2cpiq1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/3ng0t1290518064.ps tmp/3ng0t1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/4ng0t1290518064.ps tmp/4ng0t1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/5ng0t1290518064.ps tmp/5ng0t1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/6g7zw1290518064.ps tmp/6g7zw1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/7qhyz1290518064.ps tmp/7qhyz1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/8qhyz1290518064.ps tmp/8qhyz1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/9j8gk1290518064.ps tmp/9j8gk1290518064.png",intern=TRUE)) character(0) > try(system("convert tmp/10j8gk1290518064.ps tmp/10j8gk1290518064.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.800 1.990 7.785