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(192.89,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25) > par1 = '12' > #'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] 6 > 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] [1,] 192.89 194.76 199.15 200.40 204.15 204.15 [2,] 194.76 194.76 200.40 204.15 204.15 212.25 [3,] 194.76 199.15 200.40 204.15 204.15 212.25 [4,] 194.76 199.15 200.40 204.15 204.15 212.25 [5,] 194.76 199.15 200.40 204.15 204.15 212.25 [6,] 194.76 199.15 200.40 204.15 204.15 212.25 [7,] 194.76 199.15 200.40 204.15 204.15 212.25 [8,] 194.76 199.15 200.40 204.15 204.15 212.25 [9,] 194.76 199.15 200.40 204.15 204.15 212.25 [10,] 194.76 199.15 200.40 204.15 204.15 212.25 [11,] 194.76 199.15 200.40 204.15 204.15 212.25 [12,] 194.76 199.15 200.40 204.15 204.15 212.25 > 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] 194.6042 198.4183 200.2958 203.8375 204.1500 211.5750 > arr.sd [1] 0.5398225 1.7088052 0.3608439 1.0825318 0.0000000 2.3382686 > arr.range [1] 1.87 4.39 1.25 3.75 0.00 8.10 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -14.1756 0.0751 > (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