R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(-6,-3,-2,-5,-11,-11,-11,-10,-14,-8,-9,-5,-1,-2,-5,-4,-6,-2,-2,-2,-2,2,1,-8,-1,1,-1,2,2,1,-1,-2,-2,-1,-8,-4,-6,-3,-3,-7,-9,-11,-13,-11,-9,-17,-22,-25,-20,-24,-24,-22,-19,-18,-17,-11,-11,-12,-10,-15,-15,-15,-13,-8,-13,-9,-7,-4,-4,-2,0,-2) > 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] 72 > (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,] -6 -11 -14 -1 -6 -2 -1 2 -2 -6 -9 -9 -20 -19 [2,] -3 -11 -8 -2 -2 2 1 1 -1 -3 -11 -17 -24 -18 [3,] -2 -11 -9 -5 -2 1 -1 -1 -8 -3 -13 -22 -24 -17 [4,] -5 -10 -5 -4 -2 -8 2 -2 -4 -7 -11 -25 -22 -11 [,15] [,16] [,17] [,18] [1,] -11 -15 -13 -4 [2,] -12 -15 -9 -2 [3,] -10 -13 -7 0 [4,] -15 -8 -4 -2 > 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] -4.00 -10.75 -9.00 -3.00 -3.00 -1.75 0.25 0.00 -3.75 -4.75 [11] -11.00 -18.25 -22.50 -16.25 -12.00 -12.75 -8.25 -2.00 > arr.sd [1] 1.825742 0.500000 3.741657 1.825742 2.000000 4.500000 1.500000 1.825742 [9] 3.095696 2.061553 1.632993 6.994045 1.914854 3.593976 2.160247 3.304038 [17] 3.774917 1.632993 > arr.range [1] 4 1 9 4 4 10 3 4 7 4 4 16 4 8 5 7 9 4 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.05538 -0.07627 > (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 1) Calls: lm -> lm.fit -> .Fortran In addition: Warning message: In log(arr.mean) : NaNs produced Execution halted