Learn R Programming

asremlPlus (version 2.0-2)

pred.present.asreml: This function forms the predictions for each significant term and presents them in tables and/or graphs.

Description

This function forms the predictions for each term in terms using a supplied asreml object and predictparallel.asreml. Tables are produced using predictparallel.asreml, in conjunction with predictiondiffs.asreml, with the argument tables specifying which tables are printed. The argument plots, along with transform.power, controls which plots are produced. The plots are produced using predictionplot.asreml, with line plots produced when variables involving x.num or x.fac are involved in classify for the predictions and bar charts otherwise. In order to get the correct predictions you may need to supply additional arguments to predict through ... e.g. present.

Usage

pred.present.asreml(terms, asreml.obj = NULL, 
                    wald.tab = NULL, dDF.na = "residual", dDF.values = NULL, 
                    x.num = NULL, x.fac = NULL, nonx.fac.order = NULL,  
                    x.pred.values = NULL, x.plot.values = NULL, 
                    plots = "predictions", panels = "multiple", 
                    graphics.device = "NULL", 
                    error.intervals = "Confidence", avsed.tolerance = 0.25, 
                    titles = NULL, colour.scheme = "colour", save.plots = FALSE, 
                    transform.power = 1, offset = 0, scale = 1, 
                    pairwise = TRUE, tables = "all", levels.length = NA, 
                    alpha = 0.05, inestimable.rm = TRUE, trace = FALSE, ...)

Arguments

terms
a character vector giving the terms for which predictions are required.
asreml.obj
asreml object for a fitted model.
wald.tab
a data frame containing the pseudo-anova table for the fixed terms produced by a call to wald.asreml. The main use of it here is in getting denominator degrees of freedom when
dDF.na
the method to use to obtain approximate denominator degrees of freedom. when the numeric or algebraic methods produce an NA. Consistent with when no denDF are available, the default is "residual" a
dDF.values
A vector of values to be used when dDF.na = "supplied". Its values will be used when denDF in a test for a fixed effect is NA. This vector must be the same length as the nu
x.num
A character string giving the name of the numeric covariate that corresponds to x.fac, is potentially included in terms in the fitted model and which corresponds to the x-axis variable. It should
x.fac
A character string giving the name of the factor that corresponds to x.num, is potentially included in terms in the fitted model and which corresponds to the x-axis variable. It should have the sam
nonx.fac.order
A character vector giving the order in which factors other than x.fac are to be plotted in plots with multiple panels (i.e. where the number of non-x factors is greater than 1). The
x.pred.values
The values of x.num for which predicted values are required.
x.plot.values
The actual values to be plotted on the x axis or in the labels of tables. They are needed when values different to those in x.num are to be plotted or x.fac is to be plotted beca
plots
Possible values are "none", "predictions", "backtransforms" and "both". Plots are not produced if the value is "none". If data are not transformed for
panels
Possible values are "single" and "multiple". When line plots are to be produced, because variables involving x.num or x.fac are involved in classify for
graphics.device
A character specifying a graphics device for plotting. The default is graphics.device = NULL, which will result in plots being produced on the current graphics device. Setting it to
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 "none", "StandardError", "Confidence
avsed.tolerance
The values of the range of the SEDs divided by the average of the SEDs that, if exceeded, will cause calculations and plotting to revert to confidence intervals. It should be a value between 0 and 1.
titles
A list, each component of which is named for an object name and contains a character string giving a title to use in output (e.g. tables and graphs) for the object. Here they will be used for
colour.scheme
A character string specifying the colour scheme for the plots. The default is "colour" which produces coloured lines and bars, a grey background and white gridlines. A value of "black"
save.plots
A logical that determines whether any plots will be saved. If they are to be saved, a file name will be generated that consists of the following elements separated by full stops: the response variable name with
transform.power
A number specifying the power of a transformation, if one has been applied to the response variable. Unless it is equal to 1, the default, back-transforms of the predictions will be obtained and presented in tables
offset
A number that has been added to each value of the response after any scaling and before applying any power transformation. Unless it is equal to 0, the default, back-transforms of the predictions will be obtained and pres
scale
A number by which each value of the response has been multiply before adding any offset and applying any power transformation. Unless it is equal to 1, the default, back-transforms of the predictions will be obtained and p
pairwise
A logical indicating whether all pairise differences of the predictions and their standard errors and p-values are to be computed and stored. If tables is equal to "differences"
tables
The elements of the alldiffs object to print. Possible values are "none", "predictions", "backtransforms", "nodifferences",
levels.length
The maximum number of characters from the the levels of factors to use in the row and column labels of the tables produced by predictiondiffs.asreml.
alpha
the significance level for the test or 1 - alpha is the confidence level for confidence intervals.
inestimable.rm
A logical indicating whether rows for predictions that are not estimable are to be removed from the components of the alldiffs object.
trace
if TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed.
...
further arguments passed to predict.asreml via predictparallel.asreml and to ggplot via

Value

  • a list containing a alldiffs object for each term for which tables are produced. The names of the components of this list are the terms with full-stops (.) replacing colons (:).

See Also

predictparallel.asreml, predictiondiffs.asreml, predictionplot.asreml, print.alldiffs, as.Date, Devices

Examples

Run this code
pred.present.asreml(choose$sig.terms, current.asrt$asreml.obj, current.asrt$wald.tab, 
                      x.fac = "Date", x.num = "xDay", 
                      x.pred.values=sort(unique(Runoff.longi.dat$xDay)),
                      x.plot.values=c(0,28,56,84),
                      x.title = "Days since first observation",
                      y.title = "Predicted log(Turbidity)",
                      present = c("Type","Species","Sources"))

Run the code above in your browser using DataLab