R version 2.6.2 (2008-02-08) Copyright (C) 2008 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(3.42,3.42,3.43,3.47,3.51,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.52,3.58,3.6,3.61,3.61,3.61,3.63,3.68,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.69,3.78,3.79,3.79,3.8,3.8,3.8,3.8,3.81,3.95,3.99,4,4.06,4.16,4.19,4.2,4.2,4.2,4.2,4.2,4.23,4.38,4.43,4.44,4.44,4.44,4.44,4.44,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.45,4.46,4.46,4.46,4.48,4.58,4.67,4.68,4.68) > 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,] 3.42 3.51 3.52 3.52 3.61 3.68 3.69 3.69 3.8 3.81 4.06 4.2 4.23 4.44 [2,] 3.42 3.52 3.52 3.52 3.61 3.69 3.69 3.78 3.8 3.95 4.16 4.2 4.38 4.44 [3,] 3.43 3.52 3.52 3.58 3.61 3.69 3.69 3.79 3.8 3.99 4.19 4.2 4.43 4.44 [4,] 3.47 3.52 3.52 3.60 3.63 3.69 3.69 3.79 3.8 4.00 4.20 4.2 4.44 4.44 [,15] [,16] [,17] [,18] [1,] 4.45 4.45 4.46 4.58 [2,] 4.45 4.45 4.46 4.67 [3,] 4.45 4.45 4.46 4.68 [4,] 4.45 4.45 4.48 4.68 > 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] 3.4350 3.5175 3.5200 3.5550 3.6150 3.6875 3.6900 3.7625 3.8000 3.9375 [11] 4.1525 4.2000 4.3700 4.4400 4.4500 4.4500 4.4650 4.6525 > arr.sd [1] 0.02380476 0.00500000 0.00000000 0.04123106 0.01000000 0.00500000 [7] 0.00000000 0.04856267 0.00000000 0.08770215 0.06396614 0.00000000 [13] 0.09695360 0.00000000 0.00000000 0.00000000 0.01000000 0.04856267 > arr.range [1] 0.05 0.01 0.00 0.08 0.02 0.01 0.00 0.10 0.00 0.19 0.14 0.00 0.21 0.00 0.00 [16] 0.00 0.02 0.10 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.02104 0.01143 > (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