R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.38,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.43,1.44,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.48,1.57,1.58,1.58,1.58,1.58,1.59,1.6,1.6,1.61,1.61,1.61,1.62,1.63,1.63,1.64,1.64,1.64,1.64,1.64,1.65,1.65,1.65,1.65,1.65,1.66,1.66,1.67,1.68,1.68,1.68,1.68,1.69,1.7,1.7,1.71,1.72,1.73,1.74,1.74,1.75,1.75,1.75,1.76,1.79,1.83,1.84,1.85,1.87,1.87,1.87,1.88,1.88,1.88,1.88,1.89,1.89,1.89,1.9,1.89) > par1 = '12' > #'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] 132 > (np <- floor(n / par1)) [1] 11 > 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] [1,] 1.38 1.38 1.43 1.43 1.48 1.48 1.48 1.62 1.65 1.72 1.87 [2,] 1.38 1.38 1.43 1.43 1.48 1.48 1.57 1.63 1.66 1.73 1.87 [3,] 1.38 1.38 1.43 1.43 1.48 1.48 1.58 1.63 1.66 1.74 1.87 [4,] 1.38 1.38 1.43 1.43 1.48 1.48 1.58 1.64 1.67 1.74 1.88 [5,] 1.38 1.38 1.43 1.43 1.48 1.48 1.58 1.64 1.68 1.75 1.88 [6,] 1.38 1.38 1.43 1.43 1.48 1.48 1.58 1.64 1.68 1.75 1.88 [7,] 1.38 1.38 1.43 1.44 1.48 1.48 1.59 1.64 1.68 1.75 1.88 [8,] 1.38 1.38 1.43 1.48 1.48 1.48 1.60 1.64 1.68 1.76 1.89 [9,] 1.38 1.38 1.43 1.48 1.48 1.48 1.60 1.65 1.69 1.79 1.89 [10,] 1.38 1.38 1.43 1.48 1.48 1.48 1.61 1.65 1.70 1.83 1.89 [11,] 1.38 1.38 1.43 1.48 1.48 1.48 1.61 1.65 1.70 1.84 1.90 [12,] 1.38 1.43 1.43 1.48 1.48 1.48 1.61 1.65 1.71 1.85 1.89 > 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] 1.380000 1.384167 1.430000 1.451667 1.480000 1.480000 1.582500 1.640000 [9] 1.680000 1.770833 1.882500 > arr.sd [1] 0.000000000 0.014433757 0.000000000 0.025166115 0.000000000 0.000000000 [7] 0.035194266 0.009534626 0.018090681 0.045218326 0.009653073 > arr.range [1] 0.00 0.05 0.00 0.05 0.00 0.00 0.13 0.03 0.06 0.13 0.03 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.04869 0.04038 > (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