read.bayesx.output: Read BayesX Output from Directories

View source: R/read.bayesx.output.R

read.bayesx.outputR Documentation

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 one element in the output list. By convention, read.bayesx.output searches for existing .tex output files, and others, to identify different models in the dir folder.

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 R console with summary.bayesx.

Value

read.bayesx.output typically returns a list of class "bayesx" with the first element containing a list with the following objects:

formula

the STAR formula used,

bayesx.setup

an object of class "bayesx.input", see parse.bayesx.input,

bayesx.prg

a character containing the .prg file used for estimation with run.bayesx,

bayesx.run

details on processing with run.bayesx,

call

the original function call,

fitted.values

the fitted values of the estimated model,

residuals

the residuals of the estimated model,

effects

a list containing fitted effects of model terms, also see fitted.bayesx and samples,

fixed.effects

a matrix with estimation results for fixed effects,

variance

estimation results for the variance parameter of the model,

smooth.hyp

a matrix with estimation results smooth terms,

model.fit

list containing additional information to be supplied to summary.bayesx.

Author(s)

Nikolaus Umlauf, Thomas Kneib, Stefan Lang, Achim Zeileis.

See Also

summary.bayesx, plot.bayesx, samples.

Examples

## 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)

R2BayesX documentation built on Oct. 20, 2023, 9:11 a.m.