R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(2.2,2.28,2.28,2.28,2.28,2.27,2.28,2.27,2.28,2.28,2.28,2.28,2.27,2.28,2.28,2.28,2.27,2.28,2.27,2.27,2.27,2.27,2.27,2.27,2.27,2.35,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] [1,] 2.20 2.27 2.27 2.54 2.54 2.66 2.66 [2,] 2.28 2.28 2.35 2.54 2.66 2.66 2.93 [3,] 2.28 2.28 2.54 2.54 2.66 2.66 2.93 [4,] 2.28 2.28 2.54 2.54 2.66 2.66 2.93 [5,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 [6,] 2.27 2.28 2.54 2.54 2.66 2.66 2.93 [7,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 [8,] 2.27 2.27 2.54 2.54 2.66 2.66 2.93 [9,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 [10,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 [11,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 [12,] 2.28 2.27 2.54 2.54 2.66 2.66 2.93 > 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] 2.271667 2.273333 2.501667 2.540000 2.650000 2.660000 2.907500 > arr.sd [1] 0.02289634 0.00492366 0.09113759 0.00000000 0.03464102 0.00000000 0.07794229 > arr.range [1] 0.08 0.01 0.27 0.00 0.12 0.00 0.27 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.13899 0.06765 > (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