R version 2.8.0 (2008-10-20) 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(1.29,1.29,1.3,1.3,1.3,1.3,1.31,1.31,1.31,1.31,1.31,1.32,1.32,1.32,1.32,1.33,1.33,1.33,1.34,1.34,1.34,1.34,1.34,1.34,1.34,1.35,1.36,1.36,1.36,1.37,1.37,1.37,1.37,1.37,1.37,1.37,1.38,1.38,1.38,1.39,1.4,1.4,1.4,1.4,1.41,1.42,1.43,1.43,1.43,1.44,1.45,1.45,1.46,1.46,1.47,1.47,1.47,1.48,1.49,1.49,1.49,1.5,1.51,1.51,1.51,1.52,1.52,1.52,1.52,1.53,1.53,1.53,1.53,1.54,1.54,1.55,1.55,1.55,1.56,1.56,1.58,1.58,1.58,1.58,1.58,1.58,1.59,1.59,1.6,1.6,1.6,1.61,1.62,1.62,1.63,1.63) > 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] 96 > (np <- floor(n / par1)) [1] 24 > 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,] 1.29 1.30 1.31 1.32 1.33 1.34 1.34 1.36 1.37 1.38 1.4 1.41 1.43 1.46 [2,] 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.37 1.37 1.38 1.4 1.42 1.44 1.46 [3,] 1.30 1.31 1.31 1.32 1.34 1.34 1.36 1.37 1.37 1.38 1.4 1.43 1.45 1.47 [4,] 1.30 1.31 1.32 1.33 1.34 1.34 1.36 1.37 1.37 1.39 1.4 1.43 1.45 1.47 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 1.47 1.49 1.51 1.52 1.53 1.55 1.58 1.58 1.60 1.62 [2,] 1.48 1.50 1.52 1.53 1.54 1.55 1.58 1.58 1.60 1.62 [3,] 1.49 1.51 1.52 1.53 1.54 1.56 1.58 1.59 1.60 1.63 [4,] 1.49 1.51 1.52 1.53 1.55 1.56 1.58 1.59 1.61 1.63 > 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] 1.2950 1.3050 1.3125 1.3225 1.3350 1.3400 1.3525 1.3675 1.3700 1.3825 [11] 1.4000 1.4225 1.4425 1.4650 1.4825 1.5025 1.5175 1.5275 1.5400 1.5550 [21] 1.5800 1.5850 1.6025 1.6250 > arr.sd [1] 0.005773503 0.005773503 0.005000000 0.005000000 0.005773503 0.000000000 [7] 0.009574271 0.005000000 0.000000000 0.005000000 0.000000000 0.009574271 [13] 0.009574271 0.005773503 0.009574271 0.009574271 0.005000000 0.005000000 [19] 0.008164966 0.005773503 0.000000000 0.005773503 0.005000000 0.005773503 > arr.range [1] 0.01 0.01 0.01 0.01 0.01 0.00 0.02 0.01 0.00 0.01 0.00 0.02 0.02 0.01 0.02 [16] 0.02 0.01 0.01 0.02 0.01 0.00 0.01 0.01 0.01 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.001499 0.002757 > (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