Learn R Programming

R2BayesX (version 0.1-2)

read.bayesx.output: Read BayesX Output from Directories

Description

This function automatically reads in BayesX estimation output which is stored in an output directory.

Usage

read.bayesx.output(dir, model.name = NULL)

Arguments

dir
a character string, specifies the directory file where BayesX output is stored.
model.name
a character string, specifies the base name of the model that should be read in, also see the examples. If not supplied read.bayesx.output tries to read in all existing model outputs in dir, every model is then stored as

Value

  • read.bayesx.output typically returns a list of class "bayesx" with the first element containing a list with the following objects:
  • formulathe STAR formula used,
  • bayesx.setupan object of class "bayesx.input", see parse.bayesx.input,
  • bayesx.prga character containing the .prg file used for estimation with run.bayesx,
  • bayesx.rundetails on processing with run.bayesx,
  • callthe original function call,
  • fitted.valuesthe fitted values of the estimated model,
  • residualsthe residuals of the estimated model,
  • effectsa list containing fitted effects of model terms, also see fitted.bayesx and samples,
  • fixed.effectsa matrix with estimation results for fixed effects,
  • varianceestimation results for the variance parameter of the model,
  • smooth.hypa matrix with estimation results smooth terms,
  • model.fitlist containing additional information to be supplied to summary.bayesx.

Details

The function searches for model term objects in the specified directory, which are then stored in a list. Each model term object will be of class xx.bayesx, so the generic functions described in plot.bayesx may be applied for visualizing the results. In addition summary statistics of the models may be printed to the Rconsole with summary.bayesx.

See Also

summary.bayesx, plot.bayesx, samples.

Examples

Run this code
## load example data from
## package example folder
dir <- file.path(find.package("R2BayesX"), "/examples/ex01")
b <- read.bayesx.output(dir)

## some model summaries
print(b)
summary(b)

## now plot estimated effects
plot(b)

## 2nd example
dir <- file.path(find.package("R2BayesX"), "/examples/ex02")
list.files(dir)

## dir contains of 2 different
## base names
## 01 only one nonparametric effect
b <- read.bayesx.output(dir, model.name = "nonparametric")
plot(b)

## 02 only one bivariate
## nonparametric effect
b <- read.bayesx.output(dir, model.name = "surface")
plot(b)

Run the code above in your browser using DataLab