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(104.7,104.7,104.7,104.7,106,107,107,107,107,107,107,107,107,107,107,107,107.6,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,110.6,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,121.27,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,128.35,128.35,128.35,128.35,128.35,128.35,128.35) > 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] 84 > (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] [1,] 104.7 106 107 107 107.6 109.9 109.9 110.6 114.3 114.3 114.30 119.01 [2,] 104.7 107 107 107 109.9 109.9 109.9 114.3 114.3 114.3 119.01 119.01 [3,] 104.7 107 107 107 109.9 109.9 109.9 114.3 114.3 114.3 119.01 119.01 [4,] 104.7 107 107 107 109.9 109.9 109.9 114.3 114.3 114.3 119.01 119.01 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 119.01 121.27 123.54 123.54 123.54 125.24 125.24 125.24 128.35 [2,] 119.01 123.54 123.54 123.54 125.24 125.24 125.24 128.35 128.35 [3,] 119.01 123.54 123.54 123.54 125.24 125.24 125.24 128.35 128.35 [4,] 119.01 123.54 123.54 123.54 125.24 125.24 125.24 128.35 128.35 > 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] 104.7000 106.7500 107.0000 107.0000 109.3250 109.9000 109.9000 113.3750 [9] 114.3000 114.3000 117.8325 119.0100 119.0100 122.9725 123.5400 123.5400 [17] 124.8150 125.2400 125.2400 127.5725 128.3500 > arr.sd [1] 0.000 0.500 0.000 0.000 1.150 0.000 0.000 1.850 0.000 0.000 2.355 0.000 [13] 0.000 1.135 0.000 0.000 0.850 0.000 0.000 1.555 0.000 > arr.range [1] 0.00 1.00 0.00 0.00 2.30 0.00 0.00 3.70 0.00 0.00 4.71 0.00 0.00 2.27 0.00 [16] 0.00 1.70 0.00 0.00 3.11 0.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.77374 0.01045 > (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