You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding FixedEffect terms from a list, I was expecting to get the same results when using the sum() function and reducing with lambda x, y: x + y. However, using sum() results in an additional column x0.
Please provide the steps to reproduce and if possible a minimal demo of the problem.
In the implementation you're referring to, the add operation doesn't perform pairwise addition as one might typically expect with numerical values. Instead, it functions more like an "append" operation in the context of combining terms or variables in a statistical model.
Explanation:
When you use Term A + Term B, the operation combines the two terms by adding the variables from Term B that are not already present in Term A to Term A. This results in a new term that includes all unique variables from both Term A and Term B.
Example:
Let's consider two terms representing different variables in a design matrix for a linear model:
Term A: Represents variables [X1, X2]
Term B: Represents variables [X2, X3]
Term A + Term B will output [X1, X2, X3] since X3 is the only col that in B but not in A.
Cause
So the cause of this problem is just when calling sum it is 0 + termAge. This addition of a numeric type and FixedEffect type is not well handled.
When adding
FixedEffect
terms from a list, I was expecting to get the same results when using thesum()
function and reducing withlambda x, y: x + y
. However, usingsum()
results in an additional columnx0
.Here is a MWE:
I was expecting the same results.
I am using BrainStat
0.3.6
.The text was updated successfully, but these errors were encountered: