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(236.77,239.23,240.23,240.33,240.33,240.34,240.34,240.27,240.29,240.29,240.29,240.29,240.31,239.95,242.33,242.11,241.53,241.53,241.53,241.41,241.41,241.66,241.8,241.99,246.24,247.57,247.84,248.27,248.3,248.31,248.31,248.38,248.37,248.41,248.68,248.75,248.75,247.95,248.13,247.86,246.23,245.98,245.98,246.27,246.31,246.3,246.67,246.78,246.78,247.91,247.99,248.6,248.68,248.75,248.75,249.03,249.05,249.57,249.35,249.46,249.46,250.82,254.19,255.18,256.68,256.73,256.73,257.39,257.78,258.67,258.71,258.91,258.91,261.38,262.42,262.77,263.24,262.83,262.83,263.09,263.6,265.68,266.08,266.28) > 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] 84 > (np <- floor(n / par1)) [1] 21 > 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] [1,] 236.77 240.33 240.29 240.31 241.53 241.41 246.24 248.30 248.37 248.75 [2,] 239.23 240.34 240.29 239.95 241.53 241.66 247.57 248.31 248.41 247.95 [3,] 240.23 240.34 240.29 242.33 241.53 241.80 247.84 248.31 248.68 248.13 [4,] 240.33 240.27 240.29 242.11 241.41 241.99 248.27 248.38 248.75 247.86 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 246.23 246.31 246.78 248.68 249.05 249.46 256.68 257.78 258.91 263.24 [2,] 245.98 246.30 247.91 248.75 249.57 250.82 256.73 258.67 261.38 262.83 [3,] 245.98 246.67 247.99 248.75 249.35 254.19 256.73 258.71 262.42 262.83 [4,] 246.27 246.78 248.60 249.03 249.46 255.18 257.39 258.91 262.77 263.09 [,21] [1,] 263.60 [2,] 265.68 [3,] 266.08 [4,] 266.28 > 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] 239.1400 240.3200 240.2900 241.1750 241.5000 241.7150 247.4800 248.3250 [9] 248.5525 248.1725 246.1150 246.5150 247.8200 248.8025 249.3575 252.4125 [17] 256.8825 258.5175 261.3700 262.9975 265.4100 > arr.sd [1] 1.65622060 0.03366502 0.00000000 1.21889294 0.06000000 0.24419937 [7] 0.87548082 0.03696846 0.19050372 0.40102992 0.15673757 0.24664414 [13] 0.75872700 0.15521490 0.22381168 2.71243279 0.33915336 0.50275077 [19] 1.74300507 0.20287517 1.23217964 > arr.range [1] 3.56 0.07 0.00 2.38 0.12 0.58 2.03 0.08 0.38 0.89 0.29 0.48 1.82 0.35 0.52 [16] 5.72 0.71 1.13 3.86 0.41 2.68 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -4.86664 0.02201 > (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 Execution halted