* using log directory 'd:/Rcompile/CRANpkg/local/2.11/MAc.Rcheck' * using R version 2.11.1 Patched (2010-07-29 r52657) * using session charset: ISO8859-1 * checking for file 'MAc/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'MAc' version '1.1' * checking package dependencies ... OK * checking if this is a source package ... OK * checking whether package 'MAc' can be installed ... OK * checking package directory ... OK * checking for portable file names ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking for unstated dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... NOTE CatModGraph: no visible binding for global variable 'z' CatModGraph: no visible binding for global variable 'wi' CatModGraph: no visible binding for global variable 'wi.tau' ForestPlot: no visible binding for global variable 'r' ForestPlot: no visible binding for global variable 'l.ci95' ForestPlot: no visible binding for global variable 'u.ci95' FunnelPlot: no visible binding for global variable 'se.z' FunnelPlot: no visible binding for global variable 'z' FunnelPlot: no visible binding for global variable 'se.z.tau' MAregGraph: no visible binding for global variable 'z' MAregGraph: no visible binding for global variable 'wi' MAregGraph: no visible binding for global variable 'wi.tau' MultiModGraph: no visible binding for global variable 'z' MultiModGraph: no visible binding for global variable 'wi' MultiModGraph: no visible binding for global variable 'wi.tau' mareg.default: no visible global function definition for 'rma' omni: no visible binding for global variable 'g' omni: no visible binding for global variable 'var.g' plotcat: no visible binding for global variable 'wi' plotcat: no visible binding for global variable 'wi.tau' plotcon: no visible binding for global variable 'wi' plotcon: no visible binding for global variable 'wi.tau' stat_sum_single1: no visible binding for global variable 'wi' stat_sum_single2: no visible binding for global variable 'wi.tau' * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking examples ... ERROR Running examples in 'MAc-Ex.R' failed. The error most likely occurred in: > ### * MAc-package > > flush(stderr()); flush(stdout()) > > ### Name: MAc-package > ### Title: Meta-Analysis with Correlations > ### Aliases: MAc-package MAc > ### Keywords: package > > ### ** Examples > > # Examples for each broad area: > > id<-c(1:20) > n<-c(10,20,13,22,28,12,12,36,19,12,36,75,33,121,37,14,40,16,14,20) > r<-c(.68,.56,.23,.64,.49,-.04,.49,.33,.58,.18,-.11,.27,.26,.40,.49, + .51,.40,.34,.42,.16) > mod1<-c(1,2,3,4,1,2,8,7,5,3,9,7,5,4,3,2,3,5,7,1) > dat<-data.frame(id,n,r,mod1) > dat$var.r <- var_r(dat$r, dat$n) # MAc function to derive variance > dat$z <- r_to_z(dat$r) # MAc function to convert to Fisher's z (z') > dat$var.z <- var_z(dat$n) # MAc function for variance of z' > dat$mods2 <- factor(rep(1:2, 10)) > dat id n r mod1 var.r z var.z mods2 1 1 10 0.68 1 0.03211264 0.82911404 0.142857143 1 2 2 20 0.56 2 0.02479710 0.63283319 0.058823529 2 3 3 13 0.23 3 0.07474987 0.23418947 0.100000000 1 4 4 22 0.64 4 0.01659867 0.75817374 0.052631579 2 5 5 28 0.49 1 0.02138696 0.53606034 0.040000000 1 6 6 12 -0.04 2 0.09061841 -0.04002135 0.111111111 2 7 7 12 0.49 8 0.05249527 0.53606034 0.111111111 1 8 8 36 0.33 7 0.02268741 0.34282825 0.030303030 2 9 9 19 0.58 5 0.02446472 0.66246271 0.062500000 1 10 10 12 0.18 3 0.08511361 0.18198269 0.111111111 2 11 11 36 -0.11 9 0.02788418 -0.11044692 0.030303030 1 12 12 75 0.27 7 0.01161506 0.27686382 0.013888889 2 13 13 33 0.26 5 0.02716780 0.26610841 0.033333333 1 14 14 121 0.40 4 0.00588000 0.42364893 0.008474576 2 15 15 37 0.49 3 0.01604022 0.53606034 0.029411765 1 16 16 14 0.51 2 0.04211169 0.56272977 0.090909091 2 17 17 40 0.40 3 0.01809231 0.42364893 0.027027027 1 18 18 16 0.34 5 0.05214422 0.35409253 0.076923077 2 19 19 14 0.42 7 0.05217823 0.44769202 0.090909091 1 20 20 20 0.16 1 0.04997133 0.16138670 0.058823529 2 > > # Note: for all the examples in this manual, we have made up data and manually > # created variables and datasets. If conducting your own meta-analysis, > # a more convenient way for using the functions is to import your data from > # a .csv file (with relevant variables in the dataset). One way to do this: > # dat <- read.csv(file.choose(), header = TRUE) > # > # Then, you can run the functions with this dataset and you do not need to > # manually create your dataset, as we have done above. > > > > # 1. Computations to Calculate Correlations: > > # For example, suppose the primary study reported a t-test value for differences > # between 2 groups and the total sample size. Then, running: > > r_from_t (1.74, 30) r var_r [1,] 0.3123742 0.02808159 > > # reported t-value (1.74) and sample size (30) will output the > # correlation desired for use in the meta-analysis. > > # 2. Within-Study Aggregation of Effect Sizes: > > agg(id = id, r = r, n = n, data=dat) id r n 1 1 0.68 10 2 2 0.56 20 3 3 0.23 13 4 4 0.64 22 5 5 0.49 28 6 6 -0.04 12 7 7 0.49 12 8 8 0.33 36 9 9 0.58 19 10 10 0.18 12 11 11 -0.11 36 12 12 0.27 75 13 13 0.26 33 14 14 0.40 121 15 15 0.49 37 16 16 0.51 14 17 17 0.40 40 18 18 0.34 16 19 19 0.42 14 20 20 0.16 20 > > # where data = data.frame with columns for id, r (correlation coefficient), > # and n (sample size) with multiple rows within each study (multiple > # correlations reported for each study). Outputs an aggregated data.frame > # with 1 effect size per study. > > # 3. Fixed and Random Effects Omnibus Analysis > > omni(es = z, var = var.z, data = dat, type="weighted", method = "random", ztor = TRUE) Note: If using r and the variance of r as input, be sure to leave the default ztor = FALSE, otherwise the output will be inaccurate. If using z' (Fisher's z) and the variance of z' as the input, changing ztor = TRUE will convert z' back to r (for interpretive purposes) after all analyses have been conducted. ---- Model Results: k estimate var se ci.l ci.u z p 1 20 0.3634 0.0022 0.0474 0.2802 0.4413 1 0 Heterogeneity: Q df.Q Qp I2 1 20.9744 19 0.3382 9.4136% > > # where data = data.frame with columns for id, es (r or z') > # , var (variance of r or z'), n (sample size). ztor = if using z', should > # it be converted back to r? see omni documentation for more details. > > # 4. Moderator Analyses: > > # Random effects > mareg(z~ mod1 + mods2, var = var.z, method = "REML", ztor = TRUE, data = dat) Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'metafor' Error in mareg.default(z ~ mod1 + mods2, var = var.z, method = "REML", : could not find function "rma" Calls: mareg -> mareg.default Execution halted