View source: R/distributional_uncertainty.R
caglm | R Documentation |
Calibrated inference for generalized linear models
caglm(formulas, family, data, target, ...)
formulas |
A list of formulas |
family |
a description of the error distribution and link function to be used in the model |
data |
A dataframe containing the variables in the model |
n <- 1000 X <- rnorm(n) Z1 <- rnorm(n) Z2 <- rnorm(n) logit <- 1*X + X^2 + Z1 + Z2 Y = rbinom(n, size = 1, prob = exp(logit)/(1+exp(logit))) df <- data.frame(cbind(X,Y,Z1,Z2)) data <- as.data.frame(cbind(Y,X)) formulas <- list(Y~X, Y ~ X + I(X^2), Y ~ X + Z1, Y ~ X + Z2 + I(X^2), Y ~ X + Z1 + Z2 + I(X^2)) caglm(formulas, family = "binomial", data=data, target="X") summary(glm(Y ~ X + Z1 + Z2 + I(X^2), family = "binomial", data=df))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.