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

genOrdCat with two responses but single adjustment variable generates error #83

Closed
kgoldfeld opened this issue Oct 29, 2020 · 0 comments · Fixed by #84
Closed

genOrdCat with two responses but single adjustment variable generates error #83

kgoldfeld opened this issue Oct 29, 2020 · 0 comments · Fixed by #84
Assignees
Labels
bug feature feature request or enhancement

Comments

@kgoldfeld
Copy link
Owner

The following snippet generates an error. In the previous multivariate version, do you recall if there was the ability to shift the probabilities using the adjustment variable? I am guessing not. If not, maybe we should consider fixing this, and if it was, then maybe we should definitely fix.

library(simstudy)

d1 <- defData(varname = "z1", formula = 0, variance = .25)

dd <- genData(10, d1)

baseprobs <- matrix(c(.4, .3, .2, .1,
                      .5, .4, .05, .05), byrow = T, nrow = 2)

dd <- genOrdCat(dtName = dd, adjVar = "z1", baseprobs = baseprobs)
#> [1] 2
#> Error in rep(var, n): invalid 'times' argument
@kgoldfeld kgoldfeld added bug feature feature request or enhancement labels Oct 29, 2020
@assignUser assignUser self-assigned this Oct 30, 2020
assignUser added a commit that referenced this issue Oct 30, 2020
@assignUser assignUser added this to To do in simstudy-bugs via automation Oct 30, 2020
@assignUser assignUser moved this from To do to In progress in simstudy-bugs Oct 30, 2020
simstudy-bugs automation moved this from In progress to Done Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature feature request or enhancement
Projects
simstudy-bugs
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants