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

true variable cannot also be in by #48

Closed
mikesweeting opened this issue Mar 8, 2023 · 2 comments
Closed

true variable cannot also be in by #48

mikesweeting opened this issue Mar 8, 2023 · 2 comments
Assignees
Milestone

Comments

@mikesweeting
Copy link

We might want a situation where the true parameter value is varying across scenario settings

Currently simsum gives a warning message (rather than an error) if the true variable is also in by. But the nlp plot does not work.

A contrived example below is shown where esigma is assumed to be the true value of the parameter (estvarname)

s.nlp.true <- rsimsum::simsum(
  data = nlp, estvarname = "b", true = "esigma", se = "se",
  methodvar = "model", by = c("baseline", "ss", "esigma")
)
autoplot(s.nlp.true, stats = "bias", type = "nlp")

Work-around
A work-around is to create a copy of the true parameter.

nlp$esigma.copy <- nlp$esigma
s.nlp.true2 <- rsimsum::simsum(
  data = nlp, estvarname = "b", true = "esigma.copy", se = "se",
  methodvar = "model", by = c("baseline", "ss", "esigma")
)
autoplot(s.nlp.true2, stats = "bias", type = "nlp")
@ellessenne ellessenne self-assigned this May 27, 2023
@ellessenne
Copy link
Owner

Now fixed in PR #53:

library(rsimsum)

s.nlp.true <- rsimsum::simsum(
  data = nlp, estvarname = "b", true = "esigma", se = "se",
  methodvar = "model", by = c("baseline", "ss", "esigma")
)
#> 'ref' method was not specified, 1 set as the reference

library(ggplot2)
autoplot(s.nlp.true, stats = "bias", type = "nlp")

Rplot

Created on 2023-05-28 with reprex v2.0.2

If you'd like you can test it with:

remotes::install_github("ellessenne/rsimsum", ref = remotes::github_pull("53"))

@ellessenne ellessenne added this to the 0.13.0 milestone Aug 26, 2023
@ellessenne
Copy link
Owner

This is fixed in {rsimsum} 0.13.0, which is now on CRAN.

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

No branches or pull requests

2 participants