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(105.18,105.18,105.18,105.18,105.18,105.18,105.18,105.18,105.18,105.18,97.82,97.83,97.82,97.83,97.82,97.82,97.8,97.8,97.44,97.44,97.44,97.44,97.7,97.7,97.7,97.7,97.7,97.7,97.7,97.7,97.7,97.7,97.7,89.38,89.38,89.38,89.38,87.69,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,89.21,92.07,92.07,92.07,92.07,92.07,92.07,92.07,92.07,92.07,92.07,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94) > 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] 96 > (np <- floor(n / par1)) [1] 24 > 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,] 105.18 105.18 105.18 97.82 97.80 97.44 97.7 97.7 97.70 89.38 89.21 89.21 [2,] 105.18 105.18 105.18 97.83 97.80 97.44 97.7 97.7 89.38 87.69 89.21 89.21 [3,] 105.18 105.18 97.82 97.82 97.44 97.70 97.7 97.7 89.38 89.21 89.21 89.21 [4,] 105.18 105.18 97.83 97.82 97.44 97.70 97.7 97.7 89.38 89.21 89.21 89.21 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 89.21 89.21 89.21 89.21 89.21 89.21 92.07 92.07 94 94 94 94 [2,] 89.21 89.21 89.21 89.21 89.21 89.21 92.07 92.07 94 94 94 94 [3,] 89.21 89.21 89.21 89.21 89.21 92.07 92.07 92.07 94 94 94 94 [4,] 89.21 89.21 89.21 89.21 89.21 92.07 92.07 92.07 94 94 94 94 > 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] 105.1800 105.1800 101.5025 97.8225 97.6200 97.5700 97.7000 97.7000 [9] 91.4600 88.8725 89.2100 89.2100 89.2100 89.2100 89.2100 89.2100 [17] 89.2100 90.6400 92.0700 92.0700 94.0000 94.0000 94.0000 94.0000 > arr.sd [1] 0.0000000 0.0000000 4.2464132 0.0050000 0.2078461 0.1501111 0.0000000 [8] 0.0000000 4.1600000 0.7923962 0.0000000 0.0000000 0.0000000 0.0000000 [15] 0.0000000 0.0000000 0.0000000 1.6512218 0.0000000 0.0000000 0.0000000 [22] 0.0000000 0.0000000 0.0000000 > arr.range [1] 0.00 0.00 7.36 0.01 0.36 0.26 0.00 0.00 8.32 1.69 0.00 0.00 0.00 0.00 0.00 [16] 0.00 0.00 2.86 0.00 0.00 0.00 0.00 0.00 0.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1.62611 0.02227 > (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