Skip to content

Commit

Permalink
Merge branch 'hotfix/0.7.1' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
pierucci committed Nov 23, 2016
2 parents 34df1cd + bc914c1 commit 18a0538
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: heemod
Title: Models for Health Economic Evaluation
Version: 0.7.0
Version: 0.7.1
Authors@R: c(
person("Antoine", "Filipovic-Pierucci", email = "[email protected]", role = c("aut", "cre")),
person("Kevin", "Zarca", email = "[email protected]", role = "aut"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# heemod 0.7.1

## Bugfixes

* Fixed an error resulting in incorrect covariance analysis results when relations between values and parameters were negative.

# heemod 0.7.0

## Breaking changes
Expand Down
8 changes: 5 additions & 3 deletions R/covariance.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ compute_cov <- function(psa) {
))
res <- stats::lm(form, data = data_trans)

tot <- sum(stats::coef(res)[-1])
val <- abs(stats::coef(res)[-1])
tot <- sum(val)
r2 <- summary(res)$r.squared
if (r2 < .99) {
warning(sprintf(
"Only %.0f%% of variance explained, results may be inaccurate."
"Only %.0f%% of variance explained, results may be inaccurate.",
r2 * 100
))
}
as.data.frame(as.list(stats::coef(res)[-1] / tot * r2))
as.data.frame(as.list(val / tot * r2))
}

psa$psa %>%
Expand Down
4 changes: 2 additions & 2 deletions inst/examples/example_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ res <- run_model(

# generating table with new parameter sets
new_tab <- data.frame(
age_init = 40:80
age_init = 40:45
)

# with run_model result
Expand All @@ -55,7 +55,7 @@ summary(ndt)
# using weights

new_tab2 <- data.frame(
age_init = 40:80,
age_init = 40:45,
.weights = runif(41)
)
ndt2 <- update(res, newdata = new_tab2)
Expand Down
4 changes: 2 additions & 2 deletions man/update-model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18a0538

Please sign in to comment.