The Equal-Effects Model


Slides

Keywords: Fixed-Effect Model, Common-Effect Model



Code


# This data set contains effects of studies examining
# the effects of suicide prevention interventions
# Copy and paste the entire code below into your Console.
# Then hit Enter.
data <- structure(
            list(
                study = c("Berry et al.", "DeVries et al.", 
                          "Fleming et al.", "Hunt & Burke", 
                          "McCarthy et al.", "Meijer et al.", 
                          "Rivera et al.", "Watkins et al.", 
                          "Zaytsev et al."), 
                es = c(-0.143, -0.608, -0.111, -0.127, -0.392, 
                       -0.268, 0.012, -0.245, -0.126), 
                se = c(0.147, 0.17, 0.258, 0.176, 0.202, 
                       0.135, 0.183, 0.224, 0.194)), 
                row.names = c(NA, -9L), 
            class = "data.frame")

# Check if this worked
data


# Equal-Effect Model (Inverse-Variance)
# Calculate the inverse variance-weights for each study
data$w <- 1/data$se^2

# Then, we use the weights to calculate the pooled effect
pooled_effect <- sum(data$w*data$es)/sum(data$w)
pooled_effect
Zurück
Weiter