Skip to content

Commit

Permalink
Implement baseline risk meta-regression for other models
Browse files Browse the repository at this point in the history
  • Loading branch information
ndunnewind committed Oct 18, 2024
1 parent efdcc87 commit dbab7da
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions inst/stan/binomial_1par.stan
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ transformed parameters {
X_agd_arm * beta_tilde + offset_agd_arm :
X_agd_arm * beta_tilde;

// Baseline risk meta-regression
if (brmr_n_col > 0) {
eta_agd_arm_noRE += (X_agd_arm[,1:totns] * mu - xbar_mu - 1) .* (X_agd_arm[,brmr_col] * beta_tilde[brmr_col]);
}
Expand Down
5 changes: 5 additions & 0 deletions inst/stan/binomial_2par.stan
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ transformed parameters {
X_agd_arm * beta_tilde + offset_agd_arm :
X_agd_arm * beta_tilde;

// Baseline risk meta-regression
if (brmr_n_col > 0) {
eta_agd_arm_noRE += (X_agd_arm[,1:totns] * mu - xbar_mu - 1) .* (X_agd_arm[,brmr_col] * beta_tilde[brmr_col]);
}

if (nint_max > 1) { // -- If integration points are used --
if (RE) {

Expand Down
5 changes: 5 additions & 0 deletions inst/stan/normal.stan
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ transformed parameters {
X_agd_arm * beta_tilde + offset_agd_arm :
X_agd_arm * beta_tilde;

// Baseline risk meta-regression
if (brmr_n_col > 0) {
eta_agd_arm_noRE += (X_agd_arm[,1:totns] * mu - xbar_mu - 1) .* (X_agd_arm[,brmr_col] * beta_tilde[brmr_col]);
}

if (nint_max > 1) { // -- If integration points are used --
if (RE) {

Expand Down
5 changes: 5 additions & 0 deletions inst/stan/ordered_multinomial.stan
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ transformed parameters {
X_agd_arm * beta_tilde + offset_agd_arm :
X_agd_arm * beta_tilde;

// Baseline risk meta-regression
if (brmr_n_col > 0) {
eta_agd_arm_noRE += (X_agd_arm[,1:totns] * mu - xbar_mu - 1) .* (X_agd_arm[,brmr_col] * beta_tilde[brmr_col]);
}

if (nint_max > 1) { // -- If integration points are used --

if (RE) {
Expand Down
5 changes: 5 additions & 0 deletions inst/stan/poisson.stan
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ transformed parameters {
X_agd_arm * beta_tilde + offset_agd_arm :
X_agd_arm * beta_tilde;

// Baseline risk meta-regression
if (brmr_n_col > 0) {
eta_agd_arm_noRE += (X_agd_arm[,1:totns] * mu - xbar_mu - 1) .* (X_agd_arm[,brmr_col] * beta_tilde[brmr_col]);
}

if (nint_max > 1) { // -- If integration points are used --
if (RE) {

Expand Down

0 comments on commit dbab7da

Please sign in to comment.