R version 2.6.1 (2007-11-26) Copyright (C) 2007 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.3,103.9,103.9,103.9,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.2,112.3,111.3,111.3,115.3,117.2,118.3,118.3,118.3,119.0,120.6,122.6,122.6,127.4,125.9,121.5,118.8,121.6,122.3,122.7,120.8,120.1,120.1,120.1,120.1,128.4,129.8,129.8,128.6,128.6,133.7,130.0,125.9,129.4,129.4,130.6,130.6,130.6,130.8,129.7,125.8,126.0,125.6,125.4,124.7,126.9,129.1) > 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] 74 > (np <- floor(n / par1)) [1] 6 > 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] [1,] 104.3 108 108.0 119.0 120.1 129.4 [2,] 103.9 108 108.0 120.6 120.1 129.4 [3,] 103.9 108 108.0 122.6 120.1 130.6 [4,] 103.9 108 108.2 122.6 120.1 130.6 [5,] 108.0 108 112.3 127.4 128.4 130.6 [6,] 108.0 108 111.3 125.9 129.8 130.8 [7,] 108.0 108 111.3 121.5 129.8 129.7 [8,] 108.0 108 115.3 118.8 128.6 125.8 [9,] 108.0 108 117.2 121.6 128.6 126.0 [10,] 108.0 108 118.3 122.3 133.7 125.6 [11,] 108.0 108 118.3 122.7 130.0 125.4 [12,] 108.0 108 118.3 120.8 125.9 124.7 > 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] 106.6667 108.0000 112.8750 122.1500 126.2667 128.2167 > arr.sd [1] 1.972231 0.000000 4.383051 2.494539 4.878959 2.460906 > arr.range [1] 3.7 4.1 14.4 23.5 25.7 22.8 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -8.27148 0.09347 > (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