Zelig-factor-bayes-class: Bayesian Factor Analysis

Description Arguments Details Value Methods See Also Examples

Description

Bayesian Factor Analysis

Arguments

formula

a symbolic representation of the model to be estimated, in the form ~ Y1 + Y2 + Y3, where Y1, Y2, and Y3 are variables of interest in factor analysis (manifest variables), assumed to be normally distributed. The model requires a minimum of three manifest variables contained in the same dataset. The + symbol means “inclusion” not “addition.”

factors

number of the factors to be fitted (defaults to 2).

model

the name of a statistical model to estimate. For a list of other supported models and their documentation see: http://docs.zeligproject.org/articles/.

data

the name of a data frame containing the variables referenced in the formula or a list of multiply imputed data frames each having the same variable names and row numbers (created by Amelia or to_zelig_mi).

...

additional arguments passed to zelig, relevant for the model to be estimated.

by

a factor variable contained in data. If supplied, zelig will subset the data frame based on the levels in the by variable, and estimate a model for each subset. This can save a considerable amount of effort. You may also use by to run models using MatchIt subclasses.

cite

If is set to 'TRUE' (default), the model citation will be printed to the console.

Details

In addition, zelig() accepts the following additional arguments for model specification:

In addition, zelig() accepts the following additional inputs for bayes.factor:

The model also accepts the following additional arguments to specify prior parameters:

Additional parameters avaialable to this model include:

Value

Depending on the class of model selected, zelig will return an object with elements including coefficients, residuals, and formula which may be summarized using summary(z.out) or individually extracted using, for example, coef(z.out). See http://docs.zeligproject.org/articles/getters.html for a list of functions to extract model components. You can also extract whole fitted model objects using from_zelig_model.

Methods

zelig(formula, data, model = NULL, ..., weights = NULL, by, bootstrap = FALSE)

The zelig function estimates a variety of statistical models

See Also

Vignette: http://docs.zeligproject.org/articles/zelig_factorbayes.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
data(swiss)
names(swiss) <- c("Fert", "Agr", "Exam", "Educ", "Cath", "InfMort")
z.out <- zelig(~ Agr + Exam + Educ + Cath + InfMort,
model = "factor.bayes", data = swiss,
factors = 2, verbose = FALSE,
a0 = 1, b0 = 0.15, burnin = 500, mcmc = 5000)

z.out$geweke.diag()
z.out <- zelig(~ Agr + Exam + Educ + Cath + InfMort,
model = "factor.bayes", data = swiss, factors = 2,
lambda.constraints =
   list(Exam = list(1,"+"),
        Exam = list(2,"-"),
        Educ = c(2, 0),
        InfMort = c(1, 0)),
verbose = FALSE, a0 = 1, b0 = 0.15,
burnin = 500, mcmc = 5000)

z.out$geweke.diag()
z.out$heidel.diag()
z.out$raftery.diag()
summary(z.out)

## End(Not run)

Zelig documentation built on Jan. 8, 2021, 2:26 a.m.