lma_check | R Documentation |
The performed tests are:
partial p.values calculated by lm
are all below a given value
tests implemented by gvlma
variance inflation factors calculated by vif
are all below a given value
lma_check(formule, df, max.pvalue = 0.05, max.vif = 5)
formule |
formula. model to be evaluated |
df |
data.frame. data to evaluate the model |
max.pvalue |
numeric. maximum p-value of variables included in the model |
max.vif |
numeric. maximum variance inflation factor of variables included in the model |
a one line data.frame with 5 columns.
a string: evaluated formula
a numeric: the adjusted R squared of the model
a boolean: do all variables in the model have a partial p-value < max.pvalue
a boolean: are all tests implemented by gvlma
false
a boolean: is the variance inflation factor computed with vif
of all variables < max.vif
# load Quatre Montagnes dataset
data(quatre_montagnes)
# fit lm model
model <- lm(G_m2_ha ~ zmax + zq95, data = quatre_montagnes)
lma_check(eval(model$call[[2]]), quatre_montagnes)
# trying with Box-Cox transformation of dependent variable
# and other independent variables
model <- lm(boxcox_tr(G_m2_ha, -0.14) ~ Tree_meanH + Tree_density + zpcum7, data = quatre_montagnes)
lma_check(eval(model$call[[2]]), quatre_montagnes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.