| coef.matreg | R Documentation |
Various extractor functions for objects of class "matreg". \loadmathjax
## S3 method for class 'matreg'
coef(object, ...)
## S3 method for class 'matreg'
vcov(object, ...)
## S3 method for class 'matreg'
sigma(object, REML=TRUE, ...)
## S3 method for class 'matreg'
logLik(object, REML=FALSE, ...)
## S3 method for class 'matreg'
AIC(object, ..., k=2, correct=FALSE, REML=FALSE)
## S3 method for class 'matreg'
BIC(object, ..., REML=FALSE)
## S3 method for class 'matreg'
confint(object, parm, level, digits, ...)
## S3 method for class 'confint.matreg'
print(x, digits=x$digits, ...)
object |
an object of class |
REML |
logical whether the returned value should be based on ML or REML estimation. |
k |
numeric value to specify the penalty per parameter. The default ( |
correct |
logical to specify whether the regular (default) or corrected (i.e., AICc) should be extracted. |
For confint():
parm |
this argument is here for compatibility with the generic function |
level |
numeric value between 0 and 100 to specify the confidence interval level (see here for details). If unspecified, the default is to take the value from the object. |
digits |
optional integer to specify the number of decimal places to which the results should be rounded. If unspecified, the default is to take the value from the object. |
x |
an object of class |
... |
other arguments. |
The coef function extracts the estimated (standardized) regression coefficients from objects of class "matreg". The vcov function extracts the corresponding variance-covariance matrix (note: the se function can also be used to extract the standard errors). The confint function extracts the confidence intervals.
Under the ‘Regular \mjseqnR Matrix’ case (see matreg), the sigma function extracts the square root of the estimated error variance (by default, based on the unbiased estimate of the error variance). The logLik, AIC, and BIC functions extract the corresponding values (note: for compatibility with the behavior for lm objects, these values are based by default on ML estimation).
Depending on the function, either a vector, a matrix, or a scalar with the extracted value(s).
Wolfgang Viechtbauer (wvb@metafor-project.org, https://www.metafor-project.org).
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://doi.org/10.18637/jss.v036.i03
matreg for the function to create matreg objects and predict.matreg to compute predicted values based on matreg objects.
### fit a regression model with lm() to the 'mtcars' dataset
res <- lm(mpg ~ hp + wt + am, data=mtcars)
summary(res)
coef(res)
vcov(res)
se(res)
sigma(res)
confint(res)
logLik(res)
AIC(res)
BIC(res)
### covariance matrix of the dataset
S <- cov(mtcars)
### fit the same regression model using matreg()
res <- matreg(mpg ~ hp + wt + am, R=S, cov=TRUE,
means=colMeans(mtcars), n=nrow(mtcars))
summary(res)
coef(res)
vcov(res)
se(res)
sigma(res)
confint(res)
logLik(res)
AIC(res)
BIC(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.