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. Natural language support but running in an English locale 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(217.8,218.79,218.99,219.53,219.55,219.74,219.74,219.74,219.8,219.97,220.07,220.07,220.1,225.8,233.17,233.83,233.63,233.63,233.65,233.8,233.84,233.74,233.88,233.88,233.81,234.68,236.14,236.91,236.87,236.78,236.78,236.9,236.94,236.97,236.96,236.94,236.99,237.24,237.62,237.54,237.41,237.4,237.41,237.28,237.17,237.18,237.18,237.18,236.77,239.23,240.23,240.33,240.33,240.34,240.34,240.27,240.29,240.29,240.29,240.29,240.31,239.95,242.33,242.11,241.53,241.53,241.53,241.41,241.41,241.66,241.8,241.99) > 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,] 217.80 219.55 219.80 220.10 233.63 233.84 233.81 236.87 236.94 236.99 [2,] 218.79 219.74 219.97 225.80 233.63 233.74 234.68 236.78 236.97 237.24 [3,] 218.99 219.74 220.07 233.17 233.65 233.88 236.14 236.78 236.96 237.62 [4,] 219.53 219.74 220.07 233.83 233.80 233.88 236.91 236.90 236.94 237.54 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 237.41 237.17 236.77 240.33 240.29 240.31 241.53 241.41 [2,] 237.40 237.18 239.23 240.34 240.29 239.95 241.53 241.66 [3,] 237.41 237.18 240.23 240.34 240.29 242.33 241.53 241.80 [4,] 237.28 237.18 240.33 240.27 240.29 242.11 241.41 241.99 > 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] 218.7775 219.6925 219.9775 228.2250 233.6775 233.8350 235.3850 236.8325 [9] 236.9525 237.3475 237.3750 237.1775 239.1400 240.3200 240.2900 241.1750 [17] 241.5000 241.7150 > arr.sd [1] 0.72274362 0.09500000 0.12737739 6.52598141 0.08220908 0.06608076 [7] 1.39920215 0.06184658 0.01500000 0.28906458 0.06350853 0.00500000 [13] 1.65622060 0.03366502 0.00000000 1.21889294 0.06000000 0.24419937 > arr.range [1] 1.73 0.19 0.27 13.73 0.17 0.14 3.10 0.12 0.03 0.63 0.13 0.01 [13] 3.56 0.07 0.00 2.38 0.12 0.58 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 8.75009 -0.03433 > (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