Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrast with interaction terms #5

Open
alanocallaghan opened this issue Nov 11, 2022 · 0 comments
Open

Contrast with interaction terms #5

alanocallaghan opened this issue Nov 11, 2022 · 0 comments

Comments

@alanocallaghan
Copy link
Owner

From John Sorkin via email

Does the package automatically handle an interaction term, e.g. for the model and contrast statement below,

fit1 <- lm(y~ x + z + x*z)

contrast(x=10, z=10)

Will the contrast statement include in its calculation the x*z interaction? Some testing I have done suggests it does not.

If I am correct (that the contrast statement written above does NOT include the interaction term in its computation), is there a way to specify the interaction in the contrast statement?

I have tried contrast(x=10, z=10, xz=100), contrast(x=10, z=10, xz=100), contrast(x=10, z=10, “xz”=100) none of which run; all produce an error message.

In a model with an offset, will the contrast statement work and include the offset in its computation, for example

fit2 <- lm(y~ x + z + x*z + offset=offset)

contrast(fit2, x=10, y=10)

Some experimentation suggests the contrast function does not account for the offset.

Assuming I am correct, that the offset term is NOT honored in the contrast statement, is there a way to write a contrast statement that will work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant