ident_model | R Documentation |
Function for using the Identity of a Model test, as described by Regazzi (1999).
ident_model(
df,
factor,
reduced_model,
filter = NA,
gray_scale = TRUE,
signif = 0.05,
font = "serif",
output = "table",
eq = TRUE
)
df |
a data frame. |
factor |
Quoted name of the factor variable used to differentiate the data projects in the test. |
reduced_model |
Quoted or unquoted reduced model used in the test. The variables mentioned in the model must exist in the provided data frame. X and Y sides of the model must be separated by "~". |
filter |
Optional argument. If supplied with levels present in |
gray_scale |
If |
signif |
Numeric value for the significance level used in the test. Default: |
font |
font family used in the plots. Can be either |
output |
Defines the type of output. If |
eq |
if |
A data frame, a ggplot object, or a list, varying according to the output
argument.
Sollano Rabelo Braga sollanorb@gmail.com
Marcio leles Romarco de Oliveira marcioromarco@gmail.com
Regazzi, A. J. (1999) Teste para verificar a identidade de modelos de regressao e a igualdade de parametros no caso de dados de delineamentos experimentais, Ceres, 46(266), pp. 383–409.
library(forestmangr)
data("exfm13")
head(exfm13)
# The objective is to know if the diameter's behavior is similar among 3 species.
# For this we'll use a quadratic model. We'll use nitrogen (N) as our X variable.
ident_model(exfm13, "species", dbh ~ N + N2)
# This test shows that there are differences between the species.
# We can get more details on this using a different output, that will also
# give us a plot:
ident_model(exfm13, "species", dbh ~ N + N2, output = "table_plot",eq=FALSE)
# This gives us only the plot:
ident_model(exfm13, "species", dbh ~ N + N2, output = "table_plot",eq=FALSE)
# And this gives us additional information on the test:
ident_model(exfm13, "species", dbh ~ N + N2, output = "full",eq=FALSE)
# Looking at the plot, it seems that 2 species are behaving very similar, while
# the Pequi species is different from the other 2. We can confirm this by running
# the test in a paired fashion, using the filter argument:
ident_model(exfm13, "species", dbh ~ N + N2,
filter = c("PEQUI", "SUCUPIRA-PRETA"), output = "table_plot",eq=FALSE)
ident_model(exfm13, "species", dbh ~ N + N2,
filter = c("PEQUI", "VINHATICO"), output = "table_plot",eq=FALSE)
ident_model(exfm13, "species", dbh ~ N + N2,
filter = c("SUCUPIRA-PRETA", "VINHATICO"), output = "table_plot",eq=FALSE)
# As we imagined, a single model can be used to describe the behavior of
# the "Sucupira-preta" and "Vinhatico" species,
# and a second model is needed to explain the Pequi Variable.
# It's possible to apply a color scale to the plots, and also change it's font to arial:
ident_model(exfm13, "species", dbh ~ N + N2,output="plot",gray_scale=FALSE,font="sans",eq=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.