caglm: Calibrated inference for generalized linear models

View source: R/distributional_uncertainty.R

caglmR Documentation

Calibrated inference for generalized linear models

Description

Calibrated inference for generalized linear models

Usage

caglm(formulas, family, data, target, ...)

Arguments

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

Examples

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))

rothenhaeusler/calinf documentation built on May 2, 2022, 12:44 p.m.