Description Usage Arguments Details Examples
View source: R/APA_Validation.R
Das Modell ist linear in den Parametern. Die Residuen sind normalverteilt und im Mittel sind die Residuen null. Die Zahl der Beobachtungen muss größer sein als die Zahl der zu schätzenden Parameter: n > k.
APA_Validation Validation of Linear Models Assumptions (Testing Linear Regression Models)
Multi-collinearity diagnostics
Conducts a series of checks for multicollinearity.
Bei perfekter Multikollinearität lässt sich das Modell nicht lösen.
APA_Autocorrelation: Der Durbi-Watson (DW) Test verwendet die geschaetzten Residuen um auf Autokorrelation erster Ordnung zu testen.
Der DW d Test weist folgendes Intervall auf: 0<d<4 0: Extrem positive Autokorrelation 4: Extrem negative Autokorrelation. 2: Keine Autokorrelation
Der Breusch-Godfrey (BG) Test ist flexibler, da er auf Autokorrelation hoeherer Ordnung testet.
APA_Heteroscedasticity: mit (lmtest::bptest) Breusch-Pagan test against heteroskedasticity
APA_Durbin_Watson: APA_Durbin_Watson(fit, max.lag=1, simulate=TRUE, reps=1000, method=c("resample","normal"), alternative=c("two.sided", "positive", "negative")): Durbin-Watson Test for Autocorrelated Errors. Kopie der Funktion car::durbinWatsonTest
APA2.durbinWatsonTest: Methode für car::durbinWatsonTest Kopie von car:::print.durbinWatsonTest
multicollinearity diagnostic information
VIF (variance inflation factor)
values over 5 are troubling, should probably investigate anything over 2.5.
Fuer Squareds und Correlations design matrix rockchalk::mcDiagnose(fit)
VIF.default lm Methode aus car::vif
APA_vif: variance inflation factor, aka VIF
VIF.merModLmerTest Quelle https://hlplab.wordpress.com/2011/02/24/diagnosing-collinearity-in-lme4/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | APA_Validation(
...,
include.ftest = TRUE,
include.loglik = FALSE,
include.minus.LL = include.loglik,
include.pseudo = TRUE,
include.r = include.pseudo,
include.heteroskedasticity = TRUE,
include.durbin = TRUE,
include.levene = FALSE,
include.bartlett = FALSE,
include.multicollin = FALSE,
include.vif = FALSE,
include.sigma = FALSE,
include.rmse = FALSE,
include.aic = TRUE,
include.bic = include.aic,
include.residual = TRUE,
include.normality = TRUE,
include.deviance = TRUE,
caption = "Testing Regression Models",
note = "",
names = NULL,
output = which_output()
)
APA_Multicollinearity(
x,
caption = "Test for Multicollinearity ",
note = "",
include.vif = TRUE,
include.cor = TRUE,
output = which_output()
)
APA_Autocorrelation(x, order = 1, ...)
APA_Heteroscedasticity(x...)
APA_Durbin_Watson(
x,
caption = "Durbin-Watson Test for Autocorrelated Errors",
note = NULL,
...
)
## S3 method for class 'durbinWatsonTest'
APA2(
x,
caption = "Durbin-Watson Test for Autocorrelated Errors",
note = NULL,
...
)
VIF(x, ...)
## Default S3 method:
VIF(x, ...)
APA_vif(..., caption = "VIF", notes = "")
VIF2(..., caption = "VIF", notes = "")
## S3 method for class 'merModLmerTest'
VIF(x, ...)
|
... |
weitere Einstellungen |
include.ftest, include.loglik |
F-sratistik |
include.r, include.pseudo |
R-Quadrat |
include.heteroskedasticity |
Breusch-Pagan test |
include.durbin |
autocorrelation |
include.levene |
homogeneity of variance across groupssiehe T-Test |
include.bartlett |
Homogeneity of Variances siehe T-Test |
include.vif |
noch nicht Implementiert |
include.sigma, include.rmse |
RMSE Extract Residual Standard Deviation Sigma |
caption, note |
Ueberschrift an Output |
x |
fit-Objekt |
include.cor |
Bivariate Correlations |
loglik Likelihood Ratio Test The log-likelihood from the intercept-only restricted model. -2LL: The LL (log-likelihood from the fitted model) llhNull (The log-likelihood from the intercept-only restricted model), G2 (Minus two times the difference in the log-likelihoods)
Autocorrelation Durbin-Watson test for autocorrelation of disturbances. Ist nur bei Zeitreihendaten sinnvoll.
Homogeneity of Variances Levene Computes Levene's test for homogeneity of variance across groups. Bartlett Test of Homogeneity of Variances
Heteroskedasticity Breusch-Pagan test against heteroskedasticity.
VIF variance inflation factor. VIF values over 5 are troubling, should probably investigate anything over 2.5.
Residual RMSE values should be low (<0.5 and <0.3, respectively). SigmaResidual standard error When the residual standard error is exactly 0 then the model fits the data perfectly (likely due to overfitting)
R-Quadrats Cox und Snell R2: [ 0.2 = akzeptabel, 0.4 = gut ] Nagelkerke R2: [ 0.2 = akzeptabel, 0.4 = gut, 0.5 = sehr gut] McFaddens R2: [ 0.2 = akzeptabel, 0.4 = gut ] (see pR2)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | hkarz$Lai <- factor(hkarz$lai, 0:1, Cs(.neg, .pos))
fit2 <- glm(gruppe ~ tzell + Lai, hkarz, family = binomial)
fit1<-lm(score ~ grade + treatment + stdTest, schools)
APA_Validation(x)
APA_Validation(fit1,fit2, include.pseudo = TRUE, include.r = TRUE, include.loglik = TRUE,
include.rmse = TRUE)
# APA_Durbin_Watson
x<-lm(score ~ grade + treatment + stdTest, schools)
APA2(car::durbinWatsonTest(x))
DW_Test2(x)
lmtest::dwtest(x)
car::durbinWatsonTest(x)
## Not run:
fit<-lm(prestige ~ income + education, data=Duncan)
car::vif(fit)
VIF(fit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.