Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
# S3 method for geeglm tidy(x, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE, ...)
x | A |
---|---|
conf.int | Logical indicating whether or not to include a confidence
interval in the tidied output. Defaults to |
conf.level | The confidence level to use for the confidence interval
if |
exponentiate | Logical indicating whether or not to exponentiate the
the coefficient estimates. This is typical for logistic and multinomial
regressions, but a bad idea if there is no log or logit link. Defaults
to |
... | Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in |
If conf.int = TRUE
, the confidence interval is computed with
the an internal confint.geeglm()
function.
If you have missing values in your model data, you may need to
refit the model with na.action = na.exclude
or deal with the
missingness in the data beforehand.
A tibble::tibble()
with columns:
Upper bound on the confidence interval for the estimate.
Lower bound on the confidence interval for the estimate.
The estimated value of the regression term.
The two-sided p-value associated with the observed statistic.
The value of a T-statistic to use in a hypothesis that the regression term is non-zero.
The standard error of the regression term.
The name of the regression term.
if (requireNamespace("geepack", quietly = TRUE)) { library(geepack) data(state) ds <- data.frame(state.region, state.x77) geefit <- geeglm(Income ~ Frost + Murder, id = state.region, data = ds, family = gaussian, corstr = "exchangeable" ) tidy(geefit) tidy(geefit, conf.int = TRUE) } #> $fct #> function(dose, parm) #> { #> parmMat <- matrix(parmVec, nrow(parm), numParm, byrow = TRUE) #> parmMat[, notFixed] <- parm #> fd(dose, parmMat[, 1], parmMat[, 2], parmMat[, 3], parmMat[, 4], parmMat[, 5]) #> } #> <bytecode: 0x55bef4906c20> #> <environment: 0x55bf0c1b8d10> #> #> $ssfct #> function(dframe) #> { #> x <- dframe[, 1] #> y <- dframe[, 2] #> #> ## Finding initial values for c and d parameters #> cdVal <- findcd(x, y) #> if (useFixed) {} # not implemented at the moment #> #> ## Finding initial values for b, e, and f parameters #> if (logg) #> { #> bVal <- 0.75 * sd(log(x[y > quantile(y, .75)])) #> } else { #> bVal <- 0.75 * sd(x[y > quantile(y, .75)]) #> } #> befVal <- c(bVal, x[which.max(y)], 1) #> # befVal <- c(sd(x), mean(x), 1) #> #> return(c(befVal[1], cdVal, befVal[2:3])[is.na(fixed)]) #> } #> <bytecode: 0x55befcb76b18> #> <environment: 0x55bf0c1bbe90> #> #> $names #> [1] "b" "c" "d" "e" "f" #> #> $deriv1 #> function(dose, parm) #> { #> parmMat <- matrix(parmVec, nrow(parm), numParm, byrow = TRUE) #> parmMat[, notFixed] <- parm #> attr(fd(dose, parmMat[, 1], parmMat[, 2], parmMat[, 3], parmMat[, 4], parmMat[, 5]), "gradient")[, notFixed] #> } #> <bytecode: 0x55bef4910b78> #> <environment: 0x55bf0c1b8d10> #> #> $deriv2 #> NULL #> #> $derivx #> function(dose, parm) #> { #> parmMat <- matrix(parmVec, nrow(parm), numParm, byrow = TRUE) #> parmMat[, notFixed] <- parm #> #> dFct <- function (dose, b, c, d, e, f) #> { #> .expr1 <- d - c #> .expr4 <- (dose - e)/b #> .expr5 <- .expr4^2 #> .expr6 <- sqrt(.expr5) #> .expr9 <- exp(-0.5 * .expr6^f) #> .value <- c + .expr1 * .expr9 #> .grad <- array(0, c(length(.value), 1L), list(NULL, c("dose"))) #> .grad[, "dose"] <- -(.expr1 * (.expr9 * (0.5 * (.expr6^(f - 1) * (f * (0.5 * (2 * (1/b * .expr4) * .expr5^-0.5))))))) #> attr(.value, "gradient") <- .grad #> .value #> } #> attr(dFct(dose, parmMat[, 1], parmMat[, 2], parmMat[, 3], parmMat[, 4], parmMat[, 5]), "gradient") #> } #> <bytecode: 0x55bef491c6d0> #> <environment: 0x55bf0c1b8d10> #> #> $edfct #> function(parm, respl, reference, type, ...) #> { #> parmVec[notFixed] <- parm #> # if (type == "absolute") #> # { #> # p <- 100*((parmVec[3] - respl)/(parmVec[3] - parmVec[2])) #> # } else { #> # p <- respl #> # } #> # if ( (parmVec[1] < 0) && (reference == "control") ) #> # { #> # p <- 100 - p #> # } #> p <- absToRel(parmVec, abs(respl), type) #> #> ## Reversing p #> if (identical(type, "absolute")) #> { #> p <- 100 - p #> } #> if (identical(type, "relative") && (parmVec[1] < 0) && (reference == "control")) #> { #> p <- 100 - p #> } #> #> pProp <- 1 - (100-p) / 100 #> #> ## deriv(~b*(-2*22)^(1 / f)+e, c("b", "c", "d", "e", "f"), function(b,c,d,e,f){}) #> ## using "22" insted of log(pProp) #> EDfct <- function (b, c, d, e, f) #> { #> # .expr2 <- -2 * 22 #> .expr2 <- -2 * log(pProp) #> .expr4 <- sign(respl) * .expr2^(1/f) #> .value <- b * .expr4 + e #> .grad <- array(0, c(length(.value), 5L), list(NULL, c("b", "c", "d", "e", "f"))) #> .grad[, "b"] <- .expr4 #> .grad[, "c"] <- 0 #> .grad[, "d"] <- 0 #> .grad[, "e"] <- 1 #> .grad[, "f"] <- -(b * (.expr4 * (log(.expr2) * (1/f^2)))) #> attr(.value, "gradient") <- .grad #> .value #> } #> EDp <- EDfct(parmVec[1], parmVec[2], parmVec[3], parmVec[4], parmVec[5]) #> EDder <- attr(EDfct(parmVec[1], parmVec[2], parmVec[3], parmVec[4], parmVec[5]), "gradient") #> return(list(EDp, EDder[notFixed])) #> } #> <bytecode: 0x55bef493be70> #> <environment: 0x55bf0c1b8d10> #> #> $name #> [1] "family" #> #> $text #> [1] "Gaussian" #> #> $noParm #> [1] 5 #> #> $lowerAs #> function(parm) #> { #> parmVec[indexVec] <- parm #> parmVec[parmNo] #> } #> <bytecode: 0x55bef4dd4870> #> <environment: 0x55bf0c1ba8b0> #> #> $upperAs #> function(parm) #> { #> parmVec[indexVec] <- parm #> parmVec[parmNo] #> } #> <bytecode: 0x55bef4dd4870> #> <environment: 0x55bf0c1ba610> #> #> $monoton #> [1] NA #> #> $fixed #> [1] NA NA NA NA NA #> #> attr(,"class") #> [1] "gaussian" #> Error in glm(formula = Income ~ Frost + Murder, family = gaussian, data = ds): 'family' not recognized