GLM statistics {brainGraph}R Documentation

Extract model fit statistics from a bg_GLM object

Description

These functions extract or calculate model fit statistics of a bg_GLM object. These can be found in the output from summary.lm.

Usage

## S3 method for class 'bg_GLM'
coef(object, ...)

## S3 method for class 'bg_GLM'
confint(object, parm, level = 0.95, ...)

## S3 method for class 'bg_GLM'
fitted(object, ...)

## S3 method for class 'bg_GLM'
residuals(object, type = c("response", "partial"), ...)

## S3 method for class 'bg_GLM'
deviance(object, ...)

coeff_determ(object, adjusted = FALSE)

## S3 method for class 'bg_GLM'
df.residual(object, ...)

## S3 method for class 'bg_GLM'
sigma(object, ...)

## S3 method for class 'bg_GLM'
vcov(object, ...)

coeff_table(object, CI = FALSE, level = 0.95)

## S3 method for class 'bg_GLM'
anova(object, region = NULL, ...)

Arguments

object

A bg_GLM object

...

Unused

parm

Vector of parameters to calculate confidence intervals for. Default is to use all parameters

level

The confidence level. Default: 0.95

type

Character string specifying the type of residuals to return. Default: 'response'

adjusted

Logical indicating whether to calculate the adjusted R-squared. Default: FALSE

CI

Logical indicating whether to include confidence intervals of parameter estimates in the coefficient summary table. Default: FALSE

region

Character vector indicating the region(s) to calculate ANOVA statistics for. Default: NULL (use all regions)

Details

These mimic the same functions that operate on lm objects, and include:

coef

Regression coefficients (parameter estimates)

confint

Confidence intervals (by default, 95%) for parameter estimates

fitted

Fitted (mean) values; i.e., the design matrix multiplied by the parameter estimates, X \hat{\beta}

residuals

Model residuals; i.e., the response/outcome variable minus the fitted values. Partial residuals can also be calculated

deviance

Model deviance, or the residual sum of squares

coeff_determ

Calculate the coefficient of determination (or R^2), adjusted or unadjusted

df.residual

Residual degrees of freedom

sigma

Residual standard deviation, sometimes called the root mean squared error (RMSE)

vcov

Variance-covariance matrix of the model parameters

coeff_table returns model coefficients, standard errors, T-statistics, and P-values for all model terms and regions in a bg_GLM object. This is the same as running summary(x)$coefficients for a lm object.

Value

A named numeric vector, matrix, or array, depending on the function:

coef

Matrix in which rownames are parameter names and column names are regions

fitted, residuals

Matrix in which rownames are Study ID's and column names are regions. If type='partial', an array is returned in which columns are terms and the 3rd dimension are regions

deviance, coeff_determ, sigma

Numeric vector with elements for each region

df.residual

Single integer; the degrees of freedom

confint, vcov, coeff_table

Numeric array; the extent of the third dimension equals the number of regions

anova returns a list of tables of class anova

ANOVA tables

The anova method calculates the so-called Type III test statistics for a bg_GLM object. These standard ANOVA statistics include: sum of squares, mean squares, degrees of freedom, F statistics, and P-values. Additional statistics calculated are: \eta^2, partial \eta^2, \omega^2, and partial \omega^2 as measures of effect size.

Note

sigma – The denominator is not the number of observations, but rather the model's residual degrees of freedom.

When calculating partial residuals, the parameter estimates are not re-calculated after removing one of the model terms.

Author(s)

Christopher G. Watson, cgwatson@bu.edu

See Also

GLM, Anova


[Package brainGraph version 3.0.0 Index]