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

Update documentation of lsmeans #413

Merged
merged 5 commits into from
Mar 22, 2024
Merged

Update documentation of lsmeans #413

merged 5 commits into from
Mar 22, 2024

Conversation

gowerc
Copy link
Collaborator

@gowerc gowerc commented Mar 20, 2024

Closes #412

For reference the code changes are just:

  • Re-wrote lsmeans documentation
  • Added an additional unit test with cont*cont interactions to ensure that is working as expected
  • Mild re-work of the .weights="equal" implementation as my original code was very hard to read (no change in what it produces though)
  • Added an @export tag to an S3 method (this was technical a bug could have caused some niche issues due to how R looks up s3 methods)

@gowerc gowerc requested review from nociale and wolbersm March 20, 2024 15:18
Copy link
Contributor

github-actions bot commented Mar 20, 2024

CLA Assistant Lite bot ✅ All contributors have signed the CLA

@gowerc
Copy link
Collaborator Author

gowerc commented Mar 20, 2024

I have read the CLA Document and I hereby sign the CLA

R/lsmeans.R Outdated Show resolved Hide resolved
R/lsmeans.R Outdated Show resolved Hide resolved
R/lsmeans.R Outdated Show resolved Hide resolved
R/lsmeans.R Show resolved Hide resolved
Copy link
Collaborator

@nociale nociale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's all right, I made just few comments about the documentation

@gowerc
Copy link
Collaborator Author

gowerc commented Mar 20, 2024

@nociale ah, after sifting deeping into the emmeans documentation it looks like they do also support the counter factual approach with:

iris2 <- iris[ iris$Species %in% c("versicolor", "virginica"), ]
iris2$Species <- factor(iris2$Species)

mod <- lm(Sepal.Length ~ Species + Petal.Length*Petal.Width, data = iris2)

emmeans(
    mod,
    specs = "Species",
    counterfactuals = "Species"
)

Will add this to our unit tests to ensure we match them

@gowerc
Copy link
Collaborator Author

gowerc commented Mar 21, 2024

@nociale, I updated the documentation and code according to our g-chat. I closed all the prior comments because its been reworked / rewritten a fair bit since your first review apologies. Would you mind re-reviewing now please.

I also decided to delete all mentions of "weighting" in the ancova / ancova_single functions and instead just inherit the weighting description directly from lsmeans to ensure that all of our documentation regarding this is consistent.

R/lsmeans.R Outdated Show resolved Hide resolved
R/lsmeans.R Outdated Show resolved Hide resolved
@nociale
Copy link
Collaborator

nociale commented Mar 21, 2024

Thank you Craig!!

@gowerc gowerc merged commit 380b385 into main Mar 22, 2024
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

outputs of rbmi::lsmeans() don't match those of emmeans::lsmeans()
2 participants