-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions-define-truth-hill.R
80 lines (63 loc) · 2.67 KB
/
functions-define-truth-hill.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Reference: Julie Dudášová, Zdeněk Valenta, Jeffrey R. Sachs (2024).
# "Elucidating vaccine efficacy using a correlate of protection, demographics, and logistic regression"
# This program is released under the GNU GPL3 license. Copyright © 2024 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved.
defineTruth <- function() {
variable <- list()
parameter <- list()
vaccinated <- list()
control <- list()
## Name ----
name <- "results-logistic-effect30-n15000"
## PoD model for data generation ----
PoD <- "I(1/(1+exp(-(param.beta*(param.beta.covariateBinary^var.covariateBinary)*var.titer + param.delta))))"
# Independent variables
variable$name <- c("var.titer", "var.covariateBinary")
# Parameters
parameter$name <- c("param.beta",
"param.beta.covariateBinary",
"param.delta")
parameter$value <- list(param.beta = -0.33,
param.beta.covariateBinary = 0.442, # 0.753; 0.442 # for 10%; 30% effect
param.delta = -2)
## Populations ----
# Vaccinated
# titer distribution
vaccinated$N = 10000
vaccinated$mean = 10
vaccinated$stdDev = 2
# covariate information
# the first value in the interval will be adjusted in the code to 1, the other into 0
vaccinated$covariateInfo$var.covariateBinary <- list("name" = "var.covariateBinary",
"values" = c("valueA","valueB"),
"prob" = c(0.25, 0.75))
# Control
# titer distribution
control$N = 5000
control$mean = 5
control$stdDev = 2
# covariate information
control$covariateInfo$var.covariateBinary <- list("name" = "var.covariateBinary",
"values" = c("valueA","valueB"),
"prob" = c(0.25, 0.75))
## Immunogenicity subsetting methods: "Full", "Fixed" ----
method <- list(name = "Full",
value = NA)
# method <- list(name = "Fixed",
# value = 1600)
PoDModel <- MakeModelObj(PoD,
variable$name,
variable$range,
parameter$name,
parameter$range,
parameter$value)
return(list(
name = name,
vaccinated = vaccinated,
control = control,
PoDModel = PoDModel,
method = method,
adjustTiters = FALSE, # this titer adjustment improves convergence:
adjustFrom = 0, # titers shouldn't be negative, otherwise the negLL fails sometimes
adjustTo = 0
))
}