Description Usage Arguments Details Value See Also Examples
Summary overview for an object of class 'lmvar'.
1 2 |
object |
Object of class 'lmvar' |
mu |
Boolean, specifies whether or not to include the coefficients β_μ in the table of coefficients |
sigma |
Boolean, specifies whether or not to include the coefficients β_σ in the table of coefficients |
... |
For compatibility with |
Standard errors and z-statistics are calculated under the assumption of asymptotic normality for maximum
likelihood estimators. They may not
be reliable when the number of observations in object is small.
An object of class 'summary_lmvar'. This is a list with the following members:
call Call that created object
coefficients Data frame
with one row for each element of β_μ and β_σ and the following variables.
Estimate maximum-likelihood estimate
Std. Error standard error, defined as √(var(β)) with var(β) the estimated variance
of β.
z value z-statistic, defined as β / √(var(β))
Pr(>|z|) p-value of the z-statistic, calculated from the standard normal distribution.
residuals A numeric vector with the minimum, the 25% quartile, the median, the 75% quartile and the maximum
standardized residual. The standardized residual of an observation is defined as (y - μ) / σ where y is the value
of the observation, μ the expectation value and σ
the standard deviation of the observation.
sigma A numeric vector with the minimum, the 25% quartile, the median, the 75% quartile and the maximum
standard deviation σ of all observations.
aliased_mu A named logical vector. The names are the column names of the user-supplied model matrix
X_μ. The values (TRUE or FALSE) tell whether or not the column
has been removed by lmvar to make the matrix full-rank.
aliased_sigma As aliased_mu but for the user-supplied model matrix X_σ.
logLik_ratio The difference in log-likelihood between the model in object and a classical linear
model with model matrix X_μ and a constant variance for all observations.
df_additional The difference in degrees in freedom between the model in object and a classical linear
model with model matrix X_μ and a constant variance for all observations. Is equal to NULL if
X_σ does not contain an intercept term.
p_value The p-value of 2 loglik_ratio, calculated from a chi-squared distribution with df
degrees of freedom. Is equal to NULL if there are no additional degrees of freedom.
nobs The number of observations in object.
df The degrees of freedom of the fit in object.
options A list of argument-values of the function call.
coef to extract the matrix with estimates, standard-errors, t-statistics and
p-values for β_μ and β_σ from a 'summary_lmvar' object.
vcov.lmvar for the covariance matrix of the β_μ and β_σ in an object of class
'lmvar'.
print.summary_lmvar for a print method for a 'summary_lmvar' object.
fitted.lmvar for the expected values and standard deviations
of the observations in an object of class 'lmvar'.
logLik.lmvar for the log-likelihood of a fit in an object of class 'lmvar'.
alias.lmvar_no_fit to obtain the aliased columns of the user-supplied model matrices in the call of lmvar.
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 26 | # 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)
colnames(X) = c("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)
# Print a summary of the fit
summary(fit)
# Include only the coefficients beta for the expected values
summary(fit, sigma = FALSE)
# Include only the coefficients beta for the standard deviations
summary(fit, mu = FALSE)
# Extract the matrix of coefficients from the summary
coef(summary(fit))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.