基于SAS PROC MIXED的REML法tau²估计权重机制咨询
rma) Great to hear your tau² estimates from SAS PROC MIXED and R's rma match up— that’s a solid sign your implementation is on the right track! Let’s break down exactly how PROC MIXED uses your weight variable, and how it aligns with what rma does under the hood.
1. First: The Core Role of Weights in Meta-Analysis
You noted your Weight variable is calculated as 1/抽样方差 (inverse variance weight)— this is the standard in meta-analysis. Both tools use these weights to prioritize more precise studies: the smaller a study’s sampling variance (i.e., the more reliable its effect size estimate), the larger its weight, and the more it influences the combined results.
2. How SAS PROC MIXED Processes Your Weight Variable
When you include a WEIGHT Weight; statement in PROC MIXED, here’s what’s happening behind the scenes:
- PROC MIXED treats your
Weightdirectly as a precision weight, meaning it assumesWeight_i = 1/σ_i², whereσ_i²is the sampling variance of the i-th study’s effect size. - For REML estimation of tau² (the between-study heterogeneity variance), PROC MIXED fits a weighted linear mixed model that looks like this:
Where:Effectsize = β + u_j + ε_iβis the overall fixed-effect meanu_jis the random effect for studyj(with variance = tau², the value you’re estimating)ε_iis the within-study sampling error, with variance =1/Weight_i(directly derived from your weight variable)
- Critically, the
WEIGHTstatement tells PROC MIXED to scale the residual variance by the inverse of your weight variable. Since you’ve already setWeight = 1/抽样方差, this makes the residual variance exactly equal to the study’s sampling variance— which is exactly whatrmauses.
3. Alignment with R’s rma Function
This is why your tau² estimates match: rma and PROC MIXED are using identical logic for weights and REML estimation:
- If you use
rma(yi = Effectsize, vi = 1/Weight, method = "REML")in R,viis the sampling variance— which is the inverse of your SAS weight variable. This is directly equivalent toWEIGHT Weight;in PROC MIXED. - Alternatively, if you pass
weights = Weighttorma, it treats that as the inverse variance weight, which is exactly what PROC MIXED expects from theWEIGHTstatement.
Both tools maximize the same REML likelihood function for the mixed model, so they produce identical tau² estimates when weights are specified correctly.
4. Key Notes to Keep in Mind
- Double-check that your
Weightvariable is strictly1/抽样方差— if you used a different weight type (e.g., sample size weights), the results between tools would diverge. - In PROC MIXED, the
WEIGHTstatement modifies the residual variance structure. In meta-analysis, we typically assume the "baseline" residual variance is 1, so scaling by1/Weight_igives us the exact sampling variance for each study.
内容的提问来源于stack exchange,提问作者user172419

