Learn R Programming

lmvar (version 1.5.2)

summary.lmvar: Summary overview for an object of class 'lmvar'

Description

Summary overview for an object of class 'lmvar'.

Usage

# S3 method for lmvar
summary(object, mu = TRUE, sigma = TRUE, ...)

Arguments

object

Object of class 'lmvar'

mu

Boolean, specifies whether or not to include the coefficients \(\beta_\mu\) in the table of coefficients

sigma

Boolean, specifies whether or not to include the coefficients \(\beta_\sigma\) in the table of coefficients

...

For compatibility with summary generic

Value

An object of class 'summary_lmvar'. This is a list with the following members:

  • call Call that created object

  • coefficients Data frame with one row for each element of \(\beta_\mu\) and \(\beta_\sigma\) and the following variables.

    • Estimate maximum-likelihood estimate

    • Std. Error standard error, defined as \(\sqrt(var(\beta))\) with \(var(\beta)\) the estimated variance of \(\beta\).

    • z value z-statistic, defined as \(\beta / \sqrt(var(\beta))\)

    • Pr(>|z|) p-value of the z-statistic, calculated from the standard normal distribution.

  • residuals A numeric vector with the minimum, the 25% quartile, the median, the 75% quartile and the maximum standardized residual. The standardized residual of an observation is defined as \((y - \mu) / \sigma\) where \(y\) is the value of the observation, \(\mu\) the expectation value and \(\sigma\) the standard deviation of the observation.

  • sigma A numeric vector with the minimum, the 25% quartile, the median, the 75% quartile and the maximum standard deviation \(\sigma\) of all observations.

  • aliased_mu A named logical vector. The names are the column names of the user-supplied model matrix \(X_\mu\). The values (TRUE or FALSE) tell whether or not the column has been removed by lmvar to make the matrix full-rank.

  • aliased_sigma As aliased_mu but for the user-supplied model matrix \(X_\sigma\).

  • logLik_ratio The difference in log-likelihood between the model in object and a classical linear model with model matrix \(X_\mu\) and a constant variance for all observations.

  • df_additional The difference in degrees in freedom between the model in object and a classical linear model with model matrix \(X_\mu\) and a constant variance for all observations. Is equal to NULL if \(X_\sigma\) does not contain an intercept term.

  • p_value The p-value of 2 loglik_ratio, calculated from a chi-squared distribution with df degrees of freedom. Is equal to NULL if there are no additional degrees of freedom.

  • nobs The number of observations in object.

  • df The degrees of freedom of the fit in object.

  • options A list of argument-values of the function call.

Details

Standard errors and z-statistics are calculated under the assumption of asymptotic normality for maximum likelihood estimators. They may not be reliable when the number of observations in object is small.

See Also

coef to extract the matrix with estimates, standard-errors, t-statistics and p-values for \(\beta_\mu\) and \(\beta_\sigma\) from a 'summary_lmvar' object.

vcov.lmvar for the covariance matrix of the \(\beta_\mu\) and \(\beta_\sigma\) in an object of class 'lmvar'.

print.summary_lmvar for a print method for a 'summary_lmvar' object.

fitted.lmvar for the expected values and standard deviations of the observations in an object of class 'lmvar'.

logLik.lmvar for the log-likelihood of a fit in an object of class 'lmvar'.

alias.lmvar_no_fit to obtain the aliased columns of the user-supplied model matrices in the call of lmvar.

Examples

Run this code
# NOT RUN {
# As example we use the dataset 'attenu' from the library 'datasets'. The dataset contains
# the response variable 'accel' and two explanatory variables 'mag'  and 'dist'.
library(datasets)

# Create the model matrix for the expected values
X = cbind(attenu$mag, attenu$dist)
colnames(X) = c("mag", "dist")

# Create the model matrix for the standard deviations.
X_s = cbind(attenu$mag, 1 / attenu$dist)
colnames(X_s) = c("mag", "dist_inv")

# Carry out the fit
fit = lmvar(attenu$accel, X, X_s)

# Print a summary of the fit
summary(fit)

# Include only the coefficients beta for the expected values
summary(fit, sigma = FALSE)

# Include only the coefficients beta for the standard deviations
summary(fit, mu = FALSE)

# Extract the matrix of coefficients from the summary
coef(summary(fit))
# }

Run the code above in your browser using DataLab