Skip to content

Commit be80180

Browse files
committed
a complete rendering of the pkgdown site
1 parent c36ea27 commit be80180

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+971
-671
lines changed

R/maic.R

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ maic_weights <- function(X_EM) {
1818
N <- nrow(X_EM) # number of individuals
1919
K <- ncol(X_EM) # number of covariates
2020
init <- rep(1, K) # arbitrary starting point for optimizer
21+
22+
##TODO: what about scaling X_EM?
23+
## because large values return error
24+
2125
Q.min <- optim(fn=Q, X=X_EM, par=init, method="BFGS")
2226

2327
# finite solution is the logistic regression parameters
@@ -34,8 +38,8 @@ maic_weights <- function(X_EM) {
3438

3539
#' Objective function to minimize for standard method of moments MAIC
3640
#'
37-
#' @param beta Beta
38-
#' @param X X
41+
#' @param beta Beta coefficient
42+
#' @param X Covariate value
3943
#' @keywords internal
4044
#'
4145
Q <- function(beta, X) {
@@ -50,9 +54,11 @@ Q <- function(beta, X) {
5054
#' @param indices Vector of indices, same length as original,
5155
#' which define the bootstrap sample
5256
#' @param formula Linear regression formula
53-
#' @param family Family object
57+
#' @param family A character string specifying the family distribution (e.g., "binomial").
5458
#' @template args-ald
55-
#' @return Fitted probabilities for _A_ and _C_
59+
#' @param hat_w MAIC weights; default `NULL` which calls [maic_weights()]
60+
#'
61+
#' @return Vector of fitted probabilities for treatments _A_ and _C_
5662
#' @seealso [IPD_stats.maic()]
5763
#' @keywords internal
5864
#'
@@ -61,6 +67,7 @@ maic.boot <- function(ipd, indices = 1:nrow(ipd),
6167
hat_w = NULL) {
6268

6369
dat <- ipd[indices, ] # bootstrap sample
70+
n_ipd <- length(indices)
6471

6572
effect_modifier_names <- get_eff_mod_names(formula)
6673

@@ -72,7 +79,7 @@ maic.boot <- function(ipd, indices = 1:nrow(ipd),
7279
mean_names <- get_mean_names(ald, effect_modifier_names)
7380

7481
# centre AC effect modifiers on BC means
75-
dat_ALD_means <- ald[, mean_names][rep(1, nrow(X_EM)), ]
82+
dat_ALD_means <- ald[rep_len(1, n_ipd), mean_names, drop = FALSE]
7683
X_EM <- X_EM - dat_ALD_means
7784

7885
if (is.null(hat_w)) {

docs/404.html

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE.html

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/Binary_data_Remiro-Azocar.html

Lines changed: 60 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/Binary_data_example.html

Lines changed: 60 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/Continuous_data_example.html

Lines changed: 180 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/Count_data_example.html

Lines changed: 12 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/comparison-with-other-packages.html

Lines changed: 531 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/index.html

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/authors.html

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)