predictionplot.asreml {asreml3Plus} | R Documentation |
This function plots the predictions y
that are based on
classify
stored in the data.frame data
. The package
ggplot2
is used to produce the plots. Line plots are
produced when variables involving x.num
or x.fac
are
involved in classify
for the predictions; otherwise, bar
charts are produced. Further, for line charts, the argument panels
determines whether a single plot or multiple plots in a single window
are produced; for bar charts, the argument panels
is
ignored.
predictionplot.asreml(classify, y, data, x.num = NULL, x.fac = NULL, nonx.fac.order = NULL, colour.scheme = "colour", panels = "multiple", graphics.device = NULL, error.intervals = "Confidence", titles = NULL, y.title = NULL, filestem = NULL, ggplotFuncs = NULL, ...)
classify |
a character string giving the combinations of the independent
variables on which the predictions are based. It is
an interaction type term formed from the independent variables,
that is, separating the variable names with the |
y |
a character string giving the name of the variable that is to be plotted on the Y axis. |
data |
a |
x.num |
A character string giving the name of the numeric covariate that
corresponds to |
x.fac |
A character string giving the name of the factor that corresponds to
|
nonx.fac.order |
A character vector giving the order in which factors other
than |
colour.scheme |
A character string specifying the colour scheme for the plots.
The default is |
panels |
Possible values are |
graphics.device |
A |
error.intervals |
A character string indicating the type of error interval, if any,
to calculate and plot in order to indicate uncertainty in the results.
Possible values are |
titles |
A |
filestem |
A character sting giving the beginning of the name of the file in which to
save the plot. If |
y.title |
The title to be displayed on the y axis of any plot. |
ggplotFuncs |
A |
... |
further arguments passed to |
no values are returned.
predictiondiffs.asreml
, pred.present.asreml
,
ggplot
, Devices
## Not run: data(WaterRunoff.dat) current.asr <- asreml(fixed = log.Turbidity ~ Benches + Sources + Type + Species + Sources:Type + Sources:Species + Sources:xDay + Species:xDay + Species:Date, data = WaterRunoff.dat, keep.order = TRUE) current.asrt <- asrtests(current.asr, NULL, NULL) predictions <- predict(current.asr, class="Species:Date:xDay", present = c("Type","Species","Sources"), levels=list(xDay=unique(WaterRunoff.dat$xDay)))$predictions$pvals predictions <- predictions[predictions$est.status == "Estimable",] predictionplot.asreml(classify="Species:Date:xDay", y = "predicted.value", data = predictions, wald.tab = current.asrt$wald.tab, x.num = "xDay", x.fac = "Date", x.title = "Days since first observation", y.title = "Predicted log(Turbidity)", present = c("Type","Species","Sources"), error.intervals = "none", ggplotFuncs = list(ggtitle("Transformed turbidity over time"))) diffs <- predictparallel.asreml(classify="Species:Date:xDay", present=c("Type","Species","Sources"), asreml.obj = current.asr, tables = "none", x.num = "xDay", x.fac = "Date", x.pred.values=sort(unique(WaterRunoff.dat$xDay)), x.plot.values=c(0,28,56,84), wald.tab = current.asrt$wald.tab) x.title <- "Days since first observation" names(x.title) <- "xDay" predictionplot.asreml(classify="Species:Date:xDay", y = "predicted.value", data = diffs$predictions, wald.tab = current.asrt$wald.tab, x.num = "xDay", x.fac = "Date", titles = x.title, y.title = "Predicted log(Turbidity)") ## End(Not run)