Closed jkcshea closed 3 years ago
@jongohkim91 Ah, I had forgotten we had actually addressed how to specify single elements of factor variables. For single factors, just declare a boolean expression. e.g.,
ivmte(m0 = ~ u + (yob == 55) + (yob == 60),
...)
See the section 'Specifying the MTR Functions: Basics' on the GitHub page.
While reviewing #201, you also reviewed #102. While the syntax
factor(x)-1
in #102 works when selecting single levels of a factor variable in thecomponents
argument, it is unclear how this works in theivlike
orm0
,m1
arguments.e.g. suppose
m0 ~ factor(x)-1
. R would interpretfactor(x)-1
as meaning "factor(x)
and no intercept", rather than "level1
offactor(z)
." Investigate this and determine the right way to declare factor levels.