Last data update: 2014.03.03
|
R: Correction for Attenuation
Correction for Attenuation
Description
Used to correct for attenuated effect sizes due to measurement unreliability.
Usage
atten(g, xx, yy, data)
Arguments
g |
Hedges g (unbiased estimate of d) effect size.
|
xx |
Column for reliability of predictor variable ("independent variable").
|
yy |
Column for reliability of outcome variable ("dependent variable").
|
data |
data.frame with the above values.
|
Value
A new column for g corrected for attenuation (g.corrected ) will be added to the data, for those xx & yy columns with complete data.
Author(s)
AC Del Re & William T. Hoyt
Maintainer: AC Del Re acdelre@gmail.com
References
Hunter, J. E., Schmidt, F. L. (2004). Methods of meta-analysis (2nd edition). Thousand Oaks, CA: Sage.
Examples
# Sample data:
id<-c(1, 1:19)
n<-c(10,20,13,22,28,12,12,36,19,12,36,75,33,121,37,14,40,16,14,20)
g<-c(.68,.56,.23,.64,.49,-.04,.49,.33,.58,.18,-.11,.27,.26,.40,.49,
.51,.40,.34,.42,.16)
var.g <- c(.08,.06,.03,.04,.09,.04,.009,.033,.0058,.018,.011,.027,.026,.0040,
.049,.0051,.040,.034,.0042,.016)
xx<-c(.88,.86,.83,.64,.89,.84,.89,.83,.99,.88,.81,.77,.86,.70,.79,
.71,.80,.74,.82,.86) # Reliability of "independent variable"
yy<-c(.99,.86,.83,.94,.89,.94,.89,.93,.99,.88,.81,.77,.86,.70,.79,
.71,.80,.94,.92,.96) # Reliability of "dependent variable"
df<-data.frame(id,n,g, var.g, xx,yy)
# Example
atten(g= g, xx = xx, yy = yy, data= df)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
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.
> library(MAd)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MAd/atten.rd_%03d_medium.png", width=480, height=480)
> ### Name: atten
> ### Title: Correction for Attenuation
> ### Aliases: atten
> ### Keywords: data
>
> ### ** Examples
>
> # Sample data:
>
> id<-c(1, 1:19)
> n<-c(10,20,13,22,28,12,12,36,19,12,36,75,33,121,37,14,40,16,14,20)
> g<-c(.68,.56,.23,.64,.49,-.04,.49,.33,.58,.18,-.11,.27,.26,.40,.49,
+ .51,.40,.34,.42,.16)
> var.g <- c(.08,.06,.03,.04,.09,.04,.009,.033,.0058,.018,.011,.027,.026,.0040,
+ .049,.0051,.040,.034,.0042,.016)
> xx<-c(.88,.86,.83,.64,.89,.84,.89,.83,.99,.88,.81,.77,.86,.70,.79,
+ .71,.80,.74,.82,.86) # Reliability of "independent variable"
> yy<-c(.99,.86,.83,.94,.89,.94,.89,.93,.99,.88,.81,.77,.86,.70,.79,
+ .71,.80,.94,.92,.96) # Reliability of "dependent variable"
>
> df<-data.frame(id,n,g, var.g, xx,yy)
>
> # Example
> atten(g= g, xx = xx, yy = yy, data= df)
id n g var.g xx yy g.corrected
1 1 10 0.68 0.0800 0.88 0.99 0.72853426
2 1 20 0.56 0.0600 0.86 0.86 0.65116279
3 2 13 0.23 0.0300 0.83 0.83 0.27710843
4 3 22 0.64 0.0400 0.64 0.94 0.82513700
5 4 28 0.49 0.0900 0.89 0.89 0.55056180
6 5 12 -0.04 0.0400 0.84 0.94 -0.04501491
7 6 12 0.49 0.0090 0.89 0.89 0.55056180
8 7 36 0.33 0.0330 0.83 0.93 0.37560678
9 8 19 0.58 0.0058 0.99 0.99 0.58585859
10 9 12 0.18 0.0180 0.88 0.88 0.20454545
11 10 36 -0.11 0.0110 0.81 0.81 -0.13580247
12 11 75 0.27 0.0270 0.77 0.77 0.35064935
13 12 33 0.26 0.0260 0.86 0.86 0.30232558
14 13 121 0.40 0.0040 0.70 0.70 0.57142857
15 14 37 0.49 0.0490 0.79 0.79 0.62025316
16 15 14 0.51 0.0051 0.71 0.71 0.71830986
17 16 40 0.40 0.0400 0.80 0.80 0.50000000
18 17 16 0.34 0.0340 0.74 0.94 0.40766097
19 18 14 0.42 0.0042 0.82 0.92 0.48355786
20 19 20 0.16 0.0160 0.86 0.96 0.17609018
>
>
>
>
>
> dev.off()
null device
1
>
|