gvlma (version 1.0.0.3)

gvlma: Create a Gvlma Object

Description

Top-level function for Global Validation of Linear Models Assumptions.

Usage

gvlma(x, data, alphalevel = 0.05, timeseq, …)
gvlma.form(formula, data, alphalevel = 0.05, timeseq = 1:nrow(data), …)
gvlma.lm(lmobj, alphalevel = 0.05, timeseq)

Arguments

x

Either a formula, in which case gvlma.form will be called, or a linear models object, in which case gvlma.lm will be invoked.

formula

A linear models formula interpretable within the dataframe data. Should have a single reponse variable.

lmobj

An object resulting from a call to lm.

data

Required if x is a formula, ignored if x is an lm object. A dataframe in which the variables in the formula x can be interpreted.

alphalevel

Level of significance at which to perform the global and directional tests for linear models assumptions.

timeseq

A vector of length the number of observations in the linear model that gives a "time ordering" for the observations. This time sequence is used in the heteroscedasticity test statistic. Defaults to 1:n where n is the number of observations in the linear model.

Additional arguments such as subset that are passed on to the call to lm when x is a formula. Note that weights, while being passed on to the call to lm, will not be used in any special way in the gvlma computations.

Value

A gvlma object is returned. This is a list of class “gvlma” that contains all of the components returned by the call to lm for fitting the linear model, plus an additional component entitled “GlobalTest.” This new GlobalTest component is a list with the following components:

LevelOfSignificance

The level of significance at which the decisions reported for the global and directional tests were made.

GlobalStat4

A list consisting of the components Value, pvalue and Decision containing the global test statistic value, associated p-value, and text phrase reporting the decision concerning appropriateness of the linear model assumptions.

DirectionalStat1

A list consisting of the Value, pvalue and Decision associated with the skewness directional test statistic.

DirectionalStat2

A list consisting of the Value, pvalue and Decision associated with the kurtosis directional test statistic.

DirectionalStat3

A list consisting of the Value, pvalue and Decision associated with the link function directional test statistic.

DirectionalStat4

A list consisting of the Value, pvalue and Decision associated with the heteroscedasticity directional test statistic.

timeseq

The ordering of the observations used when computing the heteroscedasticity directional statistic.

call

The call used to invoke gvlma.

Details

gvlma is the top-level function to create a gvlma object for assessment of linear models assumptions.

References

Pena, EA and Slate, EH (2006). “Global validation of linear model assumptions,” J.\ Amer.\ Statist.\ Assoc., 101(473):341-354.

See Also

plot.gvlma, deletion.gvlma, update.gvlma, lm

Examples

Run this code
# NOT RUN {
data(CarMileageData)
CarModelAssess <- gvlma(NumGallons ~ MilesLastFill + NumDaysBetw,
                        data = CarMileageData)
CarModelAssess
summary(CarModelAssess)
CarModel2 <- gvlma(lm(NumGallons ~ MilesLastFill + NumDaysBetw,
                      data = CarMileageData))
CarModel2
summary(CarModel2)
plot(CarModel2)
# }

Run the code above in your browser using DataCamp Workspace