fittedExposureEff {fkbma} | R Documentation |
Fitted exposure effect values from Reversible Jump MCMC (rjMCMC) Model Results
Description
This function generates posterior fitted exposure effects from an rjMCMC model based on the provided data. It combines the fixed effects, spline terms, and binary parameters.
Usage
fittedExposureEff(results, newdata = NULL)
Arguments
results |
An object of class rjMCMC containing the output from the
|
newdata |
A data frame for which fitted values are to be computed. If NA, the original fitted data is used. |
Value
A matrix of fitted values.
Examples
# Example dataset
data("simulated_data")
candsplinevars <- c("X_1")
candbinaryvars <- paste0("Z_", 1:5)
candinter <- c(candsplinevars, candbinaryvars)
results <- rjMCMC(simulated_data, candsplinevars, candbinaryvars, candinter,
outcome = "Y", factor_var = "trt")
newdata = data.frame(Z_1 = 1, Z_2 = 1, Z_3 = 1, Z_4 = 1, Z_5 = 1,
trt = 1, X_1 = seq(0,1,by=0.01))
fittedExposureEff(results)
fittedExposureEff(results,newdata)