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 <- c(1,4,-3,-3,0,6,-1,0,-1,1,-4,-1,-1,0,3,0,8,8,8,8,11,13,5,12,13,9,11,7,12,11,10,13,14,10,13,12,13,17,15,6,9,6,11,12,13,11,16,16,19,14,15,12,14,16,13,13,15,12,13,12,15,10,8,11,8,13,9,8,8,6,8,6,12,16) > par1 = '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par1 <- as.numeric(par1) > (n <- length(x)) [1] 74 > (np <- floor(n / par1)) [1] 18 > arr <- array(NA,dim=c(par1,np)) > j <- 0 > k <- 1 > for (i in 1:(np*par1)) + { + j = j + 1 + arr[j,k] <- x[i] + if (j == par1) { + j = 0 + k=k+1 + } + } > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 1 0 -1 -1 8 11 13 12 14 13 9 13 19 14 [2,] 4 6 1 0 8 13 9 11 10 17 6 11 14 16 [3,] -3 -1 -4 3 8 5 11 10 13 15 11 16 15 13 [4,] -3 0 -1 0 8 12 7 13 12 6 12 16 12 13 [,15] [,16] [,17] [,18] [1,] 15 15 8 8 [2,] 12 10 13 6 [3,] 13 8 9 8 [4,] 12 11 8 6 > arr.mean <- array(NA,dim=np) > arr.sd <- array(NA,dim=np) > arr.range <- array(NA,dim=np) > for (j in 1:np) + { + arr.mean[j] <- mean(arr[,j],na.rm=TRUE) + arr.sd[j] <- sd(arr[,j],na.rm=TRUE) + arr.range[j] <- max(arr[,j],na.rm=TRUE) - min(arr[,j],na.rm=TRUE) + } > arr.mean [1] -0.25 1.25 -1.25 0.50 8.00 10.25 10.00 11.50 12.25 12.75 9.50 14.00 [13] 15.00 14.00 13.00 11.00 9.50 7.00 > arr.sd [1] 3.403430 3.201562 2.061553 1.732051 0.000000 3.593976 2.581989 1.290994 [9] 1.707825 4.787136 2.645751 2.449490 2.943920 1.414214 1.414214 2.943920 [17] 2.380476 1.154701 > arr.range [1] 7 7 5 4 0 8 6 3 4 11 6 5 7 3 3 7 5 2 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.3235390 -0.0007373 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in foreign function call (arg 4) Calls: lm -> lm.fit -> .Fortran In addition: Warning message: In log(arr.mean) : NaNs produced Execution halted