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(40.04,40.04,40.03,40.03,41.63,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.38,42.06,42.06,42.05,42.05,42.05,42.05,44.36,44.48,44.49,44.49,44.49,44.49,44.49,44.48,44.48,44.48,44.48,44.48,44.48,44.49,44.49,44.49,44.49,44.49,44.49,44.49,44.49,45.5,45.94,45.95,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.97,46.06,47.9,47.93,47.94,47.94,47.94,47.94,47.94,47.94,47.94,47.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] 72 > (np <- floor(n / par1)) [1] 18 > 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,] 40.04 41.63 42.03 42.03 42.03 42.03 42.05 44.36 44.49 44.48 44.48 44.49 [2,] 40.04 42.03 42.03 42.03 42.03 42.38 42.05 44.48 44.49 44.48 44.49 44.49 [3,] 40.03 42.03 42.03 42.03 42.03 42.06 42.05 44.49 44.49 44.48 44.49 44.49 [4,] 40.03 42.03 42.03 42.03 42.03 42.06 42.05 44.49 44.48 44.48 44.49 44.49 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 44.49 45.96 45.96 45.97 47.94 47.94 [2,] 45.50 45.96 45.96 46.06 47.94 47.94 [3,] 45.94 45.96 45.96 47.90 47.94 47.94 [4,] 45.95 45.96 45.96 47.93 47.94 47.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] 40.0350 41.9300 42.0300 42.0300 42.0300 42.1325 42.0500 44.4550 44.4875 [10] 44.4800 44.4875 44.4900 45.4700 45.9600 45.9600 46.9650 47.9400 47.9400 > arr.sd [1] 0.005773503 0.200000000 0.000000000 0.000000000 0.000000000 0.165604952 [7] 0.000000000 0.063508530 0.005000000 0.000000000 0.005000000 0.000000000 [13] 0.686197251 0.000000000 0.000000000 1.097649003 0.000000000 0.000000000 > arr.range [1] 0.01 0.40 0.00 0.00 0.00 0.35 0.00 0.13 0.01 0.00 0.01 0.00 1.46 0.00 0.00 [16] 1.96 0.00 0.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1.45595 0.03577 > (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