lm
class.
zlm(formula, data = NULL, subset = NULL, g = "UIP")
lm
data.frame
(or one that can be coerced to that class): cf. lm
g="UIP"
corresponds to $g=N$, the number of observations (default);
g="BRIC"
corresponds to the benchmark prior suggested by Fernandez, Ley and Steel (2001), i.e $g=max(N, K^2)$, where K is the total number of covariates;
g="EBL"
estimates a local empirical Bayes g-parameter (as in Liang et al. (2008));
g="hyper"
takes the 'hyper-g' prior distribution (as in Liang et al., 2008) with the default hyper-parameter $a=3$;
This hyperparameter can be adjusted (between $2g="hyper=2.9", for instance.
Alternatively, g="hyper=UIP"
sets the prior expected value of the shrinkage factor equal to that of UIP (above), g="hyper=BRIC"
sets it according to BRIC
zlm
that contains at least the following elements (cf. lm
):terms
object usedgprior.info
in bms
zlm
estimates the coefficients of the following model $y = \alpha + X \beta + \epsilon$ where $\epsilon$ ~ $N(0,\sigma^2)$ and $X$ is the design matrix
The priors on the intercept $\alpha$ and the variance $\sigma$ are improper: $alpha \propto 1$, $sigma \propto \sigma^{-1}$
Zellner's g affects the prior on coefficients: $beta$ ~ $N(0, \sigma^2 g (X'X)^{-1})$.
Note that the prior mean of coefficients is set to zero by default and cannot be adjusted. Note moreover that zlm
always includes an intercept.
See also http://bms.zeugner.eu for additional help.
summary.zlm
and predict.lm
provide additional insights into zlm
output.
The function as.zlm
extracts a single out model of a bma
object (as e.g. created throughbms
).
Moreover, lm
for the standard OLS object, bms
for the application of zlm
in Bayesian model averaging.Check http://bms.zeugner.eu for additional help.
data(datafls)
#simple example
foo = zlm(datafls)
summary(foo)
#example with formula and subset
foo2 = zlm(y~GDP60+LifeExp, data=datafls, subset=2:70) #basic model, omitting three countries
summary(foo2)
Run the code above in your browser using DataLab