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(-0.29289564,-0.251671635,-0.249744233,-0.255666743,-0.235089622,-0.258900271,-0.247052096,-0.280110807,-0.269580237,-0.275094957,-0.291556234,-0.272465107,-0.28941691,-0.302592685,-0.309655053,-0.286349627,-0.303540488,-0.334214787,-0.282097694,-0.269711187,-0.296655547,-0.26683424,-0.27089051,-0.290352301,-0.262404265,-0.242071561,-0.234078116,-0.258770729,-0.238257189,-0.214431611,-0.190192451,-0.19309943,-0.164049512,-0.154084015,-0.196745077,-0.124769887,-0.081643989,-0.120474153,-0.126016841,-0.118333187,-0.054878662,-0.085557888,-0.068600091,-0.045101974,-0.038117322,-0.058264908,-0.146298258,-0.223643676,-0.403467105,-0.419766893,-0.367013922,-0.44036716,-0.437884999,-0.374984401,-0.319516796,-0.234204499,-0.208994128,-0.188621359,-0.175187068) > 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] 59 > (np <- floor(n / par1)) [1] 4 > 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] [1,] -0.2928956 -0.2894169 -0.2624043 -0.08164399 [2,] -0.2516716 -0.3025927 -0.2420716 -0.12047415 [3,] -0.2497442 -0.3096551 -0.2340781 -0.12601684 [4,] -0.2556667 -0.2863496 -0.2587707 -0.11833319 [5,] -0.2350896 -0.3035405 -0.2382572 -0.05487866 [6,] -0.2589003 -0.3342148 -0.2144316 -0.08555789 [7,] -0.2470521 -0.2820977 -0.1901925 -0.06860009 [8,] -0.2801108 -0.2697112 -0.1930994 -0.04510197 [9,] -0.2695802 -0.2966555 -0.1640495 -0.03811732 [10,] -0.2750950 -0.2668342 -0.1540840 -0.05826491 [11,] -0.2915562 -0.2708905 -0.1967451 -0.14629826 [12,] -0.2724651 -0.2903523 -0.1247699 -0.22364368 > 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] -0.26498563 -0.29185925 -0.20607949 -0.09724425 > arr.sd [1] 0.01819542 0.01924885 0.04340368 0.05302213 > arr.range [1] 0.05780602 0.06738055 0.13763438 0.18552635 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.07433 0.19003 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases Calls: lm -> lm.fit In addition: Warning message: In log(arr.mean) : NaNs produced Execution halted