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(161.79,161.79,161.85,161.77,161.86,161.89,161.89,161.89,162.18,162.43,162.58,162.57,162.57,162.57,162.44,162.79,163.15,163.23,163.23,163.23,163.38,163.71,163.73,163.73,163.73,163.73,163.93,164.27,164.57,164.73,164.73,164.76,165.75,165.86,165.99,166.13,166.13,166.13,166.15,166.45,166.48,166.51,166.51,166.51,166.58,166.82,167.35,167.5,167.5,167.6,167.72,167.29,166.98,166.98,166.98,166.98,167.63,167.83,167.85,167.87,167.87,167.96,167.7,169.25,168.79,168.77,168.77,169,168.92,169.23,169.28,169.29) > 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] [1,] 161.79 161.86 162.18 162.57 163.15 163.38 163.73 164.57 165.75 166.13 [2,] 161.79 161.89 162.43 162.57 163.23 163.71 163.73 164.73 165.86 166.13 [3,] 161.85 161.89 162.58 162.44 163.23 163.73 163.93 164.73 165.99 166.15 [4,] 161.77 161.89 162.57 162.79 163.23 163.73 164.27 164.76 166.13 166.45 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 166.48 166.58 167.50 166.98 167.63 167.87 168.79 168.92 [2,] 166.51 166.82 167.60 166.98 167.83 167.96 168.77 169.23 [3,] 166.51 167.35 167.72 166.98 167.85 167.70 168.77 169.28 [4,] 166.51 167.50 167.29 166.98 167.87 169.25 169.00 169.29 > 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] 161.8000 161.8825 162.4400 162.5925 163.2100 163.6375 163.9150 164.6975 [9] 165.9325 166.2150 166.5025 167.0625 167.5275 166.9800 167.7950 168.1950 [17] 168.8325 169.1800 > arr.sd [1] 0.03464102 0.01500000 0.18636881 0.14522970 0.04000000 0.17192537 [7] 0.25475478 0.08616844 0.16418993 0.15695010 0.01500000 0.43423304 [13] 0.18209430 0.00000000 0.11120552 0.71154761 0.11206397 0.17530925 > arr.range [1] 0.08 0.03 0.40 0.35 0.08 0.35 0.54 0.19 0.38 0.32 0.03 0.92 0.43 0.00 0.24 [16] 1.55 0.23 0.37 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -3.77350 0.02381 > (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