1. Home
  2. A2RDA procedure

A2RDA procedure

Saves results from an analysis of variance in R data frames (R.W. Payne & Z.Zhang).


TERM = formula Treatment term whose means, effects etc. are to be saved; must be set if any of these are to be saved, unless there is only one treatment term
STRATUM = formula Model term of the lowest stratum to be searched for effects and contrasts; default * implies the lowest stratum
SUPPRESSHIGHER = string token Whether to suppress the searching of higher strata if a term is not found in STRATUM (yes, no); default no
LSDLEVEL = scalar Significance level (%) for least significant differences and multiple comparisons; default 5
EQFACTORS = factors Factors whose levels are to be assumed to be equal within the comparisons between means calculated for effective standard errors of treatment means
RMETHOD = string tokens Types of residuals to form (simple, standardized, combined); default simp
MCOMPARISON = string token Method to use to make multiple comparisons between the means (tukey, regwmr, duncan, scheffe, fplsd, fulsd, fpstudentizedlsd, fustudentizedlsd, bonferroni, sidak); default * i.e. none
SAVE = ANOVA save structure Specifies the analysis from which to save the results; default * i.e. most recent one


INFORMATION = string tokens What to save (aovtable, covariates, effects, cbeffects, partialeffects, contrasts, means, semeans, sedmeans, lsdmeans, dfmeans, cbmeans, secbmeans, sedcbmeans, replications, fittedvalues, missingvalues, stratumvariances, %cv, fixedcoefficients, randomcoefficients); must be set
OUTFILENAME = texts Name of the R (.rda) file to create for each set of information; must be set
COLUMNNAMES = texts Specifies names for the columns in the file; if this is not set, suitable names are chosen automatically
EXIT = scalars Records the exit status, 0 if the information was saved successfully, 1 otherwise


A2RDA puts results from an analysis of variance into R data frames. By default the results are from the most recent ANOVA, but you use the SAVE option to specify the save structure from some other analysis.

The INFORMATION parameter specifies the information to save, with settings:

    aovtable analysis of variance table;
    covariates estimated covariate regression coefficients and their standard errors (if any covariates in the analysis);
    effects table of treatment effects;
    cbeffects table of effects for a treatment term, combining the information from every stratum where it is estimated;
    partialeffects table of partial effects for a treatment term, adjusted for every other treatment term;
    contrasts estimated treatment contrasts;
    means table of predicted means;
    semeans table of effective standard errors of means;
    sedmeans symmetric matrix of standard errors of differences of means;
    lsdmeans symmetric matrix of least significant differences of means;
    dfmeans symmetric matrix of degrees of freedom for differences of means;
    cbmeans table of predicted means for a treatment term, combining information from all the strata in which its effects are estimated;
    secbmeans table of effective standard errors of combined treatment means;
    sedcbmeans symmetric matrix of standard errors of differences of combined treatment means;
    replications replication table;
    fittedvalues y-variate, fitted values and residuals;
    missingvalues estimates for missing values (if any);
    stratumvariances estimated variances of the units in each stratum, stratum variance components and effective numbers of degrees of freedom;
    %cv coefficients of variation, numbers of residual degrees of freedom and standard errors of individual units in each stratum;
    fixedcoefficients estimated treatment effects and covariate regression coefficients;
    randomcoefficients residuals (from all the strata).

The OUTFILENAME parameter specifies the name of the file to save the information. If this does not have a .rda extension, one will be appended to the name automatically.

The COLUMNNAMES parameter allows you to specify a text containing names to use for the columns in the file. Thus may be useful if you want to avoid name clashes when you are saving several sets of output.

The EXIT parameter can save a scalar to record the exit status for each set of information. This contains zero if the information was saved successfully, and one otherwise. (For example, it will not be possible to save missing-value estimates if no responses were missing.)

The TERM option specifies the treatment term whose means, effects etc. are to be saved. This must be set if any of these are to be saved, unless there is only one treatment term. The EQFACTORS option allows you to specify factors within the tables of means whose levels are assumed to be equal for the two means when forming effective standard errors of treatment means (see the AKEEP directive for more details).

In designs where there is partial confounding, and treatment terms are estimated in more than one stratum, options STRATUM and SUPPRESSHIGHER allow you to specify the strata from which effects and contrasts are taken. By default, Genstat searches all the strata, and takes the information from the lowest of the strata where the term is estimated. If you set the STRATUM option, only strata down to the specified stratum are searched. By setting SUPPRESSHIGHER=yes, you can restrict the search to only that stratum.

The LSDLEVEL option specifies the significance level (%) to use in the calculation of least significant differences, or the experiment-wise significance level for multiple comparisons (default 5%).

The MCOMPARISON option specifies the method to use for multiple comparisons. The settings are Tukey, REGWMR (Ryan/Einot-Gabriel/Welsch multiple range test), Duncan, Scheffe, FPLSD (Fisher’s Protected Least Significant Difference), FULSD (Fisher’s Unprotected Least Significant Difference), FPSTUDENTIZEDLSD (Fisher’s Protected Least Significant Difference, using the Studentized Range statistic rather than Student’s t), FUSTUDENTIZEDLSD (Fisher’s Unprotected Least Significant Difference, using the Studentized Range statistic), Bonferroni and Sidak. By default, no multiple comparisons are done. The results are saved in a textual column, with the means. This contains identical letters (a, b etc.) alongside the sets of means that do not differ significantly. For more details see procedure AMCOMPARISON, which is used to do the calculations.

The RMETHOD option selects the types of residual to save with the fitted values, with settings:

    simple ordinary “simple” residuals (labelled residual in the data frame),
    standardized residuals standardized according to their variances (labelled stdresidual), and
    combined residuals that incorporate the variation from all the strata, (labelled cbresidual).

By default, only simple residuals are saved. You can save more than one type of residual, by specifying a list of settings (and they are included in the data frame in the order with which they occur in the list).



Action with RESTRICT

If the Y variate in the analysis is restricted, that restriction will carry over into the fitted-values spreadsheet.

See also

Procedure: RXGENSTAT.

Commands for: Analysis of variance and Input and output.


CAPTION    'A2RDA example'; STYLE=meta
SPLOAD     '%gendir%/data/canola.gsh'
BLOCKS     block/plot
ANOVA      yield
" save the information "
           aovtable,means,sedmeans,replication,fittedvalues; OUTFILENAME=\
" show the contents of the file "
FOR        file='aovtable.rda','means.rda','sedmeans.rda','replication.rda',\
  IMPORT   file; ISAVE=cols
  PRINT    cols[]
  DELETE   [REDEFINE=yes] cols
  " tidy up by deleting file (delete the line below if you want to keep it) "
  FDELETE  file
Updated on June 20, 2019

Was this article helpful?