Description Usage Arguments Details Value See Also Examples
Extracts maximum-likelihood estimators for β_μ and β_σ from an 'lmvar' object.
1 2 |
object |
Object of class 'lmvar' |
mu |
Boolean, specifies whether or not to return the maximum-likelihood estimator for β_μ |
sigma |
Boolean, specifies whether or not to return the maximum-likelihood estimator for β_σ |
... |
For compatibility with |
When both mu = TRUE
and sigma = TRUE
, the names of the
coefficients in β_σ are adapted to distinguish them from the names in β_μ, if needed.
When mu = TRUE
and sigma = TRUE
, a named numeric vector with the elements of β_μ,
followed by the elements of β_σ.
When mu = TRUE
and sigma = FALSE
, a named numeric vector with the elements of β_μ.
When mu = FALSE
and sigma = TRUE
, a named numeric vector with the elements of β_σ.
beta_sigma_names
for the adaptation of the names of the coefficients in β_σ.
confint
for the calculation of confidence intervals of β_μ and β_σ.
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 | # As example we use the dataset 'attenu' from the library 'datasets'. The dataset contains
# the response variable 'accel' and two explanatory variables 'mag' and 'dist'.
library(datasets)
# Create the model matrix for the expected values
X = cbind(attenu$mag, attenu$dist, attenu$mag + attenu$dist)
colnames(X) = c("mag", "dist", "mag+dist")
# Create the model matrix for the standard deviations.
X_s = cbind(attenu$mag, 1 / attenu$dist)
colnames(X_s) = c("mag", "dist_inv")
# Carry out the fit
fit = lmvar(attenu$accel, X, X_s)
# Extract all coefficients
coef(fit)
# Extract only the coefficients corresponding to the (non-aliased)
# columns in the model matrix for the expected values
coef(fit, sigma = FALSE)
# Extract only the coefficients corresponding to the (non-aliased)
# columns in the model matrix for standard deviations
coef(fit, mu = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.