getCoef: Get estimates for a parameter combination from a regression...

View source: R/getCoef.R

getCoefR Documentation

Get estimates for a parameter combination from a regression model

Description

This function generates point estimates and 95 regression model, for any combination of model parameters.

Usage

getCoef(m, par)

Arguments

m

A regression model (of class 'lm','glm','lmerMod','glmerMod' or 'coxph')

par

A matrix (or data.frame) specifying the parameter combinations.

Value

A data.frame with three columns: est, lo, hi providing the point estimate and lower/upper limits of the 95 parameter combination provided in par. Thus the return value has the same number of rows as par.

The function supports objects of class 'lm' and 'glm', 'lmerMod' and 'glmerMod' (mixed-effects models from package lme4, for which only the fixed-effects part is considered) and 'coxph' (from package survival)

Examples

mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")
pars <- data.frame(gpa=c(2,2,3), rank=c(3,4,4))
getCoef(mylogit, pars)


thlytras/Rivets documentation built on April 16, 2024, 5:43 a.m.