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.35,3.35,3.35,3.4,3.42,3.42,3.42,3.42,3.42,3.42,3.42,3.42,3.42,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] 85 > (np <- floor(n / par1)) [1] 21 > 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.35 3.42 3.42 3.42 3.47 3.52 3.52 3.60 3.63 3.69 3.69 3.79 3.80 4.00 [2,] 3.35 3.42 3.42 3.42 3.51 3.52 3.52 3.61 3.68 3.69 3.69 3.80 3.81 4.06 [3,] 3.35 3.42 3.42 3.42 3.52 3.52 3.52 3.61 3.69 3.69 3.78 3.80 3.95 4.16 [4,] 3.40 3.42 3.42 3.43 3.52 3.52 3.58 3.61 3.69 3.69 3.79 3.80 3.99 4.19 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 4.2 4.20 4.44 4.44 4.45 4.45 4.48 [2,] 4.2 4.23 4.44 4.45 4.45 4.46 4.58 [3,] 4.2 4.38 4.44 4.45 4.45 4.46 4.67 [4,] 4.2 4.43 4.44 4.45 4.45 4.46 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.3625 3.4200 3.4200 3.4225 3.5050 3.5200 3.5350 3.6075 3.6725 3.6900 [11] 3.7375 3.7975 3.8875 4.1025 4.2000 4.3100 4.4400 4.4475 4.4500 4.4575 [21] 4.6025 > arr.sd [1] 0.02500000 0.00000000 0.00000000 0.00500000 0.02380476 0.00000000 [7] 0.03000000 0.00500000 0.02872281 0.00000000 0.05500000 0.00500000 [13] 0.09673848 0.08808140 0.00000000 0.11224972 0.00000000 0.00500000 [19] 0.00000000 0.00500000 0.09322911 > arr.range [1] 0.05 0.00 0.00 0.01 0.05 0.00 0.06 0.01 0.06 0.00 0.10 0.01 0.19 0.19 0.00 [16] 0.23 0.00 0.01 0.00 0.01 0.20 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.06755 0.02447 > (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