Closed bct0022 closed 6 months ago
Hi @bct0022, I think you may have loaded the logitnorm package with library(logitnorm)
after loading multinma? multinma adds some convenience wrappers for these functions but these only work if the logitnorm package is not loaded (or if multinma is loaded afterwards).
Hi, I appreciate the great effort to create the package. I have some problems while running the ML-NMR example with
multinma
package. The problem may be due to the call of density function/distribution of the covariates as below. Could any one help me figure it out? Thank you in advance. Error 1:ipd_summary <- pso_ipd %>% group_by(studyc) %>% summarise_at(vars(weight, durnpso, bsa), list(mean = mean, sd = sd, min = min, max = max)) %>% pivot_longer(weight_mean:bsa_max, namessep = "", names_to = c("covariate", ".value")) %>%
Assign distributions
mutate(dist = recode(covariate, bsa = "dlogitnorm", durnpso = "dgamma", weight = "dgamma")) %>%
Compute density curves
group_by(studyc, covariate) %>% mutate(value = if_else(dist == "dlogitnorm", list(seq(0, 1, length.out = 101)), list(seq(min0.8, max1.2, length.out = 101)))) %>% unnest(cols = value) %>% mutate(dens = eval(call(first(dist), x = value, mean = first(mean), sd = first(sd))))
============================================== Error in
mutate()
: ℹ In argument:dens = eval(call(first(dist), x = value, mean = first(mean), sd = first(sd)))
. ℹ In group 1:studyc = "IXORA-S"
,covariate = "bsa"
. Caused by error indnorm()
: ! formal argument "mean" matched by multiple actual arguments Backtrace:base::ifelse(...)
Error 2:
pso_net <- add_integration(pso_net, durnpso = distr(qgamma, mean = durnpso_mean, sd = durnpso_sd), prevsys = distr(qbern, prob = prevsys), bsa = distr(qlogitnorm, mean = bsa_mean, sd = bsa_sd), weight = distr(qgamma, mean = weight_mean, sd = weight_sd), psa = distr(qbern, prob = psa), n_int = 1000)
============================================== Error in
pmap()
: ℹ In index: 3. Caused by error indplyr::transmute()
: ℹ In argument:.int_bsa = list(...)
. ℹ In row 1. Caused by error inqnorm()
: ! formal argument "mean" matched by multiple actual arguments Backtrace:<fn>
(p =<dbl>
, mean = 0.326, sd = 0.1778)