Description
Calculate each exact string group's unweighted mean, return that mean at every corresponding position, and centered = value-groupMean.
Panel transformations and regression weights depend on entity, period and weighting conventions. Demeaning or differencing a supplied value is separate from fitting fixed effects, validating panel structure or choosing a statistically appropriate weight.
Calculate each exact string group's unweighted mean, return that mean at every corresponding position, and centered = value-groupMean.
When to use this tool
Use Within Transform Group Mean when checking one panel transformation or declared observation weight.
How to use the tool and how it works
- Enter values, groups. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read groupMeans, centered. Use the output convention below.
Require equally long values and groups. Calculate each exact string group's unweighted mean, return that mean at every corresponding position, and centered = value-groupMean.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| values | Values | Required. Array of finite number; maximum items 256. |
| groups | Groups | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| groupMeans | Group Means | Required. Array of finite number; maximum items 256. |
| centered | Centered | Required. Array of finite number; maximum items 256. |
{
"input": {
"values": [
2,
4,
10
],
"groups": [
"A",
"A",
"B"
]
},
"output": {
"groupMeans": [
3,
3,
10
],
"centered": [
-1,
1,
0
]
}
} Limitations and assumptions
- Empty arrays return empty arrays. This demeans one variable without weighting, multiway fixed effects, regression estimation or validation of panel identifiers.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a suitable complete estimator and validated data structure for panel inference, weighting and missing-data treatment.
References
Similar or alternative tools
- Fixed Effect Within One Cell Term
transformed = value-groupMean, adding grandMean only when addGrandMean is true.
- Panel Timegap Difference Sign
difference = currentValue-previousValue; elapsed = currentTime-previousTime; result is difference/elapsed when divideByGap, otherwise difference.