R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), 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 a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("agce-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('agce') Loading required package: nlme > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "REAR" > > ### * REAR > > flush(stderr()); flush(stdout()) > > ### Name: REAR > ### Title: Fit a autoregressive model with random errors > ### Aliases: REAR > ### Keywords: ts multivariate > > ### ** Examples > > data(Bt20) > REAR(Bt20,c(0,3,7,10,14,16)) $Chi [1] 74.9784 $p [1] 1.998401e-15 $df [1] 4 $sum.fit.full Linear mixed-effects model fit by maximum likelihood Data: long.data Log-likelihood: -127.4167 Fixed: y ~ time:group (Intercept) time:group1 time:group2 time:group3 time:group4 time:group5 6.33277950 0.09105128 0.07327563 0.04456276 0.03622121 0.01712958 Random effects: Formula: ~1 | subject (Intercept) Residual StdDev: 0.7094342 0.2649299 Correlation Structure: Continuous AR(1) Formula: ~time | subject Parameter estimate(s): Phi 0.6885185 Number of Observations: 402 Number of Groups: 67 $sum.fit.reduced Linear mixed-effects model fit by maximum likelihood Data: long.data Log-likelihood: -164.9059 Fixed: y ~ time (Intercept) time 6.33145869 0.05145172 Random effects: Formula: ~1 | subject (Intercept) Residual StdDev: 0.7246543 0.3580708 Correlation Structure: Continuous AR(1) Formula: ~time | subject Parameter estimate(s): Phi 0.8409539 Number of Observations: 402 Number of Groups: 67 > > > > cleanEx(); ..nameEx <- "ano.difference" > > ### * ano.difference > > flush(stderr()); flush(stdout()) > > ### Name: ano.difference > ### Title: Performs a simple anova on a vector of measurement (or > ### differences). > ### Aliases: ano.difference > ### Keywords: univar > > ### ** Examples > > data(Bt20) > ano.difference(Bt20, initial=1, final="last", C=NULL, U=NULL, normal=TRUE, rate=TRUE,time=c(0,3,7,10,14,16)) $Ftest [1] 24.69297 $df1 [1] 4 $df2 [1] 62 $p [1] 2.976064e-12 $mean [,1] [1,] 1.5638023 [2,] 1.1480719 [3,] 0.6924789 [4,] 0.5497720 [5,] 0.2659661 $std.mean [,1] [1,] 0.10590392 [2,] 0.10174920 [3,] 0.09472335 [4,] 0.09804798 [5,] 0.10174920 $rate [,1] [1,] 0.09773764 [2,] 0.07175449 [3,] 0.04327993 [4,] 0.03436075 [5,] 0.01662288 $std.rate [,1] [1,] 0.0004136872 [2,] 0.0003974578 [3,] 0.0003700131 [4,] 0.0003829999 [5,] 0.0003974578 > > > > cleanEx(); ..nameEx <- "design.matrix" > > ### * design.matrix > > flush(stderr()); flush(stdout()) > > ### Name: design.matrix > ### Title: Create the design matrix associated to the data. > ### Aliases: design.matrix > ### Keywords: htest > > ### ** Examples > > data(Bt20) > ### Remove the missing values (if any) > Bt20<-remove.NA(Bt20) > X<-design.matrix(Bt20[,1]) > > > > cleanEx(); ..nameEx <- "graph.curve" > > ### * graph.curve > > flush(stderr()); flush(stdout()) > > ### Name: graph.curve > ### Title: Graph the medians tumor volumes at each time point and for each > ### group. > ### Aliases: graph.curve > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > graph.curve(Bt20, c(0,3,7,10,14,16), legend=TRUE) > > > > cleanEx(); ..nameEx <- "growth.curve" > > ### * growth.curve > > flush(stderr()); flush(stdout()) > > ### Name: growth.curve > ### Title: Perform an anova on slopes. > ### Aliases: growth.curve > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > growth.curve(Bt20, C=NULL, U=NULL, normal=TRUE, time=c(0,3,7,10,14,16)) [1] 67 5 $Ftest [1] 17.65069 $df1 [1] 4 $df2 [1] 62 $pvalue [1] 1.019038e-09 $mean time [1,] 6.329481 0.08768128 [2,] 6.455880 0.07247148 [3,] 6.345031 0.04512308 [4,] 6.443194 0.03620417 [5,] 6.082155 0.02052400 $std.mean time [1,] 0.2181693 0.006678190 [2,] 0.2096103 0.006416198 [3,] 0.1951366 0.005973155 [4,] 0.2019856 0.006182803 [5,] 0.2096103 0.006416198 > > > > cleanEx(); ..nameEx <- "hotelling.trace" > > ### * hotelling.trace > > flush(stderr()); flush(stdout()) > > ### Name: hotelling.trace > ### Title: Compute the hotteling trace statistics. > ### Aliases: hotelling.trace > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > ### Remove the missing values (if any) > Bt20<-remove.NA(Bt20) > ###Create the design matrix > X<-design.matrix(Bt20[,1]) > ###Convert as numeric the measurement > Y<-as.matrix(Bt20[,3:dim(Bt20)[2]]) > ### Number of groups > p<-dim(X)[2] > ### Default contrast matrices > C<-cbind(rep(1,p-1),-diag(p-1)) > U<-rbind(rep(1,p),-diag(p)) > ### Compute the Lawley Hotteling trace statistics > tr<-hotelling.trace(X,Y,C,U) > > > > cleanEx(); ..nameEx <- "manova.estimate" > > ### * manova.estimate > > flush(stderr()); flush(stdout()) > > ### Name: manova.estimate > ### Title: Compute the mean estimates. > ### Aliases: manova.estimate > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > ### Remove the missing values (if any) > Bt20<-remove.NA(Bt20) > ###Create the design matrix > X<-design.matrix(Bt20[,1]) > ###Convert as numeric the measurement > Y<-as.matrix(Bt20[,3:dim(Bt20)[2]]) > manova.estimate(Y, X) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 6.200859 6.702002 6.995855 7.279488 7.418083 7.764661 [2,] 6.430949 6.674113 6.974480 7.227629 7.472663 7.579021 [3,] 6.344264 6.472966 6.674682 6.780127 7.017556 7.036743 [4,] 6.496188 6.518924 6.682026 6.747477 6.978797 7.045960 [5,] 6.140311 6.141019 6.174288 6.179354 6.477883 6.406277 > > > > cleanEx(); ..nameEx <- "manova.growth" > > ### * manova.growth > > flush(stderr()); flush(stdout()) > > ### Name: manova.growth > ### Title: Performs a multivariate analysis of variance for growth curve > ### experiments. > ### Aliases: manova.growth > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > manova.growth(Bt20, C=NULL, U=NULL, normal=TRUE) $Ftest [1] 4.089402 $df1 [1] 24 $df2 [1] 222 $pvalue [1] 9.0438e-09 $mean [,1] [,2] [,3] [,4] [,5] [,6] [1,] 6.200859 6.702002 6.995855 7.279488 7.418083 7.764661 [2,] 6.430949 6.674113 6.974480 7.227629 7.472663 7.579021 [3,] 6.344264 6.472966 6.674682 6.780127 7.017556 7.036743 [4,] 6.496188 6.518924 6.682026 6.747477 6.978797 7.045960 [5,] 6.140311 6.141019 6.174288 6.179354 6.477883 6.406277 $std.mean [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.2149809 0.2194613 0.2311010 0.2326478 0.2239464 0.2211113 [2,] 0.2065470 0.2108516 0.2220347 0.2235208 0.2151607 0.2124368 [3,] 0.1922848 0.1962921 0.2067030 0.2080865 0.2003037 0.1977679 [4,] 0.1990337 0.2031817 0.2139580 0.2153900 0.2073340 0.2047093 [5,] 0.2065470 0.2108516 0.2220347 0.2235208 0.2151607 0.2124368 > > > > cleanEx(); ..nameEx <- "remove.NA" > > ### * remove.NA > > flush(stderr()); flush(stdout()) > > ### Name: remove.NA > ### Title: Remove the rows with missing values. > ### Aliases: remove.NA > ### Keywords: NA > > ### ** Examples > > data(Bt20) > remove.NA(Bt20) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 1 6.037871 6.442540 6.663133 6.997596 5.099866 7.318540 [2,] 1 2 6.503695 6.654670 6.908747 7.334688 7.544644 7.597236 [3,] 1 3 5.852655 6.108741 6.295447 6.503152 7.173632 7.345015 [4,] 1 4 6.424923 7.123539 7.492615 7.516855 7.784609 8.195182 [5,] 1 6 5.826000 5.942799 6.228511 6.520621 6.973543 7.206377 [6,] 1 7 5.778835 6.354630 7.089077 7.224981 7.373036 7.561750 [7,] 1 8 6.829662 7.217553 7.769018 7.917624 8.359697 8.565721 [8,] 1 9 6.928255 7.377568 7.668846 7.872115 8.553975 8.429588 [9,] 1 10 6.741432 7.371054 7.477646 7.882305 7.967086 8.185565 [10,] 1 11 6.928701 7.227437 7.407254 8.136248 8.411811 8.517433 [11,] 1 12 4.543295 6.113682 6.416732 6.492240 6.561031 6.761573 [12,] 1 13 6.014984 6.489806 6.533230 6.955433 7.214069 7.491957 [13,] 2 14 5.998937 6.538140 6.886532 7.184629 7.095064 7.231287 [14,] 2 15 6.302676 6.639530 6.494960 6.624741 7.173168 7.227511 [15,] 2 16 5.525453 5.438079 4.653960 5.420535 6.720220 6.061457 [16,] 2 17 6.355818 6.521062 6.833227 6.899649 7.377568 7.441519 [17,] 2 18 6.993015 7.991254 8.229778 8.740817 8.449771 8.481566 [18,] 2 19 6.538258 6.543613 7.253288 7.517305 7.697622 7.848961 [19,] 2 20 5.220940 5.643088 6.145211 6.232600 6.538967 6.639330 [20,] 2 22 6.342812 6.667101 6.813274 7.110808 6.941982 7.201195 [21,] 2 23 7.307873 7.541683 8.365905 8.640295 8.457868 9.045230 [22,] 2 24 6.895106 7.141716 7.474864 7.717628 7.635270 8.083894 [23,] 2 25 6.850294 6.991385 7.544770 7.485899 7.993457 8.020239 [24,] 2 26 6.320338 6.363934 6.766092 6.954162 7.213564 7.394977 [25,] 2 28 6.950815 6.742881 7.206377 7.430114 7.850104 7.850104 [26,] 3 29 7.112151 7.088412 7.234782 7.425409 7.752373 7.859860 [27,] 3 30 5.272526 5.819180 5.647285 5.367709 6.114384 6.298273 [28,] 3 31 6.777286 7.180933 7.231425 7.046056 7.770258 8.039898 [29,] 3 32 6.049733 5.680173 5.942799 5.998937 6.597146 6.784457 [30,] 3 33 6.796824 6.943122 7.038784 7.038784 7.231287 7.048386 [31,] 3 34 6.373320 6.656727 6.848005 6.538140 6.442540 6.442540 [32,] 3 35 6.598488 6.952700 6.944854 6.925998 7.265048 7.174444 [33,] 3 36 6.596243 6.774855 7.222159 7.320195 7.498202 7.407254 [34,] 3 37 7.041330 6.973131 7.060202 7.140633 7.430440 7.886594 [35,] 3 38 6.754843 7.014164 7.053205 7.175072 7.512502 7.189198 [36,] 3 39 5.170484 5.170484 5.420535 6.037871 6.228511 6.249975 [37,] 3 40 6.252570 6.084505 6.361866 6.756818 6.810594 6.673583 [38,] 3 41 6.635891 6.649977 7.086465 7.339279 7.260790 7.275853 [39,] 3 42 5.650855 5.873022 6.259777 6.514949 6.477132 6.450077 [40,] 3 43 6.081413 6.233110 6.768089 7.076050 6.872139 6.770747 [41,] 4 44 5.488938 5.389072 5.730100 5.981414 5.998937 6.354370 [42,] 4 46 6.283870 6.069197 6.318427 6.430214 6.689896 6.914041 [43,] 4 47 8.107117 8.428581 8.224432 8.477412 8.703009 8.835210 [44,] 4 48 6.315358 6.442540 6.800170 6.523562 6.523562 6.692084 [45,] 4 49 7.200976 7.355938 7.068501 7.457610 7.519377 7.735545 [46,] 4 50 6.966024 7.126087 7.136483 6.966024 7.126087 7.071573 [47,] 4 51 6.887553 6.692084 6.692084 7.071573 7.290293 7.385851 [48,] 4 52 6.887553 6.973543 7.290293 7.413970 7.744570 7.647786 [49,] 4 53 6.966991 7.096973 7.343003 7.354360 7.488019 7.453585 [50,] 4 54 6.887553 7.059618 7.215975 6.933423 7.579679 7.614312 [51,] 4 55 6.362639 6.331632 6.515516 6.534364 6.659284 6.468908 [52,] 4 56 6.086775 6.165418 6.523562 6.520621 6.546785 6.625392 [53,] 4 57 6.362147 6.183017 6.515431 6.656997 6.884900 6.961976 [54,] 4 58 4.143135 3.951244 4.174387 4.143135 4.948760 4.882802 [55,] 5 59 6.103081 6.210255 5.975203 5.932368 6.298949 5.820448 [56,] 5 61 6.604982 6.282667 6.594267 6.945082 6.998886 7.110778 [57,] 5 62 7.417674 7.549700 7.906989 7.631896 7.753395 7.686346 [58,] 5 63 7.234519 7.155031 7.328477 7.210765 7.657298 7.861474 [59,] 5 64 4.852030 5.129899 4.653960 4.990433 5.680173 5.525453 [60,] 5 66 6.236452 6.387618 6.218479 6.247137 6.791942 6.808015 [61,] 5 67 5.301557 5.484788 5.762881 5.901998 5.871693 5.754760 [62,] 5 68 6.654153 6.779922 6.828712 7.433075 7.484369 7.484369 [63,] 5 69 4.875168 4.840672 5.368850 5.252506 5.480986 5.697521 [64,] 5 70 5.105945 5.236442 5.303305 5.170484 5.236442 5.236442 [65,] 5 71 6.397880 6.460460 6.623786 6.601830 6.775212 6.841274 [66,] 5 72 6.979145 6.538140 6.037871 5.393628 6.049733 5.680173 [67,] 5 73 6.061457 5.777652 5.662960 5.620401 6.133398 5.774552 > > > > cleanEx(); ..nameEx <- "resamp.std" > > ### * resamp.std > > flush(stderr()); flush(stdout()) > > ### Name: resamp.std > ### Title: Compute the standard deviation by bootstrap. > ### Aliases: resamp.std > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > ###Create the design matrix > X<-design.matrix(Bt20[,1]) > ###Convert as numeric the measurement > Y<-as.matrix(Bt20[,3:dim(Bt20)[2]]) > ### Number of groups > p<-dim(X)[2] > ### Compute the standard deviation associated with the mean > std<-resamp.std(Bt20[,1],Y,X,B=1000) > > > > > cleanEx(); ..nameEx <- "reshape.long" > > ### * reshape.long > > flush(stderr()); flush(stdout()) > > ### Name: reshape.long > ### Title: Reshape the data set in a longitudinal data set in order to use > ### the lme function. > ### Aliases: reshape.long > ### Keywords: multivariate > > ### ** Examples > > data(Bt20) > long.data<-reshape.long(Bt20,c(0,3,7,10,14,16)) > > > > ### *