Type: Package
Encoding: UTF-8
Title: Effect Size Computation for Meta Analysis
Version: 0.5.1
Description: Implementation of the web-based 'Practical Meta-Analysis Effect Size Calculator' from David B. Wilson (http://www.campbellcollaboration.org/escalc/html/EffectSizeCalculator-Home.php) in R. Based on the input, the effect size can be returned as standardized mean difference, Cohen's f, Hedges' g, Pearson's r or Fisher's transformation z, odds ratio or log odds, or eta squared effect size.
License: GPL-3
Depends: R (≥ 3.2), stats
Imports: utils
URL: https://strengejacke.github.io/esc
BugReports: https://github.com/strengejacke/esc/issues
RoxygenNote: 7.0.1
NeedsCompilation: no
Packaged: 2019-12-04 09:38:36 UTC; mail
Author: Daniel Lüdecke ORCID iD [aut, cre]
Maintainer: Daniel Lüdecke <d.luedecke@uke.de>
Repository: CRAN
Date/Publication: 2019-12-04 09:50:02 UTC

Effect Size Computation for Meta Analysis

Description

This is an R implementation of the web-based 'Practical Meta-Analysis Effect Size Calculator' from David B. Wilson.

Based on the input, the effect size can be returned as standardized mean difference (d), Hedges' g, correlation coefficient effect size r or Fisher's transformation z, odds ratio or log odds effect size.

Return values

The return value of all functions has the same structure:

Correlation Effect Size

If the correlation effect size r is computed, the transformed Fisher's z and their confidence intervals are also returned. The variance and standard error for the correlation effect size r are always based on Fisher's transformation.

Odds Ratio Effect Size

For odds ratios, the variance and standard error are always returned on the log-scale!

Preparing an Effect Size Data Frame for Meta-Analysis

The results of the effect size calculation functions in this package are returned as list with a esc-class attribute. The combine_esc-function takes one or more of these esc-objects and combines them into a data.frame that can be used as argument for further use, for instance with the rma-function.

    e1 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40,
                  grp2no = 45, study = "Study 1")
    e2 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40, grp2no = 45,
                  es.type = "or", study = "Study 2")
    e3 <- esc_t(p = 0.03, grp1n = 100, grp2n = 150, study = "Study 3")
    e4 <- esc_mean_sd(grp1m = 7, grp1sd = 2, grp1n = 50, grp2m = 9, grp2sd = 3,
                      grp2n = 60, es.type = "logit", study = "Study 4")

    mydat <- combine_esc(e1, e2, e3, e4)

    metafor::rma(yi = es, sei = se, method = "REML", data = mydat)
  

Combine one or more 'esc' objects into a data frame

Description

This method takes one or more objects of class esc (which are returned by each effect size calculation function) and returns the combined result as a single data frame. This can then be used for further computation, e.g. with the rma-function of the metafor-package.

Usage

combine_esc(...)

Arguments

...

One or more objects of class esc

Value

A data frame with all relevant information from the effect size calculation.

See Also

write_esc

Examples

e1 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40,
              grp2no = 45, study = "Study 1")
e2 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40, grp2no = 45,
              es.type = "or", study = "Study 2")
e3 <- esc_t(p = 0.03, grp1n = 100, grp2n = 150, study = "Study 3")
e4 <- esc_mean_sd(grp1m = 7, grp1sd = 2, grp1n = 50, grp2m = 9, grp2sd = 3,
                  grp2n = 60, es.type = "logit", study = "Study 4")

combine_esc(e1, e2, e3, e4)


Convert effect size d into Eta Squared

Description

Compute effect size Eta Squared from effect size d.

Usage

convert_d2etasq(d, se, v, grp1n, grp2n, info = NULL, study = NULL)

Arguments

d

The effect size d.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

References

Cohen J. 1988. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Erlbaum

Examples

# d to eta squared
convert_d2etasq(d = 0.7, se = 0.5, grp1n = 70, grp2n = 80)


Convert effect size d into f

Description

Compute effect size f from effect size d.

Usage

convert_d2f(d, se, v, totaln, info = NULL, study = NULL)

Arguments

d

The effect size d.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

totaln

A vector of total sample size(s).

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

References

Cohen J. 1988. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Erlbaum

Examples

# d to f
convert_d2f(d = 0.2, se = .1, totaln = 50)


Convert effect size d into log odds

Description

Compute effect size log odds from effect size d.

Usage

convert_d2logit(
  d,
  se,
  v,
  totaln,
  es.type = c("logit", "cox"),
  info = NULL,
  study = NULL
)

Arguments

d

The effect size d.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

totaln

A vector of total sample size(s).

es.type

Type of effect size odds ratio that should be returned. May be es.type = "logit" or es.type = "cox" (see 'Details').

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Details

Conversion from d to odds ratios can be done with two methods:

es.type = "logit"

uses the Hasselblad and Hedges logit method.

es.type = "cox"

uses the modified logit method as proposed by Cox. This method performs slightly better for rare or frequent events, i.e. if the success rate is close to 0 or 1.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

Effect size, variance, standard error and confidence intervals are returned on the log-scale. To get the odds ratios and exponentiated confidence intervals, use convert_d2or.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Cox DR. 1970. Analysis of binary data. New York: Chapman & Hall/CRC

Hasselblad V, Hedges LV. 1995. Meta-analysis of screening and diagnostic tests. Psychological Bulletin 117(1): 167–178. doi: 10.1037/0033-2909.117.1.167

Examples

# to logits
convert_d2logit(0.7, se = 0.5)

# to Cox-logits
convert_d2logit(0.7, v = 0.25, es.type = "cox")


Convert effect size d into OR

Description

Compute effect size OR from effect size d.

Usage

convert_d2or(
  d,
  se,
  v,
  totaln,
  es.type = c("logit", "cox"),
  info = NULL,
  study = NULL
)

Arguments

d

The effect size d.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

totaln

A vector of total sample size(s).

es.type

Type of effect size odds ratio that should be returned. May be es.type = "logit" or es.type = "cox" (see 'Details').

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Details

Conversion from d to odds ratios can be done with two methods:

es.type = "logit"

uses the Hasselblad and Hedges logit method.

es.type = "cox"

uses the modified logit method as proposed by Cox. This method performs slightly better for rare or frequent events, i.e. if the success rate is close to 0 or 1.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

Effect size is returned as exp(log_values) (odds ratio), confidence intervals are also exponentiated. To get the log-values, use convert_d2logit. However, variance and standard error of this function are returned on the log-scale!

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Cox DR. 1970. Analysis of binary data. New York: Chapman & Hall/CRC

Hasselblad V, Hedges LV. 1995. Meta-analysis of screening and diagnostic tests. Psychological Bulletin 117(1): 167–178. doi: 10.1037/0033-2909.117.1.167

Borenstein M, Hedges LV, Higgins JPT, Rothstein HR. 2009. Introduction to Meta-Analysis. Chichester, West Sussex, UK: Wiley

Examples

# d to odds ratio
convert_d2or(0.7, se = 0.5)
# odds ratio to d
convert_or2d(3.56, se = 0.91)


Convert effect size d into correlation

Description

Compute effect size correlation from effect size d.

Usage

convert_d2r(d, se, v, grp1n, grp2n, info = NULL, study = NULL)

Arguments

d

The effect size d.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln. Furthermore, Fisher's z and confidence intervals are returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

convert_d2r(d = 0.7, se = 0.5, grp1n = 70, grp2n = 80)


Convert effect size OR from d

Description

Compute effect size d from effect size OR.

Usage

convert_or2d(
  or,
  se,
  v,
  totaln,
  es.type = c("d", "cox.d", "g", "f", "eta"),
  info = NULL,
  study = NULL
)

Arguments

or

The effect size as odds ratio.

se

The standard error of d. One of se or v must be specified.

v

The variance of d. One of se or v must be specified.

totaln

A vector of total sample size(s).

es.type

Type of effect size that should be returned.

"d"

returns effect size d

"cox.d"

returns effect size d, based on Cox method

"g"

returns effect size Hedges' g (see hedges_g)

info

String with information on the transformation. Used for the print-method. Usually, this argument can be ignored

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

While or is the exponentiated log odds, the variance or standard error need to be on the log-scale!

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

convert_or2d(3.56, se = 0.91)
convert_d2or(0.7, se = 0.5)


Convert correlation coefficient r into Fisher's z

Description

Convert correlation coefficient r into Fisher's z.

Usage

convert_r2z(r)

Arguments

r

The correlation coefficient.

Value

The transformed Fisher's z.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

convert_r2z(.03)


Convert Fisher's z into correlation coefficient r

Description

Convert Fisher's z into correlation coefficient r.

Usage

convert_z2r(z)

Arguments

z

Fisher's z-value.

Value

The back-transformed correlation coefficient r.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

convert_z2r(.03)


Generate effect size data frame from other data

Description

This method computes any effect size from raw values from a data frame. Convenient method to compute multiple effect sizes at once, when the required information to calculate effects sizes are stored in a table (i.e. data frame).

Usage

effect_sizes(
  data,
  ...,
  fun,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log")
)

Arguments

data

A data frame with columns that contain the values that are passed to one of the esc-functions.

...

Named arguments. The name (left-hand side) is the name of one of esc functions' argument, the argument (right-hand side) is the name of the column in data that holds the data values. See 'Examples'.

fun

Name of one of the esc-functions, as string, where arguments in ... are passed to. May either be the full function name (like "esc_t" or "esc_2x2") or the funcion name without the suffix "esc_" (like "t" or "2x2").

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

Details

This function rowwise iterates data and calls the function named in fun for the values taken from each row of data. The column names in data that contain the necessary values to compute the effect sizes should be passed as unquoted value for the arguments. The argument names should match those arguments for the esc-function that should be called from within effect_sizes().

Example:
If you want to compute effect sizes from chi-squared values, you would call esc_chisq(). This function name is used for the fun-argument: fun = "esc_chisq". esc_chisq() requires one of chisq or p as arguments, and totaln. Now data must have columns with values for either chisq or p, and effect_sizes() automatically selects the first non-missing value from data (see 'Examples').

Value

A data frame with the effect sizes computed for all data from data.

Examples

tmp <- data.frame(
  tvalue = c(3.3, 2.9, 2.3),
  n = c(250, 200, 210),
  studyname = c("Study 1", "Study 2", "Study 3")
)
effect_sizes(tmp, t = tvalue, totaln = n, study = studyname, fun = "esc_t")

# missing effect size results are dropped,
# shorter function name, calls "esc_t()"
tmp <- data.frame(
  tvalue = c(3.3, 2.9, NA, 2.3),
  n = c(250, 200, 210, 210),
  studyname = c("Study 1", "Study 2", NA, "Study 4")
)
effect_sizes(tmp, t = tvalue, totaln = n, study = studyname, fun = "t")


tmp <- data.frame(
  coefficient = c(0.4, 0.2, 0.6),
  se = c(.15, .1, .2),
  treat = c(50, 60, 50),
  cntrl = c(45, 70, 40),
  author = c("Smith 2000", "Smith 2010 2", "Smith 2012")
)
effect_sizes(tmp, beta = coefficient, sdy = se, grp1n = treat, grp2n = cntrl,
    study = author, fun = "esc_beta", es.type = "or")

# the "esc_chisq" function requires *either* the chisq-argument *or*
# the pval-argument. If at least one of these values is present,
# effect size can be calculated. You can specify both arguments,
# and the first non-missing required value from "data" is taken.
tmp <- data.frame(
  chisqquared = c(NA, NA, 3.3, NA, 2.9),
  pval = c(.003, .05, NA, .12, NA),
  n = c(250, 200, 210, 150, 180),
  studyname = c("Study 1", "Study 2", "Study 3", "Study 4", "Study 5")
)
effect_sizes(tmp, chisq = chisqquared, p = pval, totaln = n,
             study = studyname, fun = "esc_chisq")

# if all required information are missing, data will be removed
tmp <- data.frame(
  chisqquared = c(NA, NA, 3.3, NA, NA),
  pval = c(.003, .05, NA, .12, NA),
  n = c(250, 200, 210, 150, 180),
  studyname = c("Study 1", "Study 2", "Study 3", "Study 4", "Study 5")
)
effect_sizes(tmp, chisq = chisqquared, p = pval, totaln = n,
             study = studyname, fun = "chisq")



Compute effect size from 2 by 2 Contingency Table

Description

Compute effect size from a 2 by 2 frequency table.

Usage

esc_2x2(
  grp1yes,
  grp1no,
  grp2yes,
  grp2no,
  es.type = c("logit", "d", "g", "or", "r", "f", "eta", "cox.d"),
  study = NULL,
  ...
)

Arguments

grp1yes

Size of treatment group with successes (outcome = yes).

grp1no

Size of treatment group with non-successes (outcome = no).

grp2yes

Size of control group with successes (outcome = yes).

grp2no

Size of control group with non-successes (outcome = no).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

...

Other parameters, passed down to further functions. For internal use only, can be ignored.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# effect size log odds
esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40, grp2no = 45)

# effect size odds ratio
esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40, grp2no = 45, es.type = "or")


Compute effect size from Unstandardized Regression Coefficient

Description

Compute effect size from Unstandardized Regression Coefficient.

Usage

esc_B(
  b,
  sdy,
  grp1n,
  grp2n,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

b

The unstandardized coefficient B.

sdy

The standard deviation of the dependent variable.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

esc_B(3.3, 5, 100, 150)


Compute effect size from Standardized Regression Coefficient

Description

Compute effect size from Standardized Regression Coefficient.

Usage

esc_beta(
  beta,
  sdy,
  grp1n,
  grp2n,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

beta

The standardized beta coefficient.

sdy

The standard deviation of the dependent variable.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

esc_beta(.7, 3, 100, 150)
esc_beta(.7, 3, 100, 150, es.type = "cox.log")


Compute effect size from binary proportions

Description

Compute effect size from binary proportions

Usage

esc_bin_prop(
  prop1event,
  grp1n,
  prop2event,
  grp2n,
  es.type = c("logit", "d", "g", "or", "r", "f", "eta", "cox.d"),
  study = NULL
)

Arguments

prop1event

Proportion of successes in treatment group (proportion of outcome = yes).

grp1n

Treatment group sample size.

prop2event

Proportion of successes in control group (proportion of outcome = yes).

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# effect size log odds
esc_bin_prop(prop1event = .375, grp1n = 80, prop2event = .47, grp2n = 85)

# effect size odds ratio
esc_bin_prop(prop1event = .375, grp1n = 80, prop2event = .47, grp2n = 85,
             es.type = "or")


Compute effect size from Chi-Square coefficient

Description

Compute effect size from Chi-Square coefficient

Usage

esc_chisq(
  chisq,
  p,
  totaln,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

chisq

The chi-squared value. One of chisq or p must be reported.

p

The p-value of the chi-squared or phi-value.

totaln

A vector of total sample size(s).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

This effect size should only be used for data from 2x2 frequency tables. Furthermore, use this approximation for the effect size only, if information about the 2x2 frequencies or proportions are not available. Else, esc_2x2 or esc_bin_prop provide better estimates for the effect size.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# Effect size based on chi-squared value
esc_chisq(chisq = 9.9, totaln = 100)

# Effect size based on p-value of chi-squared
esc_chisq(p = .04, totaln = 100)


Compute effect size from One-way Anova

Description

Compute effect size from One-way Anova with two independent groups.

Usage

esc_f(
  f,
  totaln,
  grp1n,
  grp2n,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

f

The F-value of the F-test.

totaln

Total sample size. Either totaln, or grp1n and grp2n must be specified.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

This function only applies to one-way Anova F-tests with two independent groups, either equal or unequal sample sizes.

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# unequal sample size
esc_f(f = 5.5, grp1n = 100, grp2n = 150)

# equal sample size
esc_f(f = 5.5, totaln = 200)


Compute effect size from Mean Gain Scores and Standard Deviations

Description

Compute effect size from Mean Gain Scores and Standard Deviations for pre-post tests.

Usage

esc_mean_gain(
  pre1mean,
  pre1sd,
  post1mean,
  post1sd,
  grp1n,
  gain1mean,
  gain1sd,
  grp1r,
  pre2mean,
  pre2sd,
  post2mean,
  post2sd,
  grp2n,
  gain2mean,
  gain2sd,
  grp2r,
  r,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

pre1mean

The mean of the first group at pre-test.

pre1sd

The standard deviation of the first group at pre-test.

post1mean

The mean of the first group at post-test.

post1sd

The standard deviation of the first group at post-test.

grp1n

The sample size of the first group.

gain1mean

The mean gain between pre and post of the first group.

gain1sd

The standard deviation gain between pre and post of the first group.

grp1r

The (estimated) correlation of pre-post scores for the first group.

pre2mean

The mean of the second group at pre-test.

pre2sd

The standard deviation of the second group at pre-test.

post2mean

The mean of the second group at post-test.

post2sd

The standard deviation of the second group at post-test.

grp2n

The sample size of the second group.

gain2mean

The mean gain between pre and post of the second group.

gain2sd

The standard deviation gain between pre and post of the second group.

grp2r

The (estimated) correlation of pre-post scores for the second group.

r

Correlation for within-subject designs (paired samples, repeated measures).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Details

For this function, either the gain scores of mean and sd (gain1mean and gain1sd for the first group and gain2mean and gain2sd for the second group) must be specified, or the pre-post values (pre1mean, post1mean, pre1sd and post1sd and the counterpart arguments for the second group).

If the pre-post standard deviations are available, no correlation value grp1r resp. grp2r needs to be specified, because these can then be computed based on t-value computation. However, if grp1r is specified, this value will be used (and no t-test performed).

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# effect size of mean gain scores, with available pre-post values
esc_mean_gain(pre1mean = 13.07, pre1sd = 11.95, post1mean = 6.1,
              post1sd = 8.33, grp1n = 78, pre2mean = 10.77, pre2sd = 10.73,
              post2mean = 8.83, post2sd = 9.67, grp2n = 83)

# same as above, but with assumed correlation of .5
# Note that effect size is the same, but variance differs
esc_mean_gain(pre1mean = 13.07, pre1sd = 11.95, post1mean = 6.1, grp1r = .5,
              post1sd = 8.33, grp1n = 78, pre2mean = 10.77, pre2sd = 10.73,
              post2mean = 8.83, post2sd = 9.67, grp2n = 83, grp2r = .5)

# effect size based on gain scores for mean and sd. note that the
# pre-post correlations must be given
esc_mean_gain(gain1mean = 1.5, gain1sd = 1, grp1n = 40, grp1r = .5,
              gain2mean = .7, gain2sd = .8, grp2n = 50, grp2r = .5)


Compute effect size from Mean and Standard Deviation

Description

Compute effect size from mean and either group-based standard deviations or full sample standard deviation.

Usage

esc_mean_sd(
  grp1m,
  grp1sd,
  grp1n,
  grp2m,
  grp2sd,
  grp2n,
  totalsd,
  r,
  es.type = c("d", "g", "or", "logit", "r", "cox.or", "cox.log"),
  study = NULL
)

Arguments

grp1m

The mean of the first group.

grp1sd

The standard deviation of the first group.

grp1n

The sample size of the first group.

grp2m

The mean of the second group.

grp2sd

The standard deviation of the second group.

grp2n

The sample size of the second group.

totalsd

The full sample standard deviation. Either grp1sd and grp2sd, or totalsd must be specified.

r

Correlation for within-subject designs (paired samples, repeated measures).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# with standard deviations for each group
esc_mean_sd(
  grp1m = 7, grp1sd = 2, grp1n = 50,
  grp2m = 9, grp2sd = 3, grp2n = 60,
  es.type = "logit"
)

# effect-size d, within-subjects design
esc_mean_sd(
  grp1m = 7, grp1sd = 2, grp1n = 50,
  grp2m = 9, grp2sd = 3, grp2n = 60, r = .7
)

# with full sample standard deviations
esc_mean_sd(grp1m = 7, grp1n = 50, grp2m = 9, grp2n = 60, totalsd = 4)


Compute effect size from Mean and Standard Error

Description

Compute effect size from Mean and Standard Error.

Usage

esc_mean_se(
  grp1m,
  grp1se,
  grp1n,
  grp2m,
  grp2se,
  grp2n,
  r,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

grp1m

The mean of the first group.

grp1se

The standard error of the first group.

grp1n

The sample size of the first group.

grp2m

The mean of the second group.

grp2se

The standard error of the second group.

grp2n

The sample size of the second group.

r

Correlation for within-subject designs (paired samples, repeated measures).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

esc_mean_se(grp1m = 7, grp1se = 1.5, grp1n = 50,
            grp2m = 9, grp2se = 1.8, grp2n = 60, es.type = "or")


Compute effect size from Phi coefficient

Description

Compute effect size from phi coefficient

Usage

esc_phi(
  phi,
  p,
  totaln,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

phi

The phi value. One of phi or p must be reported.

p

The p-value of the chi-squared or phi-value.

totaln

A vector of total sample size(s).

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

This effect size should only be used for data from 2x2 frequency tables. Furthermore, use this approximation for the effect size only, if information about the 2x2 frequencies or proportions are not available. Else, esc_2x2 or esc_bin_prop provide better estimates for the effect size.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# Effect size based on chi-squared value
esc_phi(phi = .67, totaln = 100)

# Effect size based on p-value of chi-squared
esc_phi(p = .003, totaln = 100)


Compute effect size from Point-Biserial Correlation

Description

Compute effect size from Point-Biserial Correlation.

Usage

esc_rpb(
  r,
  p,
  totaln,
  grp1n,
  grp2n,
  es.type = c("d", "g", "or", "logit", "f", "eta", "cox.or", "cox.log"),
  study = NULL
)

Arguments

r

The point-biserial r-value. One of r or p must be specified.

p

The p-value of the point-biserial correlation. One of r or p must be specified.

totaln

Total sample size. Either totaln, or grp1n and grp2n must be specified.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# unequal sample size
esc_rpb(r = .3, grp1n = 100, grp2n = 150)

# equal sample size
esc_rpb(r = .3, totaln = 200)

# unequal sample size, with p-value
esc_rpb(p = 0.03, grp1n = 100, grp2n = 150)

# equal sample size, with p-value
esc_rpb(p = 0.03, totaln = 200)


Compute effect size from Student's t-test

Description

Compute effect size from Student's t-test for independent samples.

Usage

esc_t(
  t,
  p,
  totaln,
  grp1n,
  grp2n,
  es.type = c("d", "g", "or", "logit", "r", "f", "eta", "cox.or", "cox.log"),
  study = NULL,
  ...
)

Arguments

t

The t-value of the t-test. One of t or p must be specified.

p

The p-value of the t-test. One of t or p must be specified.

totaln

Total sample size. Either totaln, or grp1n and grp2n must be specified.

grp1n

Treatment group sample size.

grp2n

Control group sample size.

es.type

Type of effect size that should be returned.

"d"

returns standardized mean difference effect size d

"f"

returns effect size Cohen's f

"g"

returns adjusted standardized mean difference effect size Hedges' g

"or"

returns effect size as odds ratio

"cox.or"

returns effect size as Cox-odds ratio (see convert_d2or for details)

"logit"

returns effect size as log odds

"cox.log"

returns effect size as Cox-log odds (see convert_d2logit for details)

"r"

returns correlation effect size r

"eta"

returns effect size eta squared

study

Optional string with the study name. Using combine_esc or as.data.frame on esc-objects will add this as column in the returned data frame.

...

Other parameters, passed down to further functions. For internal use only, can be ignored.

Value

The effect size es, the standard error se, the variance of the effect size var, the lower and upper confidence limits ci.lo and ci.hi, the weight factor w and the total sample size totaln.

Note

This function only applies to independent sample t-tests, either equal or unequal sample sizes. It can't be used for t-values from dependent or paired t-tests, or t-values from other statistical procedures (like regressions).

If es.type = "r", Fisher's transformation for the effect size r and their confidence intervals are also returned.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Examples

# unequal sample size
esc_t(t = 3.3, grp1n = 100, grp2n = 150)

# equal sample size
esc_t(t = 3.3, totaln = 200)

# unequal sample size, with p-value
esc_t(p = 0.03, grp1n = 100, grp2n = 150)

# equal sample size, with p-value
esc_t(p = 0.03, totaln = 200)


Convert effect sizes

Description

Convert between different effect sized.

Usage

hedges_g(d, totaln)

eta_squared(d, r, f, or, logit)

cohens_f(d, r, eta, or, logit)

cohens_d(f, r, eta, or, logit)

pearsons_r(d, eta, f, or, logit)

log_odds(d, eta, f, or, r)

odds_ratio(d, eta, f, logit, r)

Arguments

d, r, f, eta, or, logit

A scalar or vector with effect size(s).

totaln

A vector of total sample size(s).

Value

The requested effect size.

References

Lipsey MW, Wilson DB. 2001. Practical meta-analysis. Thousand Oaks, Calif: Sage Publications

Wilson DB. 2016. Formulas Used by the "Practical Meta-Analysis Effect Size Calculator". Unpublished manuscript: George Mason University

Hedges LV. 1981. Distribution theory for Glass's estimator of effect size and related estimators. Journal of Educational Statistics 6: 107–128.

Borenstein M, Hedges LV, Higgins JPT, Rothstein HR. 2009. Introduction to Meta-Analysis. Chichester, West Sussex, UK: Wiley

Cohen J. 1988. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Erlbaum

Examples

# convert from d to Hedges' g or odds ratio
hedges_g(d = 0.75, totaln = 50)
odds_ratio(d = .3)

# convert from odds ratio to eta_squared
eta_squared(or = 2.3)

# convert from f or r to d
cohens_d(f = .3)
cohens_d(r = .25)

# functions are vectorized
hedges_g(c(0.75, .3), c(50, 70))
cohens_f(r = c(.1, .2, .3))


Write one or more 'esc' objects into an Excel csv-file

Description

This method is a small wrapper to write csv-files. It writes the results from combine_esc into an Excel csv-file.

Usage

write_esc(..., path, sep = ",")

Arguments

...

One or more objects of class esc

path

Path to write to, or just file name (to write to working directory).

sep

The field separator string. In some Western European locales, Excel uses a semicolon by default, while in other locales the field separator string in Excel is a comma.

Value

Invisibly returns the combined data frame that is written to the csv-file (see combine_esc).

Note

For Western European locales, the sep-argument probably needs to be set to semicolon (sep = ";"), so Excel reads the csv-file properly. If sep = ";", write.csv2 is used to write the file. Else, write.csv is used.

See Also

combine_esc

Examples

e1 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40,
              grp2no = 45, study = "Study 1")
e2 <- esc_2x2(grp1yes = 30, grp1no = 50, grp2yes = 40, grp2no = 45,
              es.type = "or", study = "Study 2")
e3 <- esc_t(p = 0.03, grp1n = 100, grp2n = 150, study = "Study 3")
e4 <- esc_mean_sd(grp1m = 7, grp1sd = 2, grp1n = 50, grp2m = 9, grp2sd = 3,
                  grp2n = 60, es.type = "logit", study = "Study 4")

# write to current working directory,
# file extension ".csv" is automatically added
## Not run: 
write_esc(e1, e2, e3, e4, path = "EffSizes")
## End(Not run)