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(98.19,98.19,98.19,98.19,98.19,98.19,98.19,100.48,102.78,102.78,102.78,102.78,102.78,102.78,102.78,102.78,102.78,102.78,102.78,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,101.67,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,105.79,104.47,104.47,104.47,104.47,104.47,104.47,104.47,104.47,105.5,105.5,105.5,105.5,106.61,106.61,106.61,106.61,106.61) > par1 = '6' > #'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] 60 > (np <- floor(n / par1)) [1] 10 > 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,] 98.19 98.19 102.78 102.78 101.67 101.67 105.79 105.79 104.47 105.50 [2,] 98.19 100.48 102.78 101.67 101.67 105.79 105.79 104.47 104.47 106.61 [3,] 98.19 102.78 102.78 101.67 101.67 105.79 105.79 104.47 104.47 106.61 [4,] 98.19 102.78 102.78 101.67 101.67 105.79 105.79 104.47 105.50 106.61 [5,] 98.19 102.78 102.78 101.67 101.67 105.79 105.79 104.47 105.50 106.61 [6,] 98.19 102.78 102.78 101.67 101.67 105.79 105.79 104.47 105.50 106.61 > 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] 98.1900 101.6317 102.7800 101.8550 101.6700 105.1033 105.7900 104.6900 [9] 104.9850 106.4250 > arr.sd [1] 0.0000000 1.9207334 0.0000000 0.4531556 0.0000000 1.6819830 0.0000000 [8] 0.5388877 0.5641542 0.4531556 > arr.range [1] 0.00 4.59 0.00 1.11 0.00 4.12 0.00 1.32 1.03 1.11 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -3.40431 0.03838 > (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