I've noticed that the package does not allow me to specify an MTR formula that contains the term I(u). ivmte throws a (very informative) error:
Error : The following terms are not declared properly.
m0: I(u)
m1: I(u)
The unobserved variable 'u' must be declared as a monomial, e.g. u, I(u^3). The monomial can be interacted with other variables, e.g. x:u, x:I(u^3). Expressions where the unobservable term is not a monomial are either not permissible or will not be parsed correctly, e.g. exp(u), I((x * u)^2). Try to rewrite the expression so that 'u' is only included in monomials.
Using the as-is operator this way is clearly redundant (that is, I could just use u instead of I(u)), but other standard R functions (lm, glmivreg, etc.) allow for such redundant usage.
This is simply a user-friendliness thing and may not be something you want to update. If you don't think it is worth the effort, feel free to disregard!
I've noticed that the package does not allow me to specify an MTR formula that contains the term
I(u)
.ivmte
throws a (very informative) error:Using the as-is operator this way is clearly redundant (that is, I could just use
u
instead ofI(u)
), but other standard R functions (lm
,glm
ivreg
, etc.) allow for such redundant usage.This is simply a user-friendliness thing and may not be something you want to update. If you don't think it is worth the effort, feel free to disregard!