gge_fit | R Documentation |
This function plot the fitted value or the predicted probability given the model estimated using lm
or glm
and the original data.
gge_fit( model, data, y, x, formula = NULL, n = 200, cat.values = NULL, model.id = NULL, show.points = T, pch.col = "#00000044", pch.pos = "identity", pch.col.cat = NULL, linetype = FALSE, line.size = 0.8, ylim = NULL, xlim = NULL, xlab = NULL, ylab = NULL, facets = NULL, facets.title.position = "left", facets.ncol = NULL, facets.scales = "fixed", title = NULL, title.position = "left", subtitle = NULL, footnote = NULL, legend.show.formulas = TRUE, legend.show.cat = FALSE, legend.position = "top", legend.omit = F, legend.title = NULL, legend.direction = "horizontal", legend.box = "horizontal", legend.ncol.colour = NULL, legend.ncol.fill = NULL, legend.col.title = NULL, legend.fill.title = NULL, pch.col.palette = c(brewer = "BrBG"), fill.palette = c(viridis = "B") )
model |
a model object, a list of them, or a tidy data frame with summary(ies) of the estimation(s). A model object can be one produced as output of |
data |
the original data set used to fit the model |
y |
a string with the name of the dependent variable |
x |
a string with the name of the independent variable that will be used to plotted in the x-axis. |
formula |
a expression as used in |
n |
an integer, the number of points of |
cat.values |
named list of string vectors. The name of each element of the list (the string vectors) must match variable names in the data. The element of the string vectors must be strings with the name of the categories to use in the plot with the fitted values. To generate the fitted values, the numeric columns will be set to their mean value, except the column specified in the parameter |
model.id |
a string with the name of the column that identifies the model in the table smry. |
show.points |
boolean, indicating if the points from the original data set must be plotted or not |
pch.col |
a string or rgb code. |
pch.pos |
a string with position of the points (e.g., jitter, identity). Default is identity. |
pch.col.cat |
a string vector with the name of the categorical variable in the data to use as color key for the points |
linetype |
boolean, if |
line.size |
numeric, the size of the fitted line |
ylim |
two-dimensional numeric vector with the limits of the y-axis |
xlim |
two-dimensional numeric vector with the limits of the x-axis |
xlab |
string with text to display in the x-axis |
ylab |
string with text to display in the y-axis |
facets |
a string vector with the name of the categorical variable to generate the facets. The fitted values will be produced for each facet. |
facets.title.position |
a string with |
facets.ncol |
an integer, the number of columns of grid when using facets. |
facets.scales |
used when facets are used. See |
title |
a string, the title of the plot |
title.position |
a string (or an number) with |
subtitle |
a string, the subtitle of the plot |
footnote |
a string, the footnote of the plot |
legend.show.formulas |
boolean, if |
legend.show.cat |
boolean, if |
legend.position |
a string ( |
legend.omit |
boolean, if |
legend.title |
a string with the title of the legend |
legend.direction |
see |
legend.box |
see |
legend.ncol.colour |
an integer indicating the number of columns to use in the legend with color code |
legend.ncol.fill |
an integer indicating the number of columns to use in the legend with fill code (fitted line estimation interval) |
legend.col.title |
string, the title of the legend with color code of the points. Default: |
legend.fill.title |
string, the title of the legend with color code of the fitted values estimated interval |
pch.col.palette |
a named string vector with one element. The name must be the color palette (brewer, viridis and the value a string with the pallete available (ex: "Blues" for brewer palette, "A" for viridis, etc) |
fill.palette |
same as for pch.col.palette, but it controls the color of the interval around the fitted line. It also accepts unnamed vector with string "grey" (use grey scales) or "plain" to use a single grey color |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.