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(5.44,5.44,5.44,5.44,5.44,5.49,5.49,5.49,5.49,5.49,5.49,5.60,5.60,5.60,5.60,5.60,5.60,5.60,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.67,5.82,5.82,5.95,5.95,5.95,5.95,5.95,5.95,6.02,6.02,6.05,6.05,6.05,6.12,6.12,6.12,6.12,6.12,6.12,6.12,6.12,6.17,6.17,6.17,6.17,6.17,6.28,6.27,6.28,6.28,6.27,6.27,6.28,6.59,6.59,6.59,6.59,6.59,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.63,6.79,6.79,6.79,6.81,6.80,6.80,6.85,6.85,6.85,6.85,6.85,6.85,6.86,6.86,6.88,6.88,6.88,6.91,6.91,6.91,6.91,6.99,6.99,6.99,7.02,7.02,7.05,7.05,7.05,7.05,7.10,7.10,7.10,7.10,7.12,7.13,7.18) > 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] 119 > (np <- floor(n / par1)) [1] 29 > 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,] 5.44 5.44 5.49 5.6 5.60 5.67 5.67 5.82 5.95 6.02 6.12 6.12 6.17 6.17 [2,] 5.44 5.49 5.49 5.6 5.60 5.67 5.67 5.95 5.95 6.05 6.12 6.12 6.17 6.28 [3,] 5.44 5.49 5.49 5.6 5.67 5.67 5.67 5.95 5.95 6.05 6.12 6.12 6.17 6.27 [4,] 5.44 5.49 5.60 5.6 5.67 5.67 5.82 5.95 6.02 6.05 6.12 6.12 6.17 6.28 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 6.28 6.59 6.59 6.63 6.63 6.63 6.63 6.79 6.85 6.85 6.88 6.91 [2,] 6.27 6.59 6.63 6.63 6.63 6.63 6.63 6.81 6.85 6.85 6.88 6.91 [3,] 6.27 6.59 6.63 6.63 6.63 6.63 6.79 6.80 6.85 6.86 6.88 6.91 [4,] 6.28 6.59 6.63 6.63 6.63 6.63 6.79 6.80 6.85 6.86 6.91 6.99 [,27] [,28] [,29] [1,] 6.99 7.05 7.1 [2,] 6.99 7.05 7.1 [3,] 7.02 7.05 7.1 [4,] 7.02 7.05 7.1 > 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] 5.4400 5.4775 5.5175 5.6000 5.6350 5.6700 5.7075 5.9175 5.9675 6.0425 [11] 6.1200 6.1200 6.1700 6.2500 6.2750 6.5900 6.6200 6.6300 6.6300 6.6300 [21] 6.7100 6.8000 6.8500 6.8550 6.8875 6.9300 7.0050 7.0500 7.1000 > arr.sd [1] 0.000000000 0.025000000 0.055000000 0.000000000 0.040414519 0.000000000 [7] 0.075000000 0.065000000 0.035000000 0.015000000 0.000000000 0.000000000 [13] 0.000000000 0.053541261 0.005773503 0.000000000 0.020000000 0.000000000 [19] 0.000000000 0.000000000 0.092376043 0.008164966 0.000000000 0.005773503 [25] 0.015000000 0.040000000 0.017320508 0.000000000 0.000000000 > arr.range [1] 0.00 0.05 0.11 0.00 0.07 0.00 0.15 0.13 0.07 0.03 0.00 0.00 0.00 0.11 0.01 [16] 0.00 0.04 0.00 0.00 0.00 0.16 0.02 0.00 0.01 0.03 0.08 0.03 0.00 0.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.08991 -0.01113 > (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