Hi, anybody knows if the gvlma() function to check the assumptions of the linear model works for panel data or for time series?
It will work with data frame representing chronologically ordered observations but not with time series objects. Mechanically.
library(gvlma)
fit <- lm(Ozone ~ Solar.R + Wind + Temp, data = airquality)
gvlma(fit)
#>
#> Call:
#> lm(formula = Ozone ~ Solar.R + Wind + Temp, data = airquality)
#>
#> Coefficients:
#> (Intercept) Solar.R Wind Temp
#> -64.34208 0.05982 -3.33359 1.65209
#>
#>
#> ASSESSMENT OF THE LINEAR MODEL ASSUMPTIONS
#> USING THE GLOBAL TEST ON 4 DEGREES-OF-FREEDOM:
#> Level of Significance = 0.05
#>
#> Call:
#> gvlma(x = fit)
#>
#> Value p-value Decision
#> Global Stat 111.50301 0.000e+00 Assumptions NOT satisfied!
#> Skewness 34.34297 4.621e-09 Assumptions NOT satisfied!
#> Kurtosis 50.45786 1.217e-12 Assumptions NOT satisfied!
#> Link Function 26.64685 2.442e-07 Assumptions NOT satisfied!
#> Heteroscedasticity 0.05533 8.140e-01 Assumptions acceptable.
par(mfrow = c(2,2))
plot(fit)
Created on 2023-05-31 with reprex v2.0.2
This data will seldom pass due to the non-independence of residuals. There are alternatives that take into account the temporal aspect. See the chapter on time series linear regression in the fpp3 text.
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.