R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(14 + ,9 + ,23 + ,26 + ,9 + ,15 + ,6 + ,11 + ,13 + ,4 + ,18 + ,9 + ,21 + ,20 + ,9 + ,15 + ,6 + ,12 + ,16 + ,4 + ,11 + ,9 + ,21 + ,21 + ,9 + ,14 + ,13 + ,15 + ,19 + ,6 + ,12 + ,9 + ,21 + ,31 + ,14 + ,10 + ,8 + ,10 + ,15 + ,8 + ,16 + ,9 + ,24 + ,21 + ,8 + ,10 + ,7 + ,12 + ,14 + ,8 + ,18 + ,9 + ,22 + ,18 + ,8 + ,12 + ,9 + ,11 + ,13 + ,4 + ,14 + ,9 + ,21 + ,26 + ,11 + ,18 + ,5 + ,5 + ,19 + ,4 + ,14 + ,9 + ,22 + ,22 + ,10 + ,12 + ,8 + ,16 + ,15 + ,5 + ,15 + ,9 + ,21 + ,22 + ,9 + ,14 + ,9 + ,11 + ,14 + ,5 + ,15 + ,9 + ,20 + ,29 + ,15 + ,18 + ,11 + ,15 + ,15 + ,8 + ,17 + ,9 + ,22 + ,15 + ,14 + ,9 + ,8 + ,12 + ,16 + ,4 + ,19 + ,9 + ,21 + ,16 + ,11 + ,11 + ,11 + ,9 + ,16 + ,4 + ,10 + ,9 + ,21 + ,24 + ,14 + ,11 + ,12 + ,11 + ,16 + ,4 + ,18 + ,9 + ,23 + ,17 + ,6 + ,17 + ,8 + ,15 + ,17 + ,4 + ,14 + ,9 + ,22 + ,19 + ,20 + ,8 + ,7 + ,12 + ,15 + ,4 + ,14 + ,9 + ,23 + ,22 + ,9 + ,16 + ,9 + ,16 + ,15 + ,8 + ,17 + ,9 + ,22 + ,31 + ,10 + ,21 + ,12 + ,14 + ,20 + ,4 + ,14 + ,9 + ,24 + ,28 + ,8 + ,24 + ,20 + ,11 + ,18 + ,4 + ,16 + ,9 + ,23 + ,38 + ,11 + ,21 + ,7 + ,10 + ,16 + ,4 + ,18 + ,9 + ,21 + ,26 + ,14 + ,14 + ,8 + ,7 + ,16 + ,4 + ,14 + ,9 + ,23 + ,25 + ,11 + ,7 + ,8 + ,11 + ,19 + ,8 + ,12 + ,9 + ,23 + ,25 + ,16 + ,18 + ,16 + ,10 + ,16 + ,3 + ,17 + ,9 + ,21 + ,29 + ,14 + ,18 + ,10 + ,11 + ,17 + ,4 + ,9 + ,9 + ,20 + ,28 + ,11 + ,13 + ,6 + ,16 + ,17 + ,4 + ,16 + ,9 + ,32 + ,15 + ,11 + ,11 + ,8 + ,14 + ,16 + ,4 + ,14 + ,9 + ,22 + ,18 + ,12 + ,13 + ,9 + ,12 + ,15 + ,10 + ,11 + ,9 + ,21 + ,21 + ,9 + ,13 + ,9 + ,12 + ,14 + ,5 + ,16 + ,9 + ,21 + ,25 + ,7 + ,18 + ,11 + ,11 + ,15 + ,4 + ,13 + ,9 + ,21 + ,23 + ,13 + ,14 + ,12 + ,6 + ,12 + ,4 + ,17 + ,9 + ,22 + ,23 + ,10 + ,12 + ,8 + ,14 + ,14 + ,4 + ,15 + ,9 + ,21 + ,19 + ,9 + ,9 + ,7 + ,9 + ,16 + ,4 + ,14 + ,9 + ,21 + ,18 + ,9 + ,12 + ,8 + ,15 + ,14 + ,4 + ,16 + ,9 + ,21 + ,18 + ,13 + ,8 + ,9 + ,12 + ,7 + ,10 + ,9 + ,9 + ,22 + ,26 + ,16 + ,5 + ,4 + ,12 + ,10 + ,4 + ,15 + ,9 + ,21 + ,18 + ,12 + ,10 + ,8 + ,9 + ,14 + ,8 + ,17 + ,9 + ,21 + ,18 + ,6 + ,11 + ,8 + ,13 + ,16 + ,4 + ,13 + ,9 + ,21 + ,28 + ,14 + ,11 + ,8 + ,15 + ,16 + ,4 + ,15 + ,9 + ,21 + ,17 + ,14 + ,12 + ,6 + ,11 + ,16 + ,4 + ,16 + ,9 + ,23 + ,29 + ,10 + ,12 + ,8 + ,10 + ,14 + ,7 + ,16 + ,9 + ,21 + ,12 + ,4 + ,15 + ,4 + ,13 + ,20 + ,4 + ,12 + ,9 + ,23 + ,28 + ,12 + ,16 + ,14 + ,16 + ,14 + ,4 + ,11 + ,9 + ,23 + ,20 + ,14 + ,14 + ,10 + ,13 + ,11 + ,4 + ,15 + ,9 + ,21 + ,17 + ,9 + ,17 + ,9 + ,14 + ,15 + ,4 + ,17 + ,9 + ,20 + ,17 + ,9 + ,13 + ,6 + ,14 + ,16 + ,6 + ,13 + ,9 + ,21 + ,20 + ,10 + ,10 + ,8 + ,16 + ,14 + ,5 + ,16 + ,9 + ,20 + ,31 + ,14 + ,17 + ,11 + ,9 + ,16 + ,16 + ,14 + ,9 + ,21 + ,21 + ,10 + ,12 + ,8 + ,8 + ,14 + ,5 + ,11 + ,9 + ,21 + ,19 + ,9 + ,13 + ,8 + ,8 + ,12 + ,12 + ,12 + ,9 + ,22 + ,23 + ,14 + ,13 + ,10 + ,12 + ,16 + ,6 + ,12 + ,9 + ,21 + ,15 + ,8 + ,11 + ,8 + ,10 + ,9 + ,9 + ,15 + ,9 + ,21 + ,24 + ,9 + ,13 + ,10 + ,16 + ,14 + ,9 + ,16 + ,9 + ,22 + ,28 + ,8 + ,12 + ,7 + ,13 + ,16 + ,4 + ,15 + ,9 + ,20 + ,16 + ,9 + ,12 + ,8 + ,11 + ,16 + ,4 + ,12 + ,9 + ,22 + ,19 + ,9 + ,12 + ,7 + ,14 + ,15 + ,4 + ,12 + ,9 + ,22 + ,21 + ,9 + ,9 + ,9 + ,15 + ,16 + ,5 + ,8 + ,9 + ,21 + ,21 + ,15 + ,7 + ,5 + ,8 + ,12 + ,4 + ,13 + ,9 + ,23 + ,20 + ,8 + ,17 + ,7 + ,9 + ,16 + ,5 + ,11 + ,9 + ,22 + ,16 + ,10 + ,12 + ,7 + ,17 + ,16 + ,4 + ,14 + ,9 + ,24 + ,25 + ,8 + ,12 + ,7 + ,9 + ,14 + ,6 + ,15 + ,9 + ,23 + ,30 + ,14 + ,9 + ,9 + ,13 + ,16 + ,4 + ,10 + ,10 + ,21 + ,29 + ,11 + ,9 + ,5 + ,6 + ,17 + ,4 + ,11 + ,10 + ,22 + ,22 + ,10 + ,13 + ,8 + ,13 + ,18 + ,18 + ,12 + ,10 + ,22 + ,19 + ,12 + ,10 + ,8 + ,8 + ,18 + ,4 + ,15 + ,10 + ,21 + ,33 + ,14 + ,11 + ,8 + ,12 + ,12 + ,4 + ,15 + ,10 + ,21 + ,17 + ,9 + ,12 + ,9 + ,13 + ,16 + ,6 + ,14 + ,10 + ,21 + ,9 + ,13 + ,10 + ,6 + ,14 + ,10 + ,4 + ,16 + ,10 + ,21 + ,14 + ,15 + ,13 + ,8 + ,11 + ,14 + ,5 + ,15 + ,10 + ,20 + ,15 + ,8 + ,6 + ,6 + ,15 + ,18 + ,4 + ,15 + ,10 + ,22 + ,12 + ,7 + ,7 + ,4 + ,7 + ,18 + ,4 + ,13 + ,10 + ,22 + ,21 + ,10 + ,13 + ,6 + ,16 + ,16 + ,5 + ,17 + ,10 + ,22 + ,20 + ,10 + ,11 + ,4 + ,16 + ,16 + ,5 + ,13 + ,10 + ,23 + ,29 + ,13 + ,18 + ,12 + ,14 + ,16 + ,8 + ,15 + ,10 + ,21 + ,33 + ,11 + ,9 + ,6 + ,11 + ,13 + ,5 + ,13 + ,10 + ,23 + ,21 + ,8 + ,9 + ,11 + ,13 + ,16 + ,4 + ,15 + ,10 + ,22 + ,15 + ,12 + ,11 + ,8 + ,13 + ,16 + ,4 + ,16 + ,10 + ,21 + ,19 + ,9 + ,11 + ,10 + ,7 + ,20 + ,4 + ,15 + ,10 + ,21 + ,23 + ,10 + ,15 + ,10 + ,15 + ,16 + ,5 + ,16 + ,10 + ,20 + ,20 + ,11 + ,8 + ,4 + ,11 + ,15 + ,4 + ,15 + ,10 + ,24 + ,20 + ,11 + ,11 + ,8 + ,15 + ,15 + ,4 + ,14 + ,10 + ,24 + ,18 + ,10 + ,14 + ,9 + ,13 + ,16 + ,4 + ,15 + ,10 + ,21 + ,31 + ,16 + ,14 + ,9 + ,11 + ,14 + ,8 + ,7 + ,10 + ,20 + ,18 + ,16 + ,12 + ,7 + ,12 + ,15 + ,14 + ,17 + ,10 + ,21 + ,13 + ,8 + ,12 + ,7 + ,10 + ,12 + ,4 + ,13 + ,10 + ,21 + ,9 + ,6 + ,8 + ,11 + ,12 + ,17 + ,8 + ,15 + ,10 + ,21 + ,20 + ,11 + ,11 + ,8 + ,12 + ,16 + ,8 + ,14 + ,10 + ,21 + ,18 + ,12 + ,10 + ,8 + ,12 + ,15 + ,4 + ,13 + ,10 + ,22 + ,23 + ,14 + ,17 + ,7 + ,14 + ,13 + ,6 + ,16 + ,10 + ,22 + ,17 + ,9 + ,16 + ,5 + ,6 + ,16 + ,4 + ,12 + ,10 + ,21 + ,17 + ,11 + ,13 + ,7 + ,14 + ,16 + ,7 + ,14 + ,10 + ,22 + ,16 + ,8 + ,15 + ,9 + ,15 + ,16 + ,3 + ,17 + ,10 + ,21 + ,31 + ,8 + ,11 + ,8 + ,8 + ,16 + ,4 + ,15 + ,10 + ,23 + ,15 + ,7 + ,12 + ,6 + ,12 + ,14 + ,4 + ,17 + ,10 + ,21 + ,28 + ,16 + ,16 + ,8 + ,10 + ,16 + ,4 + ,12 + ,10 + ,22 + ,26 + ,13 + ,20 + ,10 + ,15 + ,16 + ,7 + ,16 + ,10 + ,22 + ,20 + ,8 + ,16 + ,10 + ,11 + ,20 + ,4 + ,11 + ,10 + ,22 + ,19 + ,11 + ,11 + ,8 + ,9 + ,15 + ,4 + ,15 + ,10 + ,20 + ,25 + ,14 + ,15 + ,11 + ,14 + ,16 + ,6 + ,9 + ,10 + ,21 + ,18 + ,10 + ,15 + ,8 + ,10 + ,13 + ,8 + ,16 + ,10 + ,21 + ,20 + ,10 + ,12 + ,8 + ,16 + ,17 + ,4 + ,10 + ,10 + ,22 + ,33 + ,14 + ,9 + ,6 + ,5 + ,16 + ,4 + ,10 + ,10 + ,25 + ,24 + ,14 + ,24 + ,20 + ,8 + ,12 + ,4 + ,15 + ,10 + ,22 + ,22 + ,10 + ,15 + ,6 + ,13 + ,16 + ,5 + ,11 + ,10 + ,22 + ,32 + ,12 + ,18 + ,12 + ,16 + ,16 + ,6 + ,13 + ,10 + ,21 + ,31 + ,9 + ,17 + ,9 + ,16 + ,17 + ,4 + ,14 + ,10 + ,22 + ,13 + ,16 + ,12 + ,5 + ,14 + ,13 + ,5 + ,18 + ,10 + ,21 + ,18 + ,8 + ,15 + ,10 + ,14 + ,12 + ,7 + ,16 + ,10 + ,24 + ,17 + ,9 + ,11 + ,5 + ,10 + ,18 + ,4 + ,14 + ,10 + ,23 + ,29 + ,16 + ,11 + ,6 + ,9 + ,14 + ,8 + ,14 + ,10 + ,0 + ,22 + ,13 + ,15 + ,10 + ,14 + ,14 + ,6 + ,14 + ,10 + ,23 + ,18 + ,13 + ,12 + ,6 + ,8 + ,13 + ,8 + ,14 + ,10 + ,22 + ,22 + ,8 + ,14 + ,10 + ,8 + ,16 + ,8 + ,12 + ,10 + ,22 + ,25 + ,14 + ,11 + ,5 + ,16 + ,13 + ,4 + ,14 + ,10 + ,25 + ,20 + ,11 + ,20 + ,13 + ,12 + ,16 + ,5 + ,15 + ,10 + ,23 + ,20 + ,9 + ,11 + ,7 + ,9 + ,13 + ,6 + ,15 + ,10 + ,22 + ,17 + ,8 + ,12 + ,9 + ,15 + ,16 + ,5 + ,13 + ,10 + ,21 + ,26 + ,13 + ,12 + ,8 + ,12 + ,16 + ,5 + ,17 + ,10 + ,21 + ,10 + ,10 + ,11 + ,5 + ,14 + ,15 + ,4 + ,17 + ,10 + ,22 + ,15 + ,8 + ,10 + ,4 + ,12 + ,17 + ,4 + ,19 + ,10 + ,22 + ,20 + ,7 + ,11 + ,9 + ,16 + ,15 + ,6 + ,15 + ,10 + ,21 + ,14 + ,11 + ,12 + ,7 + ,12 + ,12 + ,7 + ,13 + ,10 + ,0 + ,16 + ,11 + ,9 + ,5 + ,14 + ,16 + ,4 + ,9 + ,10 + ,21 + ,23 + ,14 + ,8 + ,5 + ,8 + ,10 + ,10 + ,15 + ,10 + ,22 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,8 + ,15 + ,10 + ,21 + ,19 + ,10 + ,12 + ,7 + ,16 + ,14 + ,5 + ,16 + ,10 + ,24 + ,30 + ,9 + ,15 + ,9 + ,12 + ,15 + ,11 + ,11 + ,10 + ,21 + ,21 + ,12 + ,13 + ,8 + ,4 + ,13 + ,7 + ,14 + ,10 + ,23 + ,20 + ,11 + ,17 + ,8 + ,8 + ,15 + ,4 + ,11 + ,10 + ,23 + ,22 + ,14 + ,14 + ,11 + ,11 + ,11 + ,8 + ,15 + ,10 + ,22 + ,30 + ,12 + ,16 + ,10 + ,4 + ,12 + ,6 + ,13 + ,10 + ,21 + ,25 + ,14 + ,15 + ,9 + ,14 + ,8 + ,4 + ,16 + ,10 + ,21 + ,23 + ,14 + ,11 + ,10 + ,14 + ,15 + ,8 + ,14 + ,10 + ,21 + ,23 + ,8 + ,11 + ,10 + ,13 + ,17 + ,5 + ,15 + ,10 + ,21 + ,21 + ,11 + ,16 + ,7 + ,14 + ,16 + ,4 + ,16 + ,10 + ,22 + ,30 + ,12 + ,15 + ,10 + ,7 + ,10 + ,8 + ,16 + ,10 + ,20 + ,22 + ,9 + ,14 + ,6 + ,19 + ,18 + ,4 + ,11 + ,10 + ,21 + ,32 + ,16 + ,9 + ,6 + ,12 + ,13 + ,6 + ,13 + ,10 + ,23 + ,22 + ,11 + ,13 + ,11 + ,10 + ,15 + ,4 + ,16 + ,9 + ,32 + ,15 + ,11 + ,11 + ,8 + ,14 + ,16 + ,4 + ,12 + ,10 + ,22 + ,21 + ,12 + ,14 + ,9 + ,16 + ,16 + ,6 + ,9 + ,9 + ,24 + ,27 + ,15 + ,11 + ,9 + ,11 + ,14 + ,15 + ,13 + ,10 + ,20 + ,22 + ,13 + ,12 + ,13 + ,16 + ,10 + ,16 + ,13 + ,10 + ,21 + ,9 + ,6 + ,8 + ,11 + ,12 + ,17 + ,8 + ,19 + ,10 + ,22 + ,20 + ,7 + ,11 + ,9 + ,16 + ,15 + ,6 + ,13 + ,10 + ,23 + ,16 + ,8 + ,13 + ,5 + ,12 + ,16 + ,4) + ,dim=c(10 + ,144) + ,dimnames=list(c('Happiness' + ,'Month' + ,'Age' + ,'Concern_over_mistakes' + ,'Doubts_about_actions' + ,'Parental_expectations' + ,'Parental_criticism' + ,'Popularity' + ,'Perceived_learning_competence' + ,'Amotivation') + ,1:144)) > y <- array(NA,dim=c(10,144),dimnames=list(c('Happiness','Month','Age','Concern_over_mistakes','Doubts_about_actions','Parental_expectations','Parental_criticism','Popularity','Perceived_learning_competence','Amotivation'),1:144)) > 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 Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Happiness Month Age Concern_over_mistakes Doubts_about_actions 1 14 9 23 26 9 2 18 9 21 20 9 3 11 9 21 21 9 4 12 9 21 31 14 5 16 9 24 21 8 6 18 9 22 18 8 7 14 9 21 26 11 8 14 9 22 22 10 9 15 9 21 22 9 10 15 9 20 29 15 11 17 9 22 15 14 12 19 9 21 16 11 13 10 9 21 24 14 14 18 9 23 17 6 15 14 9 22 19 20 16 14 9 23 22 9 17 17 9 22 31 10 18 14 9 24 28 8 19 16 9 23 38 11 20 18 9 21 26 14 21 14 9 23 25 11 22 12 9 23 25 16 23 17 9 21 29 14 24 9 9 20 28 11 25 16 9 32 15 11 26 14 9 22 18 12 27 11 9 21 21 9 28 16 9 21 25 7 29 13 9 21 23 13 30 17 9 22 23 10 31 15 9 21 19 9 32 14 9 21 18 9 33 16 9 21 18 13 34 9 9 22 26 16 35 15 9 21 18 12 36 17 9 21 18 6 37 13 9 21 28 14 38 15 9 21 17 14 39 16 9 23 29 10 40 16 9 21 12 4 41 12 9 23 28 12 42 11 9 23 20 14 43 15 9 21 17 9 44 17 9 20 17 9 45 13 9 21 20 10 46 16 9 20 31 14 47 14 9 21 21 10 48 11 9 21 19 9 49 12 9 22 23 14 50 12 9 21 15 8 51 15 9 21 24 9 52 16 9 22 28 8 53 15 9 20 16 9 54 12 9 22 19 9 55 12 9 22 21 9 56 8 9 21 21 15 57 13 9 23 20 8 58 11 9 22 16 10 59 14 9 24 25 8 60 15 9 23 30 14 61 10 10 21 29 11 62 11 10 22 22 10 63 12 10 22 19 12 64 15 10 21 33 14 65 15 10 21 17 9 66 14 10 21 9 13 67 16 10 21 14 15 68 15 10 20 15 8 69 15 10 22 12 7 70 13 10 22 21 10 71 17 10 22 20 10 72 13 10 23 29 13 73 15 10 21 33 11 74 13 10 23 21 8 75 15 10 22 15 12 76 16 10 21 19 9 77 15 10 21 23 10 78 16 10 20 20 11 79 15 10 24 20 11 80 14 10 24 18 10 81 15 10 21 31 16 82 7 10 20 18 16 83 17 10 21 13 8 84 13 10 21 9 6 85 15 10 21 20 11 86 14 10 21 18 12 87 13 10 22 23 14 88 16 10 22 17 9 89 12 10 21 17 11 90 14 10 22 16 8 91 17 10 21 31 8 92 15 10 23 15 7 93 17 10 21 28 16 94 12 10 22 26 13 95 16 10 22 20 8 96 11 10 22 19 11 97 15 10 20 25 14 98 9 10 21 18 10 99 16 10 21 20 10 100 10 10 22 33 14 101 10 10 25 24 14 102 15 10 22 22 10 103 11 10 22 32 12 104 13 10 21 31 9 105 14 10 22 13 16 106 18 10 21 18 8 107 16 10 24 17 9 108 14 10 23 29 16 109 14 10 0 22 13 110 14 10 23 18 13 111 14 10 22 22 8 112 12 10 22 25 14 113 14 10 25 20 11 114 15 10 23 20 9 115 15 10 22 17 8 116 13 10 21 26 13 117 17 10 21 10 10 118 17 10 22 15 8 119 19 10 22 20 7 120 15 10 21 14 11 121 13 10 0 16 11 122 9 10 21 23 14 123 15 10 22 11 6 124 15 10 21 19 10 125 16 10 24 30 9 126 11 10 21 21 12 127 14 10 23 20 11 128 11 10 23 22 14 129 15 10 22 30 12 130 13 10 21 25 14 131 16 10 21 23 14 132 14 10 21 23 8 133 15 10 21 21 11 134 16 10 22 30 12 135 16 10 20 22 9 136 11 10 21 32 16 137 13 10 23 22 11 138 16 9 32 15 11 139 12 10 22 21 12 140 9 9 24 27 15 141 13 10 20 22 13 142 13 10 21 9 6 143 19 10 22 20 7 144 13 10 23 16 8 Parental_expectations Parental_criticism Popularity 1 15 6 11 2 15 6 12 3 14 13 15 4 10 8 10 5 10 7 12 6 12 9 11 7 18 5 5 8 12 8 16 9 14 9 11 10 18 11 15 11 9 8 12 12 11 11 9 13 11 12 11 14 17 8 15 15 8 7 12 16 16 9 16 17 21 12 14 18 24 20 11 19 21 7 10 20 14 8 7 21 7 8 11 22 18 16 10 23 18 10 11 24 13 6 16 25 11 8 14 26 13 9 12 27 13 9 12 28 18 11 11 29 14 12 6 30 12 8 14 31 9 7 9 32 12 8 15 33 8 9 12 34 5 4 12 35 10 8 9 36 11 8 13 37 11 8 15 38 12 6 11 39 12 8 10 40 15 4 13 41 16 14 16 42 14 10 13 43 17 9 14 44 13 6 14 45 10 8 16 46 17 11 9 47 12 8 8 48 13 8 8 49 13 10 12 50 11 8 10 51 13 10 16 52 12 7 13 53 12 8 11 54 12 7 14 55 9 9 15 56 7 5 8 57 17 7 9 58 12 7 17 59 12 7 9 60 9 9 13 61 9 5 6 62 13 8 13 63 10 8 8 64 11 8 12 65 12 9 13 66 10 6 14 67 13 8 11 68 6 6 15 69 7 4 7 70 13 6 16 71 11 4 16 72 18 12 14 73 9 6 11 74 9 11 13 75 11 8 13 76 11 10 7 77 15 10 15 78 8 4 11 79 11 8 15 80 14 9 13 81 14 9 11 82 12 7 12 83 12 7 10 84 8 11 12 85 11 8 12 86 10 8 12 87 17 7 14 88 16 5 6 89 13 7 14 90 15 9 15 91 11 8 8 92 12 6 12 93 16 8 10 94 20 10 15 95 16 10 11 96 11 8 9 97 15 11 14 98 15 8 10 99 12 8 16 100 9 6 5 101 24 20 8 102 15 6 13 103 18 12 16 104 17 9 16 105 12 5 14 106 15 10 14 107 11 5 10 108 11 6 9 109 15 10 14 110 12 6 8 111 14 10 8 112 11 5 16 113 20 13 12 114 11 7 9 115 12 9 15 116 12 8 12 117 11 5 14 118 10 4 12 119 11 9 16 120 12 7 12 121 9 5 14 122 8 5 8 123 6 4 15 124 12 7 16 125 15 9 12 126 13 8 4 127 17 8 8 128 14 11 11 129 16 10 4 130 15 9 14 131 11 10 14 132 11 10 13 133 16 7 14 134 15 10 7 135 14 6 19 136 9 6 12 137 13 11 10 138 11 8 14 139 14 9 16 140 11 9 11 141 12 13 16 142 8 11 12 143 11 9 16 144 13 5 12 Perceived_learning_competence Amotivation 1 13 4 2 16 4 3 19 6 4 15 8 5 14 8 6 13 4 7 19 4 8 15 5 9 14 5 10 15 8 11 16 4 12 16 4 13 16 4 14 17 4 15 15 4 16 15 8 17 20 4 18 18 4 19 16 4 20 16 4 21 19 8 22 16 3 23 17 4 24 17 4 25 16 4 26 15 10 27 14 5 28 15 4 29 12 4 30 14 4 31 16 4 32 14 4 33 7 10 34 10 4 35 14 8 36 16 4 37 16 4 38 16 4 39 14 7 40 20 4 41 14 4 42 11 4 43 15 4 44 16 6 45 14 5 46 16 16 47 14 5 48 12 12 49 16 6 50 9 9 51 14 9 52 16 4 53 16 4 54 15 4 55 16 5 56 12 4 57 16 5 58 16 4 59 14 6 60 16 4 61 17 4 62 18 18 63 18 4 64 12 4 65 16 6 66 10 4 67 14 5 68 18 4 69 18 4 70 16 5 71 16 5 72 16 8 73 13 5 74 16 4 75 16 4 76 20 4 77 16 5 78 15 4 79 15 4 80 16 4 81 14 8 82 15 14 83 12 4 84 17 8 85 16 8 86 15 4 87 13 6 88 16 4 89 16 7 90 16 3 91 16 4 92 14 4 93 16 4 94 16 7 95 20 4 96 15 4 97 16 6 98 13 8 99 17 4 100 16 4 101 12 4 102 16 5 103 16 6 104 17 4 105 13 5 106 12 7 107 18 4 108 14 8 109 14 6 110 13 8 111 16 8 112 13 4 113 16 5 114 13 6 115 16 5 116 16 5 117 15 4 118 17 4 119 15 6 120 12 7 121 16 4 122 10 10 123 16 8 124 14 5 125 15 11 126 13 7 127 15 4 128 11 8 129 12 6 130 8 4 131 15 8 132 17 5 133 16 4 134 10 8 135 18 4 136 13 6 137 15 4 138 16 4 139 16 6 140 14 15 141 10 16 142 17 8 143 15 6 144 16 4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Month 16.85560 -0.07863 Age Concern_over_mistakes 0.01761 -0.01243 Doubts_about_actions Parental_expectations -0.24974 0.08860 Parental_criticism Popularity -0.09262 0.03514 Perceived_learning_competence Amotivation 0.04216 -0.14280 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.7087 -1.5182 0.1290 1.5940 5.0530 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.85560 4.61488 3.652 0.000372 *** Month -0.07863 0.38469 -0.204 0.838341 Age 0.01761 0.06279 0.281 0.779497 Concern_over_mistakes -0.01243 0.03879 -0.320 0.749091 Doubts_about_actions -0.24974 0.07832 -3.189 0.001779 ** Parental_expectations 0.08860 0.06959 1.273 0.205132 Parental_criticism -0.09262 0.08681 -1.067 0.287883 Popularity 0.03514 0.06380 0.551 0.582718 Perceived_learning_competence 0.04216 0.08962 0.470 0.638805 Amotivation -0.14280 0.07384 -1.934 0.055223 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.235 on 134 degrees of freedom Multiple R-squared: 0.1763, Adjusted R-squared: 0.121 F-statistic: 3.187 on 9 and 134 DF, p-value: 0.001596 > 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.3322781 0.66455613 0.66772194 [2,] 0.2955051 0.59101019 0.70449491 [3,] 0.2284169 0.45683380 0.77158310 [4,] 0.2611218 0.52224367 0.73887817 [5,] 0.8844311 0.23113788 0.11556894 [6,] 0.8439214 0.31215721 0.15607861 [7,] 0.8247769 0.35044624 0.17522312 [8,] 0.8609605 0.27807901 0.13903951 [9,] 0.8437481 0.31250385 0.15625192 [10,] 0.8265443 0.34691147 0.17345574 [11,] 0.8360774 0.32784512 0.16392256 [12,] 0.9242467 0.15150662 0.07575331 [13,] 0.9017390 0.19652194 0.09826097 [14,] 0.8985352 0.20292953 0.10146477 [15,] 0.9434900 0.11302006 0.05651003 [16,] 0.9225908 0.15481843 0.07740922 [17,] 0.9126349 0.17473016 0.08736508 [18,] 0.9251648 0.14967031 0.07483516 [19,] 0.9006289 0.19874226 0.09937113 [20,] 0.8742569 0.25148624 0.12574312 [21,] 0.8857929 0.22841413 0.11420706 [22,] 0.9063201 0.18735976 0.09367988 [23,] 0.8915064 0.21698720 0.10849360 [24,] 0.8808555 0.23828897 0.11914448 [25,] 0.8558989 0.28820226 0.14410113 [26,] 0.8404263 0.31914750 0.15957375 [27,] 0.8420741 0.31585180 0.15792590 [28,] 0.8374760 0.32504802 0.16252401 [29,] 0.8059204 0.38815916 0.19407958 [30,] 0.8349454 0.33010921 0.16505461 [31,] 0.8011864 0.39762715 0.19881357 [32,] 0.7943538 0.41129241 0.20564621 [33,] 0.7544914 0.49101718 0.24550859 [34,] 0.8190809 0.36183828 0.18091914 [35,] 0.7991736 0.40165287 0.20082644 [36,] 0.8922260 0.21554797 0.10777398 [37,] 0.8797576 0.24048472 0.12024236 [38,] 0.8799030 0.24019400 0.12009700 [39,] 0.8683987 0.26320261 0.13160130 [40,] 0.8576584 0.28468317 0.14234158 [41,] 0.8393275 0.32134499 0.16067250 [42,] 0.8428167 0.31436663 0.15718332 [43,] 0.8260994 0.34780115 0.17390057 [44,] 0.9103817 0.17923652 0.08961826 [45,] 0.9170858 0.16582848 0.08291424 [46,] 0.9449889 0.11002226 0.05501113 [47,] 0.9323818 0.13523631 0.06761815 [48,] 0.9275726 0.14485488 0.07242744 [49,] 0.9377821 0.12443577 0.06221788 [50,] 0.9206515 0.15869707 0.07934853 [51,] 0.9084315 0.18313698 0.09156849 [52,] 0.9408545 0.11829104 0.05914552 [53,] 0.9322296 0.13554070 0.06777035 [54,] 0.9169845 0.16603109 0.08301554 [55,] 0.9325983 0.13480331 0.06740165 [56,] 0.9196988 0.16060234 0.08030117 [57,] 0.8993873 0.20122548 0.10061274 [58,] 0.8918997 0.21620067 0.10810034 [59,] 0.8921270 0.21574606 0.10787303 [60,] 0.8678205 0.26435910 0.13217955 [61,] 0.8523019 0.29539628 0.14769814 [62,] 0.8446433 0.31071337 0.15535669 [63,] 0.8189481 0.36210382 0.18105191 [64,] 0.8071307 0.38573867 0.19286933 [65,] 0.7713593 0.45728146 0.22864073 [66,] 0.7524921 0.49501570 0.24750785 [67,] 0.7124360 0.57512799 0.28756400 [68,] 0.6729591 0.65408178 0.32704089 [69,] 0.7000611 0.59987776 0.29993888 [70,] 0.8075442 0.38491165 0.19245582 [71,] 0.7937127 0.41257455 0.20628728 [72,] 0.7735346 0.45293088 0.22646544 [73,] 0.7476856 0.50462877 0.25231439 [74,] 0.7041961 0.59160773 0.29580387 [75,] 0.6631401 0.67371990 0.33685995 [76,] 0.6288839 0.74223218 0.37111609 [77,] 0.6207657 0.75846868 0.37923434 [78,] 0.5970051 0.80598976 0.40299488 [79,] 0.5978016 0.80439690 0.40219845 [80,] 0.5513216 0.89735688 0.44867844 [81,] 0.7130619 0.57387628 0.28693814 [82,] 0.6927476 0.61450479 0.30725240 [83,] 0.6575477 0.68490460 0.34245230 [84,] 0.6892208 0.62155834 0.31077917 [85,] 0.6966257 0.60674863 0.30337431 [86,] 0.8920049 0.21599018 0.10799509 [87,] 0.8756425 0.24871497 0.12435748 [88,] 0.8707155 0.25856896 0.12928448 [89,] 0.8784209 0.24315815 0.12157907 [90,] 0.8456586 0.30868286 0.15434143 [91,] 0.8702435 0.25951294 0.12975647 [92,] 0.9004827 0.19903454 0.09951727 [93,] 0.8917922 0.21641558 0.10820779 [94,] 0.8948559 0.21028828 0.10514414 [95,] 0.8751359 0.24972813 0.12486407 [96,] 0.9077121 0.18457577 0.09228789 [97,] 0.8843507 0.23129856 0.11564928 [98,] 0.8896439 0.22071230 0.11035615 [99,] 0.8585691 0.28286179 0.14143090 [100,] 0.8408035 0.31839293 0.15919647 [101,] 0.7996217 0.40075654 0.20037827 [102,] 0.7475148 0.50497046 0.25248523 [103,] 0.7052171 0.58956581 0.29478291 [104,] 0.6392145 0.72157090 0.36078545 [105,] 0.7021546 0.59569072 0.29784536 [106,] 0.7317228 0.53655438 0.26827719 [107,] 0.7329519 0.53409627 0.26704813 [108,] 0.7445717 0.51085667 0.25542834 [109,] 0.7450669 0.50986620 0.25493310 [110,] 0.6997308 0.60053848 0.30026924 [111,] 0.6294171 0.74116589 0.37058294 [112,] 0.5447883 0.91042331 0.45521166 [113,] 0.5043980 0.99120405 0.49560202 [114,] 0.4193943 0.83878856 0.58060572 [115,] 0.3276369 0.65527385 0.67236308 [116,] 0.2980516 0.59610325 0.70194838 [117,] 0.2219259 0.44385189 0.77807405 [118,] 0.2292171 0.45843414 0.77078293 [119,] 0.9811690 0.03766203 0.01883101 > postscript(file="/var/www/html/rcomp/tmp/1k91o1290548303.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/html/rcomp/tmp/2k91o1290548303.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/html/rcomp/tmp/3k91o1290548303.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/html/rcomp/tmp/4d0191290548303.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/html/rcomp/tmp/5d0191290548303.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 = 144 Frequency = 1 1 2 3 4 5 6 -1.11874351 2.68028224 -3.51660629 -0.62237851 1.58126171 3.09334872 7 8 9 10 11 12 -0.98459280 -0.56726320 0.33387253 2.01351526 3.56607902 5.05297431 13 14 15 16 17 18 -3.07598977 1.71900763 2.15240541 -0.66800011 1.83439346 -1.07269348 19 20 21 22 23 24 0.99960369 4.45312011 0.58059360 -0.95666096 3.13856082 -5.70866877 25 26 27 28 29 30 1.39322697 0.74106242 -3.62509518 0.51756977 -0.25964403 2.41480143 31 32 33 34 35 36 0.39748064 -0.91462055 3.78869968 -3.56082755 1.79382204 1.41069779 37 38 39 40 41 42 -0.53730643 1.19264475 2.04071421 -1.05691496 -1.91009145 -2.47146385 43 44 45 46 47 48 -0.28444918 2.05312762 -1.35515184 4.18827802 -0.23883188 -2.51812772 49 50 51 52 53 54 -1.21802259 -2.01258588 0.93547389 0.83566057 0.13435546 -3.01945261 55 56 57 58 59 60 -2.47803978 -4.88346438 -2.44105976 -3.95457008 -0.72640162 1.79242208 61 62 63 64 65 66 -4.02208432 -1.74191797 -1.83742574 1.87753266 0.51575634 0.24683609 67 68 69 70 71 72 2.80749794 0.07229872 -0.24272985 -1.81706850 2.16245034 -0.37458288 73 74 75 76 77 78 1.25602431 -1.55404213 0.93288979 1.47842129 0.45384368 1.78826418 79 80 81 82 83 84 0.68196040 -0.73770880 2.70099510 -4.67155085 2.01948866 -1.51470664 85 86 87 88 89 90 1.36924725 0.15369402 -0.71545150 0.73359991 -2.15094079 -1.52850064 91 92 93 94 95 96 2.32610766 -0.48783922 3.77349893 -1.93464464 0.63995181 -3.08442548 97 98 99 100 101 102 1.76585757 -5.06300580 1.27700482 -3.07082039 -3.20456459 0.12357160 103 104 105 106 107 108 -2.92528781 -2.18636861 0.77467444 3.38157198 0.91650409 1.69910007 109 110 111 112 113 114 0.82281085 0.80181929 -0.31274382 -1.70010983 -0.46388141 0.68819522 115 116 117 118 119 120 0.03532660 -0.57367180 2.11801006 1.64498992 4.06129840 1.13927702 121 122 123 124 125 126 -1.05270810 -3.17719916 -0.04187901 0.44122784 2.15000935 -2.28100695 127 128 129 130 131 132 -0.58607031 -1.63387570 1.63207158 -0.38532313 3.31291125 -0.66313494 133 134 135 136 137 138 0.20458977 2.98518061 0.55972182 -1.40002254 -0.99920802 1.39322697 139 140 141 142 143 144 -1.98550725 -2.46456414 1.54054180 -1.51470664 4.06129840 -2.49120770 > postscript(file="/var/www/html/rcomp/tmp/6d0191290548303.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 = 144 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.11874351 NA 1 2.68028224 -1.11874351 2 -3.51660629 2.68028224 3 -0.62237851 -3.51660629 4 1.58126171 -0.62237851 5 3.09334872 1.58126171 6 -0.98459280 3.09334872 7 -0.56726320 -0.98459280 8 0.33387253 -0.56726320 9 2.01351526 0.33387253 10 3.56607902 2.01351526 11 5.05297431 3.56607902 12 -3.07598977 5.05297431 13 1.71900763 -3.07598977 14 2.15240541 1.71900763 15 -0.66800011 2.15240541 16 1.83439346 -0.66800011 17 -1.07269348 1.83439346 18 0.99960369 -1.07269348 19 4.45312011 0.99960369 20 0.58059360 4.45312011 21 -0.95666096 0.58059360 22 3.13856082 -0.95666096 23 -5.70866877 3.13856082 24 1.39322697 -5.70866877 25 0.74106242 1.39322697 26 -3.62509518 0.74106242 27 0.51756977 -3.62509518 28 -0.25964403 0.51756977 29 2.41480143 -0.25964403 30 0.39748064 2.41480143 31 -0.91462055 0.39748064 32 3.78869968 -0.91462055 33 -3.56082755 3.78869968 34 1.79382204 -3.56082755 35 1.41069779 1.79382204 36 -0.53730643 1.41069779 37 1.19264475 -0.53730643 38 2.04071421 1.19264475 39 -1.05691496 2.04071421 40 -1.91009145 -1.05691496 41 -2.47146385 -1.91009145 42 -0.28444918 -2.47146385 43 2.05312762 -0.28444918 44 -1.35515184 2.05312762 45 4.18827802 -1.35515184 46 -0.23883188 4.18827802 47 -2.51812772 -0.23883188 48 -1.21802259 -2.51812772 49 -2.01258588 -1.21802259 50 0.93547389 -2.01258588 51 0.83566057 0.93547389 52 0.13435546 0.83566057 53 -3.01945261 0.13435546 54 -2.47803978 -3.01945261 55 -4.88346438 -2.47803978 56 -2.44105976 -4.88346438 57 -3.95457008 -2.44105976 58 -0.72640162 -3.95457008 59 1.79242208 -0.72640162 60 -4.02208432 1.79242208 61 -1.74191797 -4.02208432 62 -1.83742574 -1.74191797 63 1.87753266 -1.83742574 64 0.51575634 1.87753266 65 0.24683609 0.51575634 66 2.80749794 0.24683609 67 0.07229872 2.80749794 68 -0.24272985 0.07229872 69 -1.81706850 -0.24272985 70 2.16245034 -1.81706850 71 -0.37458288 2.16245034 72 1.25602431 -0.37458288 73 -1.55404213 1.25602431 74 0.93288979 -1.55404213 75 1.47842129 0.93288979 76 0.45384368 1.47842129 77 1.78826418 0.45384368 78 0.68196040 1.78826418 79 -0.73770880 0.68196040 80 2.70099510 -0.73770880 81 -4.67155085 2.70099510 82 2.01948866 -4.67155085 83 -1.51470664 2.01948866 84 1.36924725 -1.51470664 85 0.15369402 1.36924725 86 -0.71545150 0.15369402 87 0.73359991 -0.71545150 88 -2.15094079 0.73359991 89 -1.52850064 -2.15094079 90 2.32610766 -1.52850064 91 -0.48783922 2.32610766 92 3.77349893 -0.48783922 93 -1.93464464 3.77349893 94 0.63995181 -1.93464464 95 -3.08442548 0.63995181 96 1.76585757 -3.08442548 97 -5.06300580 1.76585757 98 1.27700482 -5.06300580 99 -3.07082039 1.27700482 100 -3.20456459 -3.07082039 101 0.12357160 -3.20456459 102 -2.92528781 0.12357160 103 -2.18636861 -2.92528781 104 0.77467444 -2.18636861 105 3.38157198 0.77467444 106 0.91650409 3.38157198 107 1.69910007 0.91650409 108 0.82281085 1.69910007 109 0.80181929 0.82281085 110 -0.31274382 0.80181929 111 -1.70010983 -0.31274382 112 -0.46388141 -1.70010983 113 0.68819522 -0.46388141 114 0.03532660 0.68819522 115 -0.57367180 0.03532660 116 2.11801006 -0.57367180 117 1.64498992 2.11801006 118 4.06129840 1.64498992 119 1.13927702 4.06129840 120 -1.05270810 1.13927702 121 -3.17719916 -1.05270810 122 -0.04187901 -3.17719916 123 0.44122784 -0.04187901 124 2.15000935 0.44122784 125 -2.28100695 2.15000935 126 -0.58607031 -2.28100695 127 -1.63387570 -0.58607031 128 1.63207158 -1.63387570 129 -0.38532313 1.63207158 130 3.31291125 -0.38532313 131 -0.66313494 3.31291125 132 0.20458977 -0.66313494 133 2.98518061 0.20458977 134 0.55972182 2.98518061 135 -1.40002254 0.55972182 136 -0.99920802 -1.40002254 137 1.39322697 -0.99920802 138 -1.98550725 1.39322697 139 -2.46456414 -1.98550725 140 1.54054180 -2.46456414 141 -1.51470664 1.54054180 142 4.06129840 -1.51470664 143 -2.49120770 4.06129840 144 NA -2.49120770 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.68028224 -1.11874351 [2,] -3.51660629 2.68028224 [3,] -0.62237851 -3.51660629 [4,] 1.58126171 -0.62237851 [5,] 3.09334872 1.58126171 [6,] -0.98459280 3.09334872 [7,] -0.56726320 -0.98459280 [8,] 0.33387253 -0.56726320 [9,] 2.01351526 0.33387253 [10,] 3.56607902 2.01351526 [11,] 5.05297431 3.56607902 [12,] -3.07598977 5.05297431 [13,] 1.71900763 -3.07598977 [14,] 2.15240541 1.71900763 [15,] -0.66800011 2.15240541 [16,] 1.83439346 -0.66800011 [17,] -1.07269348 1.83439346 [18,] 0.99960369 -1.07269348 [19,] 4.45312011 0.99960369 [20,] 0.58059360 4.45312011 [21,] -0.95666096 0.58059360 [22,] 3.13856082 -0.95666096 [23,] -5.70866877 3.13856082 [24,] 1.39322697 -5.70866877 [25,] 0.74106242 1.39322697 [26,] -3.62509518 0.74106242 [27,] 0.51756977 -3.62509518 [28,] -0.25964403 0.51756977 [29,] 2.41480143 -0.25964403 [30,] 0.39748064 2.41480143 [31,] -0.91462055 0.39748064 [32,] 3.78869968 -0.91462055 [33,] -3.56082755 3.78869968 [34,] 1.79382204 -3.56082755 [35,] 1.41069779 1.79382204 [36,] -0.53730643 1.41069779 [37,] 1.19264475 -0.53730643 [38,] 2.04071421 1.19264475 [39,] -1.05691496 2.04071421 [40,] -1.91009145 -1.05691496 [41,] -2.47146385 -1.91009145 [42,] -0.28444918 -2.47146385 [43,] 2.05312762 -0.28444918 [44,] -1.35515184 2.05312762 [45,] 4.18827802 -1.35515184 [46,] -0.23883188 4.18827802 [47,] -2.51812772 -0.23883188 [48,] -1.21802259 -2.51812772 [49,] -2.01258588 -1.21802259 [50,] 0.93547389 -2.01258588 [51,] 0.83566057 0.93547389 [52,] 0.13435546 0.83566057 [53,] -3.01945261 0.13435546 [54,] -2.47803978 -3.01945261 [55,] -4.88346438 -2.47803978 [56,] -2.44105976 -4.88346438 [57,] -3.95457008 -2.44105976 [58,] -0.72640162 -3.95457008 [59,] 1.79242208 -0.72640162 [60,] -4.02208432 1.79242208 [61,] -1.74191797 -4.02208432 [62,] -1.83742574 -1.74191797 [63,] 1.87753266 -1.83742574 [64,] 0.51575634 1.87753266 [65,] 0.24683609 0.51575634 [66,] 2.80749794 0.24683609 [67,] 0.07229872 2.80749794 [68,] -0.24272985 0.07229872 [69,] -1.81706850 -0.24272985 [70,] 2.16245034 -1.81706850 [71,] -0.37458288 2.16245034 [72,] 1.25602431 -0.37458288 [73,] -1.55404213 1.25602431 [74,] 0.93288979 -1.55404213 [75,] 1.47842129 0.93288979 [76,] 0.45384368 1.47842129 [77,] 1.78826418 0.45384368 [78,] 0.68196040 1.78826418 [79,] -0.73770880 0.68196040 [80,] 2.70099510 -0.73770880 [81,] -4.67155085 2.70099510 [82,] 2.01948866 -4.67155085 [83,] -1.51470664 2.01948866 [84,] 1.36924725 -1.51470664 [85,] 0.15369402 1.36924725 [86,] -0.71545150 0.15369402 [87,] 0.73359991 -0.71545150 [88,] -2.15094079 0.73359991 [89,] -1.52850064 -2.15094079 [90,] 2.32610766 -1.52850064 [91,] -0.48783922 2.32610766 [92,] 3.77349893 -0.48783922 [93,] -1.93464464 3.77349893 [94,] 0.63995181 -1.93464464 [95,] -3.08442548 0.63995181 [96,] 1.76585757 -3.08442548 [97,] -5.06300580 1.76585757 [98,] 1.27700482 -5.06300580 [99,] -3.07082039 1.27700482 [100,] -3.20456459 -3.07082039 [101,] 0.12357160 -3.20456459 [102,] -2.92528781 0.12357160 [103,] -2.18636861 -2.92528781 [104,] 0.77467444 -2.18636861 [105,] 3.38157198 0.77467444 [106,] 0.91650409 3.38157198 [107,] 1.69910007 0.91650409 [108,] 0.82281085 1.69910007 [109,] 0.80181929 0.82281085 [110,] -0.31274382 0.80181929 [111,] -1.70010983 -0.31274382 [112,] -0.46388141 -1.70010983 [113,] 0.68819522 -0.46388141 [114,] 0.03532660 0.68819522 [115,] -0.57367180 0.03532660 [116,] 2.11801006 -0.57367180 [117,] 1.64498992 2.11801006 [118,] 4.06129840 1.64498992 [119,] 1.13927702 4.06129840 [120,] -1.05270810 1.13927702 [121,] -3.17719916 -1.05270810 [122,] -0.04187901 -3.17719916 [123,] 0.44122784 -0.04187901 [124,] 2.15000935 0.44122784 [125,] -2.28100695 2.15000935 [126,] -0.58607031 -2.28100695 [127,] -1.63387570 -0.58607031 [128,] 1.63207158 -1.63387570 [129,] -0.38532313 1.63207158 [130,] 3.31291125 -0.38532313 [131,] -0.66313494 3.31291125 [132,] 0.20458977 -0.66313494 [133,] 2.98518061 0.20458977 [134,] 0.55972182 2.98518061 [135,] -1.40002254 0.55972182 [136,] -0.99920802 -1.40002254 [137,] 1.39322697 -0.99920802 [138,] -1.98550725 1.39322697 [139,] -2.46456414 -1.98550725 [140,] 1.54054180 -2.46456414 [141,] -1.51470664 1.54054180 [142,] 4.06129840 -1.51470664 [143,] -2.49120770 4.06129840 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.68028224 -1.11874351 2 -3.51660629 2.68028224 3 -0.62237851 -3.51660629 4 1.58126171 -0.62237851 5 3.09334872 1.58126171 6 -0.98459280 3.09334872 7 -0.56726320 -0.98459280 8 0.33387253 -0.56726320 9 2.01351526 0.33387253 10 3.56607902 2.01351526 11 5.05297431 3.56607902 12 -3.07598977 5.05297431 13 1.71900763 -3.07598977 14 2.15240541 1.71900763 15 -0.66800011 2.15240541 16 1.83439346 -0.66800011 17 -1.07269348 1.83439346 18 0.99960369 -1.07269348 19 4.45312011 0.99960369 20 0.58059360 4.45312011 21 -0.95666096 0.58059360 22 3.13856082 -0.95666096 23 -5.70866877 3.13856082 24 1.39322697 -5.70866877 25 0.74106242 1.39322697 26 -3.62509518 0.74106242 27 0.51756977 -3.62509518 28 -0.25964403 0.51756977 29 2.41480143 -0.25964403 30 0.39748064 2.41480143 31 -0.91462055 0.39748064 32 3.78869968 -0.91462055 33 -3.56082755 3.78869968 34 1.79382204 -3.56082755 35 1.41069779 1.79382204 36 -0.53730643 1.41069779 37 1.19264475 -0.53730643 38 2.04071421 1.19264475 39 -1.05691496 2.04071421 40 -1.91009145 -1.05691496 41 -2.47146385 -1.91009145 42 -0.28444918 -2.47146385 43 2.05312762 -0.28444918 44 -1.35515184 2.05312762 45 4.18827802 -1.35515184 46 -0.23883188 4.18827802 47 -2.51812772 -0.23883188 48 -1.21802259 -2.51812772 49 -2.01258588 -1.21802259 50 0.93547389 -2.01258588 51 0.83566057 0.93547389 52 0.13435546 0.83566057 53 -3.01945261 0.13435546 54 -2.47803978 -3.01945261 55 -4.88346438 -2.47803978 56 -2.44105976 -4.88346438 57 -3.95457008 -2.44105976 58 -0.72640162 -3.95457008 59 1.79242208 -0.72640162 60 -4.02208432 1.79242208 61 -1.74191797 -4.02208432 62 -1.83742574 -1.74191797 63 1.87753266 -1.83742574 64 0.51575634 1.87753266 65 0.24683609 0.51575634 66 2.80749794 0.24683609 67 0.07229872 2.80749794 68 -0.24272985 0.07229872 69 -1.81706850 -0.24272985 70 2.16245034 -1.81706850 71 -0.37458288 2.16245034 72 1.25602431 -0.37458288 73 -1.55404213 1.25602431 74 0.93288979 -1.55404213 75 1.47842129 0.93288979 76 0.45384368 1.47842129 77 1.78826418 0.45384368 78 0.68196040 1.78826418 79 -0.73770880 0.68196040 80 2.70099510 -0.73770880 81 -4.67155085 2.70099510 82 2.01948866 -4.67155085 83 -1.51470664 2.01948866 84 1.36924725 -1.51470664 85 0.15369402 1.36924725 86 -0.71545150 0.15369402 87 0.73359991 -0.71545150 88 -2.15094079 0.73359991 89 -1.52850064 -2.15094079 90 2.32610766 -1.52850064 91 -0.48783922 2.32610766 92 3.77349893 -0.48783922 93 -1.93464464 3.77349893 94 0.63995181 -1.93464464 95 -3.08442548 0.63995181 96 1.76585757 -3.08442548 97 -5.06300580 1.76585757 98 1.27700482 -5.06300580 99 -3.07082039 1.27700482 100 -3.20456459 -3.07082039 101 0.12357160 -3.20456459 102 -2.92528781 0.12357160 103 -2.18636861 -2.92528781 104 0.77467444 -2.18636861 105 3.38157198 0.77467444 106 0.91650409 3.38157198 107 1.69910007 0.91650409 108 0.82281085 1.69910007 109 0.80181929 0.82281085 110 -0.31274382 0.80181929 111 -1.70010983 -0.31274382 112 -0.46388141 -1.70010983 113 0.68819522 -0.46388141 114 0.03532660 0.68819522 115 -0.57367180 0.03532660 116 2.11801006 -0.57367180 117 1.64498992 2.11801006 118 4.06129840 1.64498992 119 1.13927702 4.06129840 120 -1.05270810 1.13927702 121 -3.17719916 -1.05270810 122 -0.04187901 -3.17719916 123 0.44122784 -0.04187901 124 2.15000935 0.44122784 125 -2.28100695 2.15000935 126 -0.58607031 -2.28100695 127 -1.63387570 -0.58607031 128 1.63207158 -1.63387570 129 -0.38532313 1.63207158 130 3.31291125 -0.38532313 131 -0.66313494 3.31291125 132 0.20458977 -0.66313494 133 2.98518061 0.20458977 134 0.55972182 2.98518061 135 -1.40002254 0.55972182 136 -0.99920802 -1.40002254 137 1.39322697 -0.99920802 138 -1.98550725 1.39322697 139 -2.46456414 -1.98550725 140 1.54054180 -2.46456414 141 -1.51470664 1.54054180 142 4.06129840 -1.51470664 143 -2.49120770 4.06129840 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7590u1290548303.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/html/rcomp/tmp/8g0hf1290548303.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/html/rcomp/tmp/9g0hf1290548303.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/html/rcomp/tmp/109ay01290548303.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11usfn1290548303.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12fsvt1290548303.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13b2bk1290548303.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14xls81290548303.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/150mqe1290548303.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16m4pk1290548303.tab") + } > > try(system("convert tmp/1k91o1290548303.ps tmp/1k91o1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/2k91o1290548303.ps tmp/2k91o1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/3k91o1290548303.ps tmp/3k91o1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/4d0191290548303.ps tmp/4d0191290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/5d0191290548303.ps tmp/5d0191290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/6d0191290548303.ps tmp/6d0191290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/7590u1290548303.ps tmp/7590u1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/8g0hf1290548303.ps tmp/8g0hf1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/9g0hf1290548303.ps tmp/9g0hf1290548303.png",intern=TRUE)) character(0) > try(system("convert tmp/109ay01290548303.ps tmp/109ay01290548303.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.102 1.775 10.500